This file contains 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 characters
# Install Kubectl | |
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl | |
chmod +x ./kubectl | |
sudo mv ./kubectl /usr/local/bin/kubectl |
This file contains 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 characters
#Create Bucket | |
aws s3api create-bucket --bucket prefix-example-com-state-store --region us-east-1 | |
#Enable Versioning | |
aws s3api put-bucket-versioning --bucket prefix-example-com-state-store --versioning-configuration Status=Enabled | |
#Enable Bucket Encryption |
This file contains 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 characters
# Check AZ's in us-east-1 | |
aws ec2 describe-availability-zones --region us-east-1 | |
{ | |
"AvailabilityZones": [ | |
{ | |
"OptInStatus": "opt-in-not-required", | |
"Messages": [], | |
"ZoneId": "use1-az6", | |
"GroupName": "us-east-1", |
This file contains 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 characters
#Install KOPS | |
curl -Lo kops https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-linux-amd64 | |
chmod +x ./kops | |
sudo mv ./kops /usr/local/bin/ |
This file contains 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 characters
# Set Environment Variables for KOPS | |
export NAME=YourClusterName.k8s.local | |
export KOPS_STATE_STORE=s3://YourS3BucketName |
This file contains 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 characters
# Create KOPS Cluster Configuration | |
kops create cluster --zones us-east-1a,us-east-1b,us-east-1c ${NAME} | |
------------------------------------------------------------------------------ | |
# Result | |
[root@ec2-user] kops create cluster --zones us-east-1a,us-east-1b,us-east-1c ${NAME} | |
I0408 11:25:53.884925 26564 create_cluster.go:562] Inferred --cloud=aws from zone "us-east-1a" |
This file contains 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 characters
# Generate a ssh key for KOPS | |
ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa | |
kops create secret --name ${NAME} sshpublickey admin -i ~/.ssh/id_rsa.pub |
This file contains 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 characters
# Edit KOPS Master Node Configuration | |
kops edit cluster ${NAME} |
This file contains 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 characters
# Edit KOPS Worker Nodes Configuration | |
kops edit ig nodes --name ${NAME} | |
--------------------------------------------- | |
# Result | |
apiVersion: kops.k8s.io/v1alpha2 | |
kind: InstanceGroup |
This file contains 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 characters
# Get KOPS Configuration | |
kops get ig --name ${NAME} | |
------------------------------- | |
# Result | |
[root@ip-172-31-41-51 ec2-user]# kops get ig --name ${NAME} | |
NAME ROLE MACHINETYPE MIN MAX ZONES |
OlderNewer