Skip to content

punkerside/kubernetes-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elastic Container Service for Kubernetes - Amazon EKS

Build Status GitHub Issues GitHub Tag

Prerrequisitos

Recursos desplegados

1. Amazon AWS

  • Virtual Private Cloud (VPC)
  • Identity and Access Management (IAM)
  • Elastic Container Service for Kubernetes (EKS)
  • Amazon EKS managed node (EKS)

2. Kubernetes

  • Metrics Server
  • Cluster Autoscaler (CA)
  • AWS Container Insights
  • AWS XRay
  • Nginx Controller
  • Guestbook

Variables

Name Description Type Default Required
PROJECT Nombre del proyecto string falcon no
ENV Nombre del entorno string k8s no
AWS_REGION Region de Amazon AWS string us-east-1 no
EKS_VERSION Version de Kubernetes string 1.21 no

Uso

  1. Crear cluster y nodes
make cluster
  1. Instalar Metrics Server
make metrics-server
  1. Instalar Cluster Autoscaler
make cluster-autoscaler
  • Iniciar el escalado de pods y nodos:
kubectl apply -f https://k8s.io/examples/application/php-apache.yaml
kubectl autoscale deployment php-apache --cpu-percent=50 --min=1 --max=100
kubectl run apache-bench -i --tty --rm --image=httpd -- ab -n 5000000 -c 200 http://php-apache.default.svc.cluster.local/
  • Revisar el escalado de pods:
kubectl get hpa --watch

  • Revisar el escalado de nodos:
kubectl get nodes --watch

  • Revisar logs de cluster-autoscaler:
kubectl logs -f deployment/cluster-autoscaler -n kube-system

  1. Instalar AWS Container Insights
make container-insights

  1. Instalar AWS X-Ray
make xray

  1. Desplegar AWS X-Ray Sample
make xray-sample
  • Capturar DNS del balanceador asociado al servicio:
kubectl get service x-ray-sample-front-k8s -o wide

  1. Desplegar Nginx Ingress Controller
make nginx-controller
  1. Desplegar Guestbook
make guestbook
  • Capturar DNS del balanceador asociado al Nginx Ingress Controller:
kubectl get service nginx-ingress-nginx-ingress -o wide

Eliminar

make destroy

Autor

Ivan Echegaray Avendaño