[Version]
$ kops version

[Cluster]
● EXAMPLE 1:- Create a cluster in AWS in a single zone
$ kops create cluster --name=CLUSTER_NAME --state=s3://BUCKET_NAME --zones=AVAILABILITY_ZONE --node-count=NO
● EXAMPLE 2:- Create a cluster
$ export KOPS_STATE_STORE="s3://BUCKET_NAME"
$ export ZONES="AVAILABILITY_ZONE"
$ kops create cluster CLUSTER_NAME --cloud aws --zones $ZONES --master-zones $ZONES --node-count NO --yes
$ kops create cluster CLUSTER_NAME --cloud aws --zones $ZONES --control-plane-zones $ZONES --node-count NO --yes
● EXAMPLE 3:- Create a cluster in AWS with High Availability
$ export KOPS_STATE_STORE="s3://BUCKET_NAME"
$ export MASTER_SIZE="INSTANCE_TYPES"
$ export NODE_SIZE="INSTANCE_TYPES"
$ export ZONES="AVAILABILITY_ZONE_1,AVAILABILITY_ZONE_2,AVAILABILITY_ZONE_3"
$ kops create cluster CLUSTER_NAME --node-count NO --zones $ZONES --node-size $NODE_SIZE --master-size $MASTER_SIZE --master-zones $ZONES --networking cilium --bastion="true" --yes
$ kops create cluster CLUSTER_NAME --node-count NO --zones $ZONES --node-size $NODE_SIZE --control-plane-size $MASTER_SIZE --control-plane-zones $ZONES --networking cilium --bastion="true" --yes
● EXAMPLE 4:- Generate a cluster spec to apply later
$ kops create cluster --name=CLUSTER_NAME --state=s3://BUCKET_NAME --zones=AVAILABILITY_ZONE --node-count=NO --dry-run -o yaml > FILE_NAME.yaml
● EXAMPLE 5:- 
$ export KOPS_CLUSTER_NAME=CLUSTER_NAME
$ export KOPS_STATE_STORE=s3://BUCKET_NAME
$ kops create cluster --cloud=aws --zones=AVAILABILITY_ZONE --node-count=NO --node-size=INSTANCE_TYPES --master-size=INSTANCE_TYPES --name=${KOPS_CLUSTER_NAME}
$ kops create cluster --cloud=aws --zones=AVAILABILITY_ZONE --node-count=NO --node-size=INSTANCE_TYPES --control-plane-size=INSTANCE_TYPES --name=${KOPS_CLUSTER_NAME}
● EXAMPLE 6:-
$ export KOPS_CLUSTER_NAME=CLUSTER_NAME
$ export KOPS_STATE_STORE=s3://BUCKET_NAME
$ kops create cluster --name=${KOPS_CLUSTER_NAME} --state=${KOPS_STATE_STORE} --master-size=INSTANCE_TYPES --master-count NO --node-size=INSTANCE_TYPES --node-count=NO --zones=AVAILABILITY_ZONE_1,AVAILABILITY_ZONE_2,AVAILABILITY_ZONE_3 --dns ROUTE53_HOSTEDZONE_TYPES                                                # ROUTE53_HOSTEDZONE_TYPES = private/public
$ kops create cluster --name=${KOPS_CLUSTER_NAME} --state=${KOPS_STATE_STORE} --control-plane-size=INSTANCE_TYPES --control-plane-count NO --node-size=INSTANCE_TYPES --node-count=NO --zones=AVAILABILITY_ZONE_1,AVAILABILITY_ZONE_2,AVAILABILITY_ZONE_3 --dns ROUTE53_HOSTEDZONE_TYPES                                  # ROUTE53_HOSTEDZONE_TYPES = private/public
● EXAMPLE 7:-
$ export KOPS_STATE_STORE=s3://BUCKET_NAME
$ kops create cluster --cloud=aws --name=CLUSTER_NAME --zones=AVAILABILITY_ZONE --dns-zone=ROUTE53_HOSTEDZONE_NAME --dns ROUTE53_HOSTEDZONE_TYPES                                               # ROUTE53_HOSTEDZONE_TYPES = private/public
● EXAMPLE 8:-
$ export S3_BUCKET_NAME=BUCKET_NAME
$ export KOPS_STATE_STORE=s3://${S3_BUCKET_NAME}
$ kops create cluster --name CLUSTER_NAME --zones AVAILABILITY_ZONE_1,AVAILABILITY_ZONE_2,AVAILABILITY_ZONE_3 --networking amazonvpc --kubernetes-version VERSION_NO --yes
$ kops create cluster --name=CLUSTER_NAME --zones=AVAILABILITY_ZONE_1,AVAILABILITY_ZONE_2,AVAILABILITY_ZONE_3 --networking=amazonvpc --kubernetes-version=VERSION_NO --yes
● EXAMPLE 9:-
$ kops create cluster --name=CLUSTER_NAME --cloud=aws --zones=AVAILABILITY_ZONE_1,AVAILABILITY_ZONE_2,AVAILABILITY_ZONE_3 --master-size=INSTANCE_TYPES --master-zones=AVAILABILITY_ZONE_1,AVAILABILITY_ZONE_2,AVAILABILITY_ZONE_3 --node-size=INSTANCE_TYPES --node-count=NO --state=s3://BUCKET_NAME --yes
$ kops create cluster --name=CLUSTER_NAME --cloud=aws --zones=AVAILABILITY_ZONE_1,AVAILABILITY_ZONE_2,AVAILABILITY_ZONE_3 --control-plane-size=INSTANCE_TYPES --control-plane-zones=AVAILABILITY_ZONE_1,AVAILABILITY_ZONE_2,AVAILABILITY_ZONE_3 --node-size=INSTANCE_TYPES --node-count=NO --state=s3://BUCKET_NAME --yes
● EXAMPLE 10:-
$ kops create cluster --name CLUSTER_NAME --master-count NO --master-zones AVAILABILITY_ZONE --node-count NO --zones AVAILABILITY_ZONE --kubernetes-version=VERSION_NO --yes
$ kops create cluster --name CLUSTER_NAME --control-plane-count NO --control-plane-zones AVAILABILITY_ZONE --node-count NO --zones AVAILABILITY_ZONE --kubernetes-version=VERSION_NO --yes
● EXAMPLE 11:- Install "calico" along with setup of Kubernetes KOPS
$ kops create cluster --cloud=aws --name=CLUSTER_NAME --zones=AVAILABILITY_ZONE --networking calico --dns-zone=ROUTE53_HOSTEDZONE_NAME --dns ROUTE53_HOSTEDZONE_TYPES
$ kops create cluster --cloud=aws --name=CLUSTER_NAME --zones=AVAILABILITY_ZONE_1,AVAILABILITY_ZONE_2 --networking calico --master-size INSTANCE_TYPES --master-count NO --node-size INSTANCE_TYPES --node-count NO --dns-zone=ROUTE53_HOSTEDZONE_NAME --dns ROUTE53_HOSTEDZONE_TYPES
$ kops create cluster --cloud=aws --name=CLUSTER_NAME --zones=AVAILABILITY_ZONE_1,AVAILABILITY_ZONE_2 --networking calico --control-plane-size INSTANCE_TYPES --control-plane-count NO --node-size INSTANCE_TYPES --node-count NO --dns-zone=ROUTE53_HOSTEDZONE_NAME --dns ROUTE53_HOSTEDZONE_TYPES
● EXAMPLE 12:-
$ export KOPS_STATE_STORE=s3://BUCKET_NAME
$ export CLUSTER_NAME=CLUSTER_NAME
$ export VPC_ID=VPC_ID                                               # export the existing AWS VPC
$ export NETWORK_CIDR=VPC_CIDR_RANGE                                 # VPC_CIDR_RANGE = 172.20.0.0/16
$ kops create cluster --name=${CLUSTER_NAME} --vpc=${VPC_ID} --zones=AVAILABILITY_ZONE_1,AVAILABILITY_ZONE_2
● EXAMPLE 13:-
$ export NAME=CLUSTER_NAME
$ export KOPS_STATE_STORE=s3://BUCKET_NAME
$ kops create cluster ${NAME} --zones AVAILABILITY_ZONE --networking weave --master-size INSTANCE_TYPES --master-count NO --node-size INSTANCE_TYPES --node-count=NO
$ kops create cluster ${NAME} --zones AVAILABILITY_ZONE --networking weave --control-plane-size INSTANCE_TYPES --control-plane-count NO --node-size INSTANCE_TYPES --node-count=NO
● EXAMPLE 14:-
$ export KOPS_NAME=CLUSTER_NAME
$ export KOPS_STATE_STORE=s3://BUCKET_NAME
$ export PRIVATE_HOSTED_ZONE_ID=ROUTE53_HOSTEDZONE_NAME
$ kops create cluster --name $KOPS_NAME --state $KOPS_STATE_STORE --zones AVAILABILITY_ZONE_1,AVAILABILITY_ZONE_2,AVAILABILITY_ZONE_3 --networking weave --master-zones AVAILABILITY_ZONE_1,AVAILABILITY_ZONE_2,AVAILABILITY_ZONE_3 --master-size INSTANCE_TYPES --node-count NO --node-size INSTANCE_TYPES --dns-zone=${PRIVATE_HOSTED_ZONE_ID} --dns ROUTE53_HOSTEDZONE_TYPES --image IMAGE_ID_NAME --kubernetes-version=VERSION_NO --yes                                       # IMAGE_ID_NAME = AMI(Amazon Machine Image)_ID
$ kops create cluster --name $KOPS_NAME --state $KOPS_STATE_STORE --zones AVAILABILITY_ZONE_1,AVAILABILITY_ZONE_2,AVAILABILITY_ZONE_3 --networking weave --control-plane-zones AVAILABILITY_ZONE_1,AVAILABILITY_ZONE_2,AVAILABILITY_ZONE_3 --control-plane-size INSTANCE_TYPES --node-count NO --node-size INSTANCE_TYPES --dns-zone=${PRIVATE_HOSTED_ZONE_ID} --dns ROUTE53_HOSTEDZONE_TYPES --image IMAGE_ID_NAME --kubernetes-version=VERSION_NO --yes                         # IMAGE_ID_NAME = AMI(Amazon Machine Image)_ID
● EXAMPLE 15:-
$ export KOPS_STATE_STORE=s3://BUCKET_NAME
$ echo $KOPS_STATE_STORE                                              # read value (BUCKET_NAME) from the variable (KOPS_STATE_STORE)
$ kops create cluster --name CLUSTER_NAME --zones AVAILABILITY_ZONE --master-size INSTANCE_TYPES --node-size INSTANCE_TYPES --image IMAGE_ID_NAME --kubernetes-version VERSION_NO                                    # IMAGE_ID_NAME = AMI(Amazon Machine Image)_ID
$ kops create cluster --name CLUSTER_NAME --zones AVAILABILITY_ZONE --control-plane-size INSTANCE_TYPES --node-size INSTANCE_TYPES --image IMAGE_ID_NAME --kubernetes-version VERSION_NO                             # IMAGE_ID_NAME = AMI(Amazon Machine Image)_ID
● EXAMPLE 16:-
$ kops create cluster --name=CLUSTER_NAME --state=s3://BUCKET_NAME --zones=AVAILABILITY_ZONE --node-count=NO --node-size=INSTANCE_TYPES --master-size=INSTANCE_TYPES --master-volume-size=NO --node-volume-size=NO
$ kops create cluster --name=CLUSTER_NAME --state=s3://BUCKET_NAME --zones=AVAILABILITY_ZONE --node-count=NO --node-size=INSTANCE_TYPES --control-plane-size=INSTANCE_TYPES --control-plane-volume-size=NO --node-volume-size=NO

