Skip to content

Commit 4d0fff4

Browse files
authored
Merge pull request #201181 from tomkerkhove/tomkerkhove/keda/troubleshooting
feat: Introduce troubleshooting guide for KEDA
2 parents 989de03 + a8c913f commit 4d0fff4

File tree

6 files changed

+126
-39
lines changed

6 files changed

+126
-39
lines changed

articles/aks/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,8 @@
477477
href: keda-deploy-add-on-cli.md
478478
- name: Kubernetes Event-driven Autoscaler (KEDA) integrations
479479
href: keda-integrations.md
480+
- name: Troubleshoot Kubernetes Event-driven Autoscaler (KEDA)
481+
href: keda-troubleshoot.md
480482
- name: Use Web Application Routing (preview)
481483
href: web-app-routing.md
482484
- name: Use cluster extensions

articles/aks/keda-about.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Learn more about how KEDA works in the [official KEDA documentation][keda-archit
3131

3232
## Installation and version
3333

34-
KEDA can be added to your Azure Kubernetes Service (AKS) cluster by enabling the KEDA add-on using an [ARM template][keda-arm].
34+
KEDA can be added to your Azure Kubernetes Service (AKS) cluster by enabling the KEDA add-on using an [ARM template][keda-arm] or [Azure CLI][keda-cli].
3535

3636
The KEDA add-on provides a fully supported installation of KEDA that is integrated with AKS.
3737

@@ -63,11 +63,15 @@ For general KEDA questions, we recommend [visiting the FAQ overview][keda-faq].
6363
## Next steps
6464

6565
* [Enable the KEDA add-on with an ARM template][keda-arm]
66+
* [Enable the KEDA add-on with the Azure CLI][keda-cli]
67+
* [Troubleshoot KEDA add-on problems][keda-troubleshoot]
6668
* [Autoscale a .NET Core worker processing Azure Service Bus Queue messages][keda-sample]
6769

6870
<!-- LINKS - internal -->
6971
[keda-azure-cli]: keda-deploy-addon-az-cli.md
72+
[keda-cli]: keda-deploy-add-on-cli.md
7073
[keda-arm]: keda-deploy-add-on-arm.md
74+
[keda-troubleshoot]: keda-troubleshoot.md
7175

7276
<!-- LINKS - external -->
7377
[keda]: https://keda.sh/

articles/aks/keda-deploy-add-on-arm.md

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ This article shows you how to deploy the Kubernetes Event-driven Autoscaling (KE
2020

2121
- An Azure subscription. If you don't have an Azure subscription, you can create a [free account](https://azure.microsoft.com/free).
2222
- [Azure CLI installed](/cli/azure/install-azure-cli).
23+
- Firewall rules are configured to allow access to the Kubernetes API server. ([learn more][aks-firewall-requirements])
2324

2425
### Register the `AKS-KedaPreview` feature flag
2526

@@ -137,34 +138,20 @@ To remove the resource group, and all related resources, use the [Az PowerShell
137138
az group delete --name MyResourceGroup
138139
```
139140

140-
### Enabling add-on on clusters with self-managed open-source KEDA installations
141-
142-
While Kubernetes only allows one metric server to be installed, you can in theory install KEDA multiple times. However, it isn't recommended given only one installation will work.
143-
144-
When the KEDA add-on is installed in an AKS cluster, the previous installation of open-source KEDA will be overridden and the add-on will take over.
145-
146-
This means that the customization and configuration of the self-installed KEDA deployment will get lost and no longer be applied.
147-
148-
While there's a possibility that the existing autoscaling will keep on working, there's a risk given it will be configured differently and won't support features such as managed identity.
149-
150-
It's recommended to uninstall existing KEDA installations before enabling the KEDA add-on given the installation will succeed without any error.
151-
152-
Following error will be thrown in the operator logs but the installation of KEDA add-on will be completed.
153-
154-
Error logged in now-suppressed non-participating KEDA operator pod:
155-
the error logged inside the already installed KEDA operator logs.
156-
E0520 11:51:24.868081 1 leaderelection.go:330] error retrieving resource lock default/operator.keda.sh: config maps "operator.keda.sh" is forbidden: User "system:serviceaccount:default:keda-operator" can't get resource "config maps" in API group "" in the namespace "default"
157-
158141
## Next steps
159142

160-
This article showed you how to install the KEDA add-on on an AKS cluster, and then verify that it's installed and running. With the KEDA add-on installed on your cluster, you can [deploy a sample application][keda-sample] to start scaling apps
143+
This article showed you how to install the KEDA add-on on an AKS cluster, and then verify that it's installed and running. With the KEDA add-on installed on your cluster, you can [deploy a sample application][keda-sample] to start scaling apps.
144+
145+
You can troubleshoot troubleshoot KEDA add-on problems in [this article][keda-troubleshoot].
161146

162147
<!-- LINKS - internal -->
163148
[az-aks-create]: /cli/azure/aks#az-aks-create
164149
[az aks install-cli]: /cli/azure/aks#az-aks-install-cli
165150
[az aks get-credentials]: /cli/azure/aks#az-aks-get-credentials
166151
[az aks update]: /cli/azure/aks#az-aks-update
167152
[az-group-delete]: /cli/azure/group#az-group-delete
153+
[keda-troubleshoot]: keda-troubleshoot.md
154+
[aks-firewall-requirements]: limit-egress-traffic.md#azure-global-required-network-rules
168155

169156
<!-- LINKS - external -->
170157
[kubectl]: https://kubernetes.io/docs/user-guide/kubectl

articles/aks/keda-deploy-add-on-cli.md

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ This article shows you how to install the Kubernetes Event-driven Autoscaling (K
2121

2222
- An Azure subscription. If you don't have an Azure subscription, you can create a [free account](https://azure.microsoft.com/free).
2323
- [Azure CLI installed](/cli/azure/install-azure-cli).
24+
- Firewall rules are configured to allow access to the Kubernetes API server. ([learn more][aks-firewall-requirements])
2425

2526
### Install the extension `aks-preview`
2627

2728
Install the `aks-preview` extension in the AKS cluster to make sure you have the latest version of AKS extension before installing KEDA add-on.
2829

2930
```azurecli
30-
- az extension add --upgrade --name aks-preview
31+
az extension add --upgrade --name aks-preview
3132
```
3233

3334
### Register the `AKS-KedaPreview` feature flag
@@ -161,32 +162,18 @@ az aks update \
161162
--disable-keda
162163
```
163164

164-
### Enabling add-on on clusters with self-managed open-source KEDA installations
165-
166-
While Kubernetes only allows one metric server to be installed, you can in theory install KEDA multiple times. However, it isn't recommended given only one installation will work.
167-
168-
When the KEDA add-on is installed in an AKS cluster, the previous installation of open-source KEDA will be overridden and the add-on will take over.
169-
170-
This means that the customization and configuration of the self-installed KEDA deployment will get lost and no longer be applied.
171-
172-
While there's a possibility that the existing autoscaling will keep on working, there's a risk given it will be configured differently and won't support features such as managed identity.
173-
174-
It's recommended to uninstall existing KEDA installations before enabling the KEDA add-on given the installation will succeed without any error.
175-
176-
Following error will be thrown in the operator logs but the installation of KEDA add-on will be completed.
177-
178-
Error logged in now-suppressed non-participating KEDA operator pod:
179-
the error logged inside the already installed KEDA operator logs.
180-
E0520 11:51:24.868081 1 leaderelection.go:330] error retrieving resource lock default/operator.keda.sh: config maps "operator.keda.sh" is forbidden: User "system:serviceaccount:default:keda-operator" can't get resource "config maps" in API group "" in the namespace "default"
181-
182165
## Next steps
183166
This article showed you how to install the KEDA add-on on an AKS cluster using Azure CLI. The steps to verify that KEDA add-on is installed and running are included. With the KEDA add-on installed on your cluster, you can [deploy a sample application][keda-sample] to start scaling apps.
184167

168+
You can troubleshoot troubleshoot KEDA add-on problems in [this article][keda-troubleshoot].
169+
185170
[az-aks-create]: /cli/azure/aks#az-aks-create
186171
[az aks install-cli]: /cli/azure/aks#az-aks-install-cli
187172
[az aks get-credentials]: /cli/azure/aks#az-aks-get-credentials
188173
[az aks update]: /cli/azure/aks#az-aks-update
189174
[az-group-delete]: /cli/azure/group#az-group-delete
175+
[keda-troubleshoot]: keda-troubleshoot.md
176+
[aks-firewall-requirements]: limit-egress-traffic.md#azure-global-required-network-rules
190177

191178
[kubectl]: https://kubernetes.io/docs/user-guide/kubectl
192179
[keda]: https://keda.sh/

articles/aks/keda-integrations.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,15 @@ However, these external scalers aren't supported as part of the add-on and rely
4848
## Next steps
4949

5050
* [Enable the KEDA add-on with an ARM template][keda-arm]
51+
* [Enable the KEDA add-on with the Azure CLI][keda-cli]
52+
* [Troubleshoot KEDA add-on problems][keda-troubleshoot]
5153
* [Autoscale a .NET Core worker processing Azure Service Bus Queue message][keda-sample]
5254

5355
<!-- LINKS - internal -->
5456
[aks-support-policy]: support-policies.md
57+
[keda-cli]: keda-deploy-add-on-cli.md
5558
[keda-arm]: keda-deploy-add-on-arm.md
59+
[keda-troubleshoot]: keda-troubleshoot.md
5660

5761
<!-- LINKS - external -->
5862
[keda-scalers]: https://keda.sh/docs/latest/scalers/

articles/aks/keda-troubleshoot.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
title: Troubleshooting Kubernetes Event-driven Autoscaling (KEDA) add-on
3+
description: How to troubleshoot Kubernetes Event-driven Autoscaling add-on
4+
services: container-service
5+
ms.topic: article
6+
ms.date: 8/26/2021
7+
ms.author: tomkerkhove
8+
---
9+
10+
# Kubernetes Event-driven Autoscaling (KEDA) AKS add-on Troubleshooting Guides
11+
12+
When you deploy the KEDA AKS add-on, you could possibly experience problems associated with configuration of the application autoscaler.
13+
14+
The following guide will assist you on how to troubleshoot errors and resolve common problems with the add-on, in addition to the official KEDA [FAQ][keda-faq] & [troubleshooting guide][keda-troubleshooting].
15+
16+
## Verifying and Troubleshooting KEDA components
17+
18+
### Check available KEDA version
19+
20+
You can check the available KEDA version by using the `kubectl` command:
21+
22+
```azurecli-interactive
23+
kubectl get crd/scaledobjects.keda.sh -o custom-columns='APP:.metadata.labels.app\.kubernetes\.io/version'
24+
```
25+
26+
An overview will be provided with the installed KEDA version:
27+
28+
```Output
29+
APP
30+
2.7.0
31+
```
32+
33+
### Ensuring the cluster firewall is configured correctly
34+
35+
It might happen that KEDA isn't scaling applications because it can't start up.
36+
37+
When checking the operator logs, you might find errors similar to the following:
38+
39+
```output
40+
1.6545953013458195e+09 ERROR Failed to get API Group-Resources {"error": "Get \"https://10.0.0.1:443/api?timeout=32s\": EOF"}
41+
sigs.k8s.io/controller-runtime/pkg/cluster.New
42+
/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/cluster/cluster.go:160
43+
sigs.k8s.io/controller-runtime/pkg/manager.New
44+
/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/manager/manager.go:313
45+
main.main
46+
/workspace/main.go:87
47+
runtime.main
48+
/usr/local/go/src/runtime/proc.go:255
49+
1.6545953013459463e+09 ERROR setup unable to start manager {"error": "Get \"https://10.0.0.1:443/api?timeout=32s\": EOF"}
50+
main.main
51+
/workspace/main.go:97
52+
runtime.main
53+
/usr/local/go/src/runtime/proc.go:255
54+
```
55+
56+
While in the metric server you might notice that it's not able to start up:
57+
58+
```output
59+
I0607 09:53:05.297924 1 main.go:147] keda_metrics_adapter "msg"="KEDA Version: 2.7.1"
60+
I0607 09:53:05.297979 1 main.go:148] keda_metrics_adapter "msg"="KEDA Commit: "
61+
I0607 09:53:05.297996 1 main.go:149] keda_metrics_adapter "msg"="Go Version: go1.17.9"
62+
I0607 09:53:05.298006 1 main.go:150] keda_metrics_adapter "msg"="Go OS/Arch: linux/amd64"
63+
E0607 09:53:15.344324 1 logr.go:279] keda_metrics_adapter "msg"="Failed to get API Group-Resources" "error"="Get \"https://10.0.0.1:443/api?timeout=32s\": EOF"
64+
E0607 09:53:15.344360 1 main.go:104] keda_metrics_adapter "msg"="failed to setup manager" "error"="Get \"https://10.0.0.1:443/api?timeout=32s\": EOF"
65+
E0607 09:53:15.344378 1 main.go:209] keda_metrics_adapter "msg"="making provider" "error"="Get \"https://10.0.0.1:443/api?timeout=32s\": EOF"
66+
E0607 09:53:15.344399 1 main.go:168] keda_metrics_adapter "msg"="unable to run external metrics adapter" "error"="Get \"https://10.0.0.1:443/api?timeout=32s\": EOF"
67+
```
68+
69+
This most likely means that the KEDA add-on isn't able to start up due to a misconfigured firewall.
70+
71+
In order to make sure it runs correctly, make sure to configure the firewall to meet [the requirements][aks-firewall-requirements].
72+
73+
### Enabling add-on on clusters with self-managed open-source KEDA installations
74+
75+
While Kubernetes only allows one metric server to be installed, you can in theory install KEDA multiple times. However, it isn't recommended given only one installation will work.
76+
77+
When the KEDA add-on is installed in an AKS cluster, the previous installation of open-source KEDA will be overridden and the add-on will take over.
78+
79+
This means that the customization and configuration of the self-installed KEDA deployment will get lost and no longer be applied.
80+
81+
While there's a possibility that the existing autoscaling will keep on working, it introduces a risk given it will be configured differently and won't support features such as managed identity.
82+
83+
It's recommended to uninstall existing KEDA installations before enabling the KEDA add-on given the installation will succeed without any error.
84+
85+
In order to determine which metrics adapter is being used by KEDA, use the `kubectl` command:
86+
87+
```azurecli-interactive
88+
kubectl get APIService/v1beta1.external.metrics.k8s.io -o custom-columns='NAME:.spec.service.name,NAMESPACE:.spec.service.namespace'
89+
```
90+
91+
An overview will be provided showing the service and namespace that Kubernetes will use to get metrics:
92+
93+
```Output
94+
NAME NAMESPACE
95+
keda-operator-metrics-apiserver kube-system
96+
```
97+
98+
> [!WARNING]
99+
> If the namespace is not `kube-system`, then the AKS add-on is being ignored and another metric server is being used.
100+
101+
[aks-firewall-requirements]: limit-egress-traffic.md#azure-global-required-network-rules
102+
[keda-troubleshooting]: https://keda.sh/docs/latest/troubleshooting/
103+
[keda-faq]: https://keda.sh/docs/latest/faq/

0 commit comments

Comments
 (0)