***** Installing Kops ******
curl -Lo kops https://github.com/kubernetes/kops/re... -s https://api.github.com/repos/kubernet... | grep tag_name | cut -d '"' -f 4)/kops-linux-amd64
chmod +x ./kops
sudo mv ./kops /usr/local/bin/
***** Installing Other Dependencies(KubeCtl) ******
$ curl -s https://packages.cloud.google.com/apt... | sudo apt-key add -
$ sudo touch /etc/apt/sources.list.d/kubernetes.list
$ echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
$ sudo apt-get update
$ sudo apt-get install -y kubectl
***** Download Python PIP ******
sudo apt-get update
sudo apt-get install python-pip
***** Installing AWS CLI ******
apt install awscli
SetUp AWS IAM permission for Kops.
➤ Create an user(kops) and give them permission.
➤ Permission required for Kops user.
AmazonEC2FullAccess
AmazonRoute53FullAccess
AmazonS3FullAccess
IAMFullAccess
AmazonVPCFullAccess
Configure User with AWS Account.
➤ Run command on your machine:
aws configure
➤ Provide AWS access Key and AWS Secret Access Key.
➤ S3 bucket for the KOPS_STATE_STORE.
➤ KOPS_STATE_STORE is the source of truth for all clusters
managed by Kops.
➤ Kops clusters must be valid DNS names.
➤ We need to SetUp DNS for the Kops Clusters.
➤ SetUp DNS in AWS
➤ With Kops 1.6.2 or later, then DNS configuration is
optional.
➤ The only requirement to trigger this is to have the cluster
name end with .k8s.local
SetUp Kubernetes Cluster on AWS with Kops
1. Generate SSH Key
ssh-keygen -f .ssh/id_rsa
****** Create Cluster *******
Command if you are using your Domain Name:
Like :
kops create cluster --yes --state=s3://kops-storage-b345987 --zones=ap-south-1a,ap-southeast-1b,ap-southeast-2c --node-count=2 --node-size=t2.micro --master-size=t2.micro --name=test.easybix.com
For Non DNS Base Cluster, work with .k8s.local
kops create cluster --yes --state=s3://kops-state-1988 --zones=ap-south-1a,ap-south-1b --node-count=2 --node-size=t2.micro --master-size=t2.micro --name=test.k8s.local
5. Validate Cluster
kops validate cluster --state=s3://S3-bucket-name