EC2 Instance - Docker, kOps

create an IAM Roles with Permissions Policies.
AWS Service - EC2 then add policies "AmazonEC2FullAccess,AmazonS3FullAccess,AmazonVPCFullAccess,AmazonRoute53FullAccess,IAMFullAccess", now attach this role to an EC2 Instance.

create an IAM Users with Permissions Policies.
USER_NAME then add policies "AmazonEC2FullAccess,AmazonS3FullAccess,AmazonVPCFullAccess,AmazonRoute53FullAccess,IAMFullAccess",generate the "AccessKey and SecretAccessKey", now configure an "AccessKey and SecretAccessKey" using 'aws configure' in EC2 Instance.

create an S3 Bucket with name of "kops.aws".
$ export KOPS_STATE_STORE=s3://BUCKET_NAME
  export KOPS_STATE_STORE=s3://kops.aws

create an Route53 HostedZones with names of
* HostedZones_NAME=kops.aws.53
  HostedZones_TYPES=Private
* HostedZones_NAME=kops.aws
  HostedZones_TYPES=Public

generate SSH.
$ ssh-keygen
$ ssh-keygen -f .ssh/KEY_NAME
  ssh-keygen -f .ssh/aws

create an kOps cluster.
$ kops create cluster --name=CLUSTER_NAME --state=s3://BUCKET_NAME --node-count=NO --node-size=INSTANCE_TYPES --control-plane-size=INSTANCE_TYPES --dns-zone=ROUTE53_HOSTEDZONE_NAME --dns ROUTE53_HOSTEDZONE_TYPES --zones=AVAILABILITY_ZONE --ssh-public-key=~/.FOLDER_NAME/FILE_NAME.pub
  kops create cluster --name=awsdevops.kops.aws.org --state=s3://kops.aws --node-count=2 --node-size=t3.small --control-plane-size=t3.medium --dns-zone=kops.aws.org --dns private --zones=us-east-1a --ssh-public-key=~/.ssh/aws.pub

list clusters.
$ kops get cluster
$ kops get cluster --state=s3://BUCKET_NAME
  kops get cluster --state=s3://kops.aws

edit this cluster.
$ kops edit cluster CLUSTER_NAME
  kops edit cluster awsdevops.kops.aws.org

edit the node instance group.
$ kops edit ig --name=CLUSTER_NAME INSTANCEGROUP_NAME
  kops edit ig --name=awsdevops.kops.aws.org nodes-us-east-1a
$ kops edit ig --name=CLUSTER_NAME INSTANCEGROUP_NAME --state s3://BUCKET_NAME
  kops edit ig --name=awsdevops.kops.aws.org nodes-us-east-1a --state s3://kops.aws

edit the control-plane instance group.
$ kops edit ig --name=CLUSTER_NAME INSTANCEGROUP_NAME
  kops edit ig --name=awsdevops.kops.aws.org control-plane-us-east-1a
$ kops edit ig --name=CLUSTER_NAME INSTANCEGROUP_NAME --state=s3://BUCKET_NAME
  kops edit ig --name=awsdevops.kops.aws.org control-plane-us-east-1a --state=s3://kops.aws

update the cluster.
$ kops update cluster --name CLUSTER_NAME --yes --admin
  kops update cluster --name awsdevops.kops.aws.org --yes --admin
$ kops update cluster --name CLUSTER_NAME --state s3://BUCKET_NAME --yes --admin
  kops update cluster --name awsdevops.kops.aws.org --state s3://kops.aws --yes --admin

validate the cluster.
$ kops validate cluster
$ kops validate cluster --wait MINUTES
  kops validate cluster --wait 10m
$ kops validate cluster --state s3://BUCKET_NAME
  kops validate cluster --state s3://kops.aws
  
list the nodes.
$ kubectl get node
$ kubectl get nodes

delete the cluster.
$ kops delete cluster --name CLUSTER_NAME --yes
  kops delete cluster --name awsdevops.kops.aws.org --yes
$ kops delete cluster --name CLUSTER_NAME --state s3://BUCKET_NAME --yes
  kops delete cluster --name awsdevops.kops.aws.org --state s3://kops.aws --yes
