1+ # KEDA
2+ # https://www.returngis.net/2020/06/autoescalar-tus-aplicaciones-en-kubernetes-con-keda/
3+
4+ # Variables
5+ RESOURCE_GROUP=" KEDA"
6+ AKS_NAME=" lemoncode-keda"
7+
8+ # Creamos el grupo de recursos
9+ az group create -n ${RESOURCE_GROUP} -l ${LOCATION}
10+
11+ # Creamos un cluster
12+ az aks create -g ${RESOURCE_GROUP} \
13+ -n ${AKS_NAME} \
14+ --node-count 1 \
15+ --generate-ssh-keys
16+
17+ # Configuramos kubectl para comunicarnos con nuestro nuevo clúster
18+ az aks get-credentials -g ${RESOURCE_GROUP} -n ${AKS_NAME}
19+
120# Para entender KEDA primero necesitas saber cómo autoescalan los pods dentro de un clúster
221
322# ## Ejemplo de autoescalado sin KEDA
@@ -6,34 +25,17 @@ kubectl apply -f 04-cloud/00-aks/04-keda/manifests/autoscale-with-hpa.yml
625kubectl autoscale deployment web --cpu-percent=30 --min=1 --max=5
726kubectl get hpa --watch
827
9- ab -n 50000 -c 200 http://51.104.177.27 /
28+ ab -n 50000 -c 200 http://20.82.253.97 /
1029
1130kubectl describe hpa web
1231
13- # KEDA
14- # https://www.returngis.net/2020/06/autoescalar-tus-aplicaciones-en-kubernetes-con-keda/
15-
16- # Variables
17- RESOURCE_GROUP=" KEDA"
18- AKS_NAME=" lemoncode-keda"
19-
2032# Instalar Helm
2133brew install helm
2234
2335# Añadir el repo de KEDA
2436helm repo add kedacore https://kedacore.github.io/charts
2537helm repo update
2638
27- # Creamos el grupo de recursos
28- az group create -n ${RESOURCE_GROUP} -l ${LOCATION}
29-
30- # Creamos un cluster
31- az aks create -g ${RESOURCE_GROUP} -n ${AKS_NAME} \
32- --node-count 1 --generate-ssh-keys
33-
34- # Configuramos kubectl para comunicarnos con nuestro nuevo clúster
35- az aks get-credentials -g ${RESOURCE_GROUP} -n ${AKS_NAME}
36-
3739# Creamos un namespace llamado keda
3840kubectl create namespace keda
3941
@@ -47,7 +49,7 @@ kubectl get pods -n keda --watch
4749# Para ello nos apoyamos en un servicio llamado Azure Storage
4850
4951# Creamos una cuenta de almacenamiento
50- STORAGE_NAME=" boxoftasks "
52+ STORAGE_NAME=" lemonboxoftasks "
5153az storage account create --name $STORAGE_NAME --resource-group $RESOURCE_GROUP
5254ACCOUNT_KEY=$( az storage account keys list --resource-group $RESOURCE_GROUP --account-name $STORAGE_NAME --query " [0].value" --output tsv)
5355
0 commit comments