Kubernetes with kops

Distribution Overview

  • Storage: etcd
  • CRI: containerd
  • CNI: kubenet

Installation Architectures

  • Single Node Cluster: Only configure a single server which hosts the control plane and can schedule workloads
  • Single controller, multi worker: one single node is designated as the controller, and then additional worker nodes are joined that will host the workloads
  • Multi controller, multi worker: The recommended architecture. Multiple controller nodes enable redundancy and fault tolerance, and multiple worker nodes can scale to host the various workloads.
  • expose all nodes with a public topology, or use a private topology with a single load-balanced DNS access
  • launch multiple controller nodes in different availability zones of AWS
  • stack etcd instances on each controller node, or setup an external etcd cluster

Installation Process

  • On the kops controller, install the AWS CLI
  • Define an AWS IAM user with the correct access permissions
  • Configure DNS-based access to your cluster by defining an AWS route 53 definition with a DNS name from Amazon or another external domain registration
  • Define an AWS S3 bucket to store the kops state (kops supports multi-cluster setup/maintenance, and uses an S3 bucket to store the different configuration assets)
  • Define in which AWS region the cluster is deployed, and determine the availability zones by running aws ec2 describe-availability-zones --region <region>
  • Create a new cluster by running this command
kops create cluster \
--name=${NAME} \
--cloud=aws \
--zones=eu-central-1a \
--discovery-store=s3://my-k8s-cluster/${NAME}/discovery
  • Configure the cluster by running kops edit cluster --name ${NAME}
  • Finally create the cluster with kops update cluster --name ${NAME} --yes
  • On the kops controller, use the kubeconfig file at location ~/.kube/config to access the cluster

Upgrade Process

  • Install a new version of the kops binary to match the targeted Kubernetes version
  • Edit the kops configuration file
  • Run kops edit cluster $NAME
  • Set the desired kubernetesVersion
  • Run kops update cluster $NAME to see the changes, then run the same command again with the --yes flag
  • Run kops rolling-update cluster $NAME to see the changes, then run the same command again with the --yes flag

Customization

  • etcd
  • Containerd
  • Docker (up to kops version v1.16)
  • AWS VPC
  • Calico
  • Canal
  • Cilium
  • Flannel
  • Kopeio
  • Kube Router
  • Kubenet

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store