Skip to content

Commit 6e0df8b

Browse files
authored
Merge pull request #188872 from csand-msft/main
Add TS for Flux extension error with AAD Pod Identity
2 parents cb3bc82 + 385a3bd commit 6e0df8b

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

articles/azure-arc/kubernetes/troubleshooting.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Troubleshoot common Azure Arc-enabled Kubernetes issues"
33
services: azure-arc
44
ms.service: azure-arc
55
#ms.subservice: azure-arc-kubernetes coming soon
6-
ms.date: 02/15/2022
6+
ms.date: 02/16/2022
77
ms.topic: article
88
description: "Troubleshooting common issues with Azure Arc-enabled Kubernetes clusters and GitOps."
99
keywords: "Kubernetes, Arc, Azure, containers, GitOps, Flux"
@@ -150,7 +150,7 @@ To recover from this issue, follow these steps:
150150

151151
## GitOps management
152152

153-
### General
153+
### Flux v1 - General
154154

155155
To help troubleshoot issues with `sourceControlConfigurations` resource (Flux v1), run these az commands with `--debug` parameter specified:
156156

@@ -166,7 +166,7 @@ az provider show -n Microsoft.KubernetesConfiguration --debug
166166
az k8s-configuration flux create <parameters> --debug
167167
```
168168

169-
### Create configurations
169+
### Flux v1 - Create configurations
170170

171171
Write permissions on the Azure Arc-enabled Kubernetes resource (`Microsoft.Kubernetes/connectedClusters/Write`) are necessary and sufficient for creating configurations on that cluster.
172172

@@ -214,7 +214,7 @@ metadata:
214214
selfLink: ""
215215
```
216216

217-
### Installing the `microsoft.flux` extension (Flux v2)
217+
### Flux v2 - Error installing the `microsoft.flux` extension
218218

219219
The `microsoft.flux` extension installs the Flux controllers and Azure GitOps agents into your Azure Arc-enabled Kubernetes or Azure Kubernetes Service (AKS) clusters. If the extension is not already installed in a cluster and you create a GitOps configuration resource for that cluster, the extension will be installed automatically.
220220

@@ -285,6 +285,35 @@ Some other aspects to consider:
285285

286286
With these actions accomplished you can either [re-create a flux configuration](./tutorial-use-gitops-flux2.md) which will install the flux extension automatically or you can re-install the flux extension manually.
287287

288+
### Flux v2 - Installing the `microsoft.flux` extension in a cluster with AAD Pod Identity enabled
289+
290+
If you attempt to install the Flux extension in a cluster that has AAD Pod Identity enabled, an error may occur in the extension-agent pod.
291+
292+
```console
293+
{"Message":"2021/12/02 10:24:56 Error: in getting auth header : error {adal: Refresh request failed. Status Code = '404'. Response body: no azure identity found for request clientID <REDACTED>\n}","LogType":"ConfigAgentTrace","LogLevel":"Information","Environment":"prod","Role":"ClusterConfigAgent","Location":"westeurope","ArmId":"/subscriptions/<REDACTED>/resourceGroups/<REDACTED>/providers/Microsoft.Kubernetes/managedclusters/<REDACTED>","CorrelationId":"","AgentName":"FluxConfigAgent","AgentVersion":"0.4.2","AgentTimestamp":"2021/12/02 10:24:56"}
294+
```
295+
296+
The extension status also returns as "Failed".
297+
298+
```console
299+
"{\"status\":\"Failed\",\"error\":{\"code\":\"ResourceOperationFailure\",\"message\":\"The resource operation completed with terminal provisioning state 'Failed'.\",\"details\":[{\"code\":\"ExtensionCreationFailed\",\"message\":\" error: Unable to get the status from the local CRD with the error : {Error : Retry for given duration didn't get any results with err {status not populated}}\"}]}}",
300+
```
301+
302+
The issue is that the extension-agent pod is trying to get its token from IMDS on the cluster in order to talk to the extension service in Azure; however, this token request is being intercepted by pod identity ([details here](../../aks/use-azure-ad-pod-identity.md)).
303+
304+
The workaround is to create an `AzurePodIdentityException` that will tell AAD Pod Identity to ignore the token requests from flux-extension pods.
305+
306+
```console
307+
apiVersion: aadpodidentity.k8s.io/v1
308+
kind: AzurePodIdentityException
309+
metadata:
310+
name: flux-extension-exception
311+
namespace: flux-system
312+
spec:
313+
podLabels:
314+
app.kubernetes.io/name: flux-extension
315+
```
316+
288317
## Monitoring
289318

290319
Azure Monitor for containers requires its DaemonSet to be run in privileged mode. To successfully set up a Canonical Charmed Kubernetes cluster for monitoring, run the following command:

0 commit comments

Comments
 (0)