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
+
1
20
# Para entender KEDA primero necesitas saber cómo autoescalan los pods dentro de un clúster
2
21
3
22
# ## Ejemplo de autoescalado sin KEDA
@@ -6,34 +25,17 @@ kubectl apply -f 04-cloud/00-aks/04-keda/manifests/autoscale-with-hpa.yml
6
25
kubectl autoscale deployment web --cpu-percent=30 --min=1 --max=5
7
26
kubectl get hpa --watch
8
27
9
- ab -n 50000 -c 200 http://51.104.177.27 /
28
+ ab -n 50000 -c 200 http://20.82.253.97 /
10
29
11
30
kubectl describe hpa web
12
31
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
-
20
32
# Instalar Helm
21
33
brew install helm
22
34
23
35
# Añadir el repo de KEDA
24
36
helm repo add kedacore https://kedacore.github.io/charts
25
37
helm repo update
26
38
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
-
37
39
# Creamos un namespace llamado keda
38
40
kubectl create namespace keda
39
41
@@ -47,7 +49,7 @@ kubectl get pods -n keda --watch
47
49
# Para ello nos apoyamos en un servicio llamado Azure Storage
48
50
49
51
# Creamos una cuenta de almacenamiento
50
- STORAGE_NAME=" boxoftasks "
52
+ STORAGE_NAME=" lemonboxoftasks "
51
53
az storage account create --name $STORAGE_NAME --resource-group $RESOURCE_GROUP
52
54
ACCOUNT_KEY=$( az storage account keys list --resource-group $RESOURCE_GROUP --account-name $STORAGE_NAME --query " [0].value" --output tsv)
53
55
0 commit comments