Skip to main content

Kubernetes Operations (KOPS)

Create, Manage. destroy kubernetes cluster using kops.

Benifits

  • Production-grade
  • Highly available
  • Fully automated
  • Cluster configuration in Infrastructure as Code
  • Self-healing: everything runs in Auto-Scaling Groups

References

How it works

When you run kops cli to create kubernetes cluster following steps happens (Explained for cluster running in AWS EC2 topology, not EKS)

  • It creates secrets and necessary objects needed to create cluster and stores in the S3 bucket defined by variable KOPS_STATE_STORE
  • If --target terraform is passed to kops create cluster, it created kubernetes.tf and data directory containing the configuration files such as IAM, Launchconfiguration files.
  • creates all the resources like AWS VPC NetworkRoute 53 records for API server and other, AutoScaling groups for master and nodes, Launch configurations
  • Controle plane/Master instaces create kubernetes cluster
  • Nodes join the clusters
note
kops create cluster will only creates configurations. Run kops update cluster to create cluster resources using the above configuration.

Commands

kops create cluster --zones=us-east-1c useast1.dev.example.com
kops get cluster # List clusters
kops edit cluster useast1.dev.example.com
kops edit ig --name=useast1.dev.example.com nodes # edit node instance groups
kops update cluster useast1.dev.example.com --yes
kops rolling-update cluster
kops delete cluster useast1.dev.example.com --yes
KOPS_STATE_STORE=s3://aws-s3-unique-bucket-name kops create secret --name useast1.dev.example.com sshpublickey admin -i ~/.ssh/id_rsa.pub

AWS_PROFILE=chops kops create cluster \
--name=useast1.dev.example.com \
--state=s3://aws-s3-unique-bucket-name \
--dns-zone=example.com \
--out=. \
--target=terraform \
--bastion=false \
--zones=us-east-1a,us-east-1b \
--ssh-public-key=~/.ssh/id_rsa.pub