[YAML]
$ kops create -f FILE_NAME.yaml
$ kops delete -f FILE_NAME.yaml
$ kops replace -f FILE_NAME.yaml
$ kops replace -f FILE_NAME.yaml --force

[Get]
$ kops get CLUSTER_NAME
$ kops get CLUSTER_NAME -o yaml
$ kops get CLUSTER_NAME -o yaml > FILE_NAME.yaml
$ kops get cluster
$ kops get cluster --state=s3://BUCKET_NAME
$ kops get cluster CLUSTER_NAME
$ kops get cluster CLUSTER_NAME -o yaml
$ kops get cluster CLUSTER_NAME -o yaml > FILE_NAME.yaml
$ kops get clusters
$ kops get secret
$ kops get secrets
$ kops get secrets admin -o plaintext
$ kops get secrets admin -o plaintext --name CLUSTER_NAME
$ kops get instances --name CLUSTER_NAME
$ kops get ig                                                         
$ kops get instancegroups
$ kops get instancegroups INSTANCEGROUP_NAME

[Edit]
$ kops edit cluster --name CLUSTER_NAME
$ kops edit cluster
$ kops edit cluster CLUSTER_NAME
$ kops edit cluster CLUSTER_NAME --state s3://BUCKET_NAME
$ kops edit cluster CLUSTER_NAME --state=s3://BUCKET_NAME
$ kops edit ig INSTANCEGROUP_NAME                                     # scale up, scale down, change Instance Types, change Subnets Availability Zones (AZ)
$ kops edit instancegroups INSTANCEGROUP_NAME
$ kops edit ig --name=CLUSTER_NAME INSTANCEGROUP_NAME
$ kops edit ig --name=CLUSTER_NAME INSTANCEGROUP_NAME --state s3://BUCKET_NAME
$ kops edit ig --name=CLUSTER_NAME INSTANCEGROUP_NAME --state=s3://BUCKET_NAME

