KOPS
Kops significantly simplifies the configuration and management of Kubernetes clusters compared to manually setting up master and worker nodes. It manages Route53, Auto Scaling Groups, ELBs for the API server, security groups, master bootstrapping, node bootstrapping, and rolling updates for your cluster. Since kops is an open-source tool, its use is completely free, but you are responsible for paying for and maintaining the extra infrastructure created by kops to manage your Kubernetes cluster.
Kops doesn't create clusters only on AWS but also on several other clouds such as GCP, OpenStack, Digital Ocean, Azure, Hetzner, and Spot Ocean.
Kops actually works with Terraform under the hood. It's even possible to export the Terraform code it creates.
The official documentation can provide more details https://kops.sigs.k8s.io/
Installation
Kops is nothing more than a CLI https://kops.sigs.k8s.io/getting_started/install/.
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/kops
AWS Requirements
https://kops.sigs.k8s.io/getting_started/aws/
The first thing you need is to have an AWS user with the permissions below, but usually you'll do this with a user whose permissions are typically administrator, but otherwise these are the necessary permissions.
- AmazonEC2FullAccess
- AmazonRoute53FullAccess
- AmazonS3FullAccess
- IAMFullAccess
- AmazonVPCFullAccess
- AmazonSQSFullAccess
- AmazonEventBridgeFullAccess
It's necessary to export the variables below in your terminal to use kops
export AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXXXXXXX
export AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXX
Another important detail is to have a place to store the cluster state, just as happens with Terraform.
Create an S3 bucket or use one that already exists, but make sure it's versioned
aws s3api create-bucket --bucket kops-states-company --region us-east-1
aws s3api put-bucket-versioning --bucket kops-states-company --region us-east-1 --versioning-configuration Status=Enabled
To avoid having to keep passing the --state flag, you can simply export the variable
export KOPS_STATE_STORE=s3://kops-states-company
Advantages and Disadvantages
Kops will manage most of the AWS resources needed to run a Kubernetes cluster and will work with a new or existing VPC. Unlike EKS, kops will also create your master nodes as EC2 instances, and you'll be able to access these nodes directly and make modifications. With access to the master nodes, you can choose which network layer to use, choose the size of the master instances, and directly monitor the master nodes. You also have the option to configure a cluster with just a single master, which may be desirable for development and test environments where high availability is not a requirement. Kops also supports generating Terraform configuration for your resources instead of creating them directly, which is a nice feature if you use Terraform.
Kops is the fastest way to have a fully functional production-ready cluster.