LinuxCommandLibrary

kops

Create, manage, and delete Kubernetes clusters

TLDR

Create a cluster from the configuration specification

$ kops create cluster [[-f|--filename]] [cluster_name.yaml]
copy

Create a new SSH public key
$ kops create sshpublickey [key_name] [[-i|--ssh-public-key]] [~/.ssh/id_rsa.pub]
copy

Export the cluster configuration to the ~/.kube/config file
$ kops export kubecfg [cluster_name]
copy

Get the cluster configuration as YAML
$ kops get cluster [cluster_name] [[-o|--output]] yaml
copy

Delete a cluster
$ kops delete cluster [cluster_name] [[-y|--yes]]
copy

Validate a cluster
$ kops validate cluster [cluster_name] --wait [wait_time_until_ready] --count [num_required_validations]
copy

SYNOPSIS

kops [global-flags] <command> [<args> ...]

PARAMETERS

--config string
    Path to kops config file

--help
    Show help

--log_backtrace_at traceLocation
    Log stack trace when log level >=2 at specified location

--log_dir string
    Directory to write log files

--logtostderr
    Log to stderr

--master string
    DNS name for the master node (legacy)

--name string
    Fully qualified cluster name

--ssh-public-key string
    Path to SSH public key

--state string
    State store location (e.g., s3://my-state-store)

--stdout
    Write events to stdout

--v LEVEL
    Log level (0-10)

--version
    Show version

--yes
    Non-interactive mode

DESCRIPTION

kops (Kubernetes Operations) is an open-source tool for creating, upgrading, destroying, and maintaining highly available Kubernetes clusters on cloud providers like AWS, GCP, Azure, and DigitalOcean.

It automates cluster provisioning with best practices, handling VPC setup, DNS, load balancers, IAM roles, and instance groups. Users define clusters via YAML manifests or CLI, stored in a state store (e.g., S3 bucket).

Key workflows: kops create cluster to bootstrap; kops update cluster to apply changes; kops rolling-update for node upgrades. Supports addons like Heapster, dashboard, and custom manifests.

Ideal for production environments needing high availability across multiple AZs. Integrates with kubectl for management post-creation. Requires cloud credentials and SSH keys.

CAVEATS

Requires cloud provider credentials and SSH access; AWS-focused historically, multi-cloud support varies; not for local/dev clusters (use minikube/kind); state store must be highly available.

MAIN SUBCOMMANDS

create cluster -- Bootstrap new cluster.
update cluster [--yes] -- Apply changes.
delete cluster -- Destroy cluster.
version -- Show kops/K8s versions.
get clusters|instances -- List resources.

EXAMPLES

kops create cluster mycluster.example.com --zones us-east-1a --node-count 3 --master-size t2.medium --node-size t2.micro
kops update cluster mycluster.example.com --yes

HISTORY

Developed by Kubernetes team starting 2015 as AWS cluster bootstrapper; reached v1.0 in 2016; expanded to multi-cloud (GCP 2017, DO 2018); actively maintained by SIGs with regular releases aligning Kubernetes versions.

SEE ALSO

kubectl(1), kubeadm(1), minikube(1)

Copied to clipboard