[Update]
$ kops update cluster --name CLUSTER_NAME
$ kops update cluster --name CLUSTER_NAME --yes
$ kops update cluster --name CLUSTER_NAME --yes --admin
$ kops update cluster --name CLUSTER_NAME --state s3://BUCKET_NAME --yes
$ kops update cluster --name CLUSTER_NAME --state s3://BUCKET_NAME --yes --admin
$ kops update cluster
$ kops update cluster --yes
$ kops update cluster CLUSTER_NAME
$ kops update cluster CLUSTER_NAME --yes
$ kops update cluster CLUSTER_NAME --yes --admin
$ kops update cluster CLUSTER_NAME --state s3://BUCKET_NAME --yes
$ kops update cluster CLUSTER_NAME --state=s3://BUCKET_NAME --yes
$ kops update cluster CLUSTER_NAME --yes --state=s3://BUCKET_NAME

[Validate]
$ kops validate cluster
$ kops validate cluster --wait MINUTES                                                        # MINUTES = 10m, Kops will try for 10 minutes to validate the cluster
$ kops validate cluster --wait MINUTES --count NO                                             # MINUTES = 10m & NO = 3, Kops will try for 10 minutes to validate the cluster 3 times
$ kops validate cluster --name CLUSTER_NAME
$ kops validate cluster --state s3://BUCKET_NAME
$ kops validate cluster --state=s3://BUCKET_NAME
$ kops vaildate cluster CLUSTER_NAME
$ kops validate cluster CLUSTER_NAME --state s3://BUCKET_NAME

[Upgrade]
Upgrade a kubernetes cluster, After this command is run, use "kops update cluster" and "kops rolling-update cluster" to finish a cluster upgrade
$ kops upgrade cluster --name CLUSTER_NAME --yes
$ kops upgrade cluster
$ kops upgrade cluster --yes
$ kops upgrade cluster CLUSTER_NAME --yes --state=s3://BUCKET_NAME

[Rolling Update]
$ kops rolling-update cluster --name CLUSTER_NAME --yes
$ kops rolling-update cluster
$ kops rolling-update cluster --yes
$ kops rolling-update cluster --master-interval=NOm --node-interval=NOm --yes                     # updates all nodes in the cluster first master and then worker, There is a 5-minute delay between restarting master nodes and a 2-minute delay between restarting worker nodes
$ kops rolling-update cluster --control-plane-interval=NOm --node-interval=NOm --yes
$ kops rolling-update cluster CLUSTER_NAME
$ kops rolling-update cluster CLUSTER_NAME --yes
$ kops rolling-update cluster CLUSTER_NAME --yes --fail-on-validate-error="false"
$ kops rolling-update cluster CLUSTER_NAME --yes --cloudonly --force

[Delete]
$ kops delete cluster --name CLUSTER_NAME
$ kops delete cluster --name CLUSTER_NAME --yes
$ kops delete cluster --name=CLUSTER_NAME --yes
$ kops delete cluster --name CLUSTER_NAME --state s3://BUCKET_NAME --yes
$ kops delete cluster --name=CLUSTER_NAME --state=s3://BUCKET_NAME --yes
$ kops delete cluster CLUSTER_NAME
$ kops delete cluster CLUSTER_NAME --yes
$ kops delete cluster CLUSTER_NAME --state s3://BUCKET_NAME
$ kops delete cluster CLUSTER_NAME --state s3://BUCKET_NAME --yes
$ kops delete cluster CLUSTER_NAME --state=s3://BUCKET_NAME --yes
$ kops delete instance EC2_INSTANCE_ID --yes                                              # EC2_INSTANCE_ID = i-xxxxxxxxxxxx
$ kops delete instance EC2_HOST_NAME --yes                                                # EC2_HOST_NAME = ip-xx.xx.xx.xx.ec2.internal
$ kops delete instance --cloudonly EC2_INSTANCE_ID --yes
$ kops delete secret SECRET_NAME

[Help]
$ kops create -h
$ kops create --help
$ kops create cluster -h
$ kops create cluster --help
$ kops rolling-update cluster --help
