WIP…
Concepts
Please make sure you grab the initaial concepts, anywhere on world wide web. I found resource from container.training one of the best resource available to learn the following.
- Cluster | control plane, data plane
- Nodes
- Namespace
- Labels, Selectors
- Pods
- Services
- Deployment (ReplicaSet)
- Secrets
- Ingress
- …
Kubernetes Inernals
Safely skipping these for now. There are bunch of components/concepts:
- Kubernetes API
- Scheduler
- ETCD or alternatives
- …
Which we are good to know if you want to dive deep, but could be safely skipped as take it as if granted stuffs. Recommended to learn these at your free will, I am still learn so better not write about them for now.
Initial Setup
Cluster Setup over EKS can be done in multiple ways. I found eksctl with just bunch of flags as one of the easiest option. Please explore more with eksctl --help
options, it all well documented. Eg: the command to create a cluster with 3 nodes of type t3.medium.
i am assuming you will go or have gone via eksctl setup on your own, if you are blocked on this, please let me know ;)
time eksctl create cluster \
--name myeks \
--region us-west-2 \
--ssh-access \
--nodes 3 \
--node-type t3.medium \
# --node-private-networking #to use private subnets only
Above command will use cloudformation tempaltes (2 stacks):
to create vpc:
- default VPC CIDR used by `eksctl` is `192.168.0.0/16`, divided into 8 (`/19`) subnets (3 private, 3 public & 2 reserved).
- each of the EC2 instances in the initial nodegroup gets a public IP
to bootup nodes:
- 3 of EC2 instance of type t3.medium are used
- AMI image used by default is Amazon Linux 2 with ec2-user as default user
- Initial nodegroup of 3 is create in public subnets, with SSH access disabled unless `–ssh-access` is specified.
- All nodes will be brought up in Auto Scaling Group with all necessary tags in place
Since node are all managed with cloudformation, in any case we missed to configure them properly, a fresh sets of node could be created and attached to cluster with simple command and flags like:
eksctl create nodegroup \
--cluster=myeks \
--node-labels="autoscaling=enabled,purpose=sshaccess" \
--asg-access --full-ecr-access \
--ssh-access \
--node-type t3.medium --nodes 2 \
--node-private-networking
And old set of node could be easily cleanup by either deleting the stack or using eksctl
eksctl list nodegroup --cluster=myeks #list them first
eksctl delete nodegroup --cluster myeks --name ng-xxxxx #delete at your ease
Once your cluster is ready, you might be able to play around with kubectl
stuffs.
How to stuffs.
WIP..