Last active
October 19, 2024 06:47
-
-
Save yetanotherchris/d368b8c24f0da3a9ed5cbd904db98fa7 to your computer and use it in GitHub Desktop.
Revisions
-
yetanotherchris revised this gist
Jul 27, 2017 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,9 +11,10 @@ aws config # Pass the keys to Kops via env vars printf "Enter an AWS access key" read accesskey printf "Enter an AWS secret key" read secretKey export AWS_ACCESS_KEY_ID=$accessKey export AWS_SECRET_ACCESS_KEY=$secretKey @@ -32,9 +33,10 @@ aws iam add-user-to-group --user-name kops --group-name kops # Create an S3 bucket printf "Enter an S3 bucket name to create: " read s3BucketName export KOPS_STATE_STORE=s3://$s3BucketName aws s3api create-bucket --bucket $s3BucketName --region eu-west-1 # Example of creating a cluster printf "Enter a cluster name" -
yetanotherchris created this gist
Jul 27, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ # Install AWS CLI, Kubectl, Kops sudo apt update sudo apt install -y awscli sudo snap install kubectl --classic curl -LO https://github.com/kubernetes/kops/releases/download/1.7.0/kops-linux-amd64 chmod +x kops-linux-amd64 mv ./kops-linux-amd64 /usr/local/bin/kops # Setup the AWS profile aws config # Pass the keys to Kops via env vars printf "Enter an AWS access key" read $accesskey printf "Enter an AWS secret key" read $secretKey export AWS_ACCESS_KEY_ID=$accessKey export AWS_SECRET_ACCESS_KEY=$secretKey # Create the IAM user, groups, roles aws iam create-group --group-name kops aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonEC2FullAccess --group-name kops aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonRoute53FullAccess --group-name kops aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess --group-name kops aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/IAMFullAccess --group-name kops aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonVPCFullAccess --group-name kops aws iam create-user --user-name kops aws iam add-user-to-group --user-name kops --group-name kops # Create an S3 bucket printf "Enter an S3 bucket name to create: " read S3_BUCKET_NAME export KOPS_STATE_STORE=s3://$S3_BUCKET_NAME aws s3api create-bucket --bucket S3_BUCKET_NAME --region eu-west-1 # Example of creating a cluster printf "Enter a cluster name" read name export KOPS_CLUSTER_NAME=$name kops create cluster --name=$KOPS_CLUSTER_NAME --cloud=aws --zones=eu-west-1a --state=$KOPS_STATE_STORE