terraform plan & apply:
cd terraform
terraform plan
terraform apply
apply EKS kubeconfig:
aws eks --region ap-northeast-1 update-kubeconfig --name demo
Show running nodes:
kubectl get nodes
Show running pods:
kubectl get pods --all-namespaces
deploy nginx ingress controller and metrics server:
kubectl apply -f kubernetes/
dockerlize example app:
docker build -t archean/echo:1.0.0 .
push to hub.docker.com:
docker push archean/echo:1.0.0
deploy example app: echo:
kubectl apply -f deploy/
check web service:
ip=$(kubectl get ingress echo -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
curl -H 'Host:example.com' http://$ip/ping
manual scale up echo app:
kubectl scale deployment echo --replicas=2
automatic scale up nodes:
kubectl apply -f kubernetes/cluster-autoscaler.yaml
kubectl scale deployment echo --replicas=5
see nodes auto scale up:
kubectl get nodes -w
delete example app:
kubectl delete -f deploy/
delete cluster infrastructure:
kubectl delete -f kubernetes/
destroy EKS cluster:
terraform destory