30 June 2021

EKS simple way

The simplest way to generate an AWS EKS

- install: awscli, eksctl, kubectl

 1.
eksctl create cluster -f cluster.yml
(it takes several minutes, 20 mins?)

cluster.yml:



2.
eksctl delete cluster --region=us-west-1 --name=my-kube-config


3.
eksctl get cluster

4.
kubectl config view

5.
//mandatory? (yep!)
aws eks update-kubeconfig --name <cluster-name>
aws eks update-kubeconfig --name cobroqr-eks-RCXW8qM5



6.
kubectl create deployment hello-node --image=k8s.gcr.io/echoserver:1.4

7.
kubectl get deployment

8.
kubectl get pods

9.
kubectl expose deployment hello-node --type=LoadBalancer --port=8080

10.
kubectl get services
(aca deberia aparecer el service nuevo agregado arriba en "expose" como LoadBalancer).
aca sale tb el EXTERNAL-IP para poder probar

11.
kubectl exec --stdin --tty hello-node-7567d9fdc9-6lbx4 -- /bin/bash
(del kubectl get pods)


12.
kubectl delete deployment --all
  deployment.apps "books-node" deleted
  deployment.apps "hello-node" deleted


13.
eksctl delete cluster --name <cluster-name>
eksctl delete cluster --name my-kube-config.us-west-1.eksctl.io




---------------------------

more examples:


6.
kubectl create deployment books-node --image=091501399925.dkr.ecr.us-west-1.amazonaws.com/ecr-eks-sandbox:latest

(al ver get deployment y get pods, veo que hay 1 pod por deploy...

9.
kubectl expose deployment books-node --type=LoadBalancer --port=8080


curl http://af760c2d8e8ff40608558465fa4a4a4e-710530633.us-west-1.elb.amazonaws.com:8080/books
(se demora en publicar)


12.
kubectl delete deployment --all



No comments :

Blog Archive

Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.