Starting on Amazon Kubernetes (EKS)
1 min readSep 17, 2021
First, it’s not easy. I’m migration infrastructure from DigitalOcean and it’s really complicated if we compare both services.
Creating a working cluster
Create VPC via CloudFormation
Create an stack (like k8s-stack-vpc), using this (last version on aws documentation):
https://amazon-eks.s3.us-west-2.amazonaws.com/cloudformation/2020-10-29/amazon-eks-vpc-private-subnets.yaml
Wait vpc ready… WAIT!
Create a cluster
On EKS create a cluster. You need a “EKS cluster” role?
Select previous created VPC and Security group. “Public and private”
Create nodes
On cluster details, go to Compute and add a Node Group. (EC2 role required)
Configure kubectl
aws sts get-caller-identity
aws eks update-kubeconfig --name <cluster_name>
kubectl get svc
kubectl config get-contexts
kubectl config rename-context <old> <new>
Another optional tools
Ingress
Install ingress and configure rules on deployments. Also, this annotation is required:
annotations:
kubernetes.io/ingress.class: nginx
K8S dashboard
kubectl --context ccluster -n kube-system describe secret $(kubectl -n kube-system --context ccluster get secret | grep eks-admin | awk '{print $1}')
kubectl proxy --context ccluster