Open 1aziz opened 11 months ago
So, it seems I should use the kubelogin
command directly:
apiVersion: v1
kind: Secret
metadata:
name: aks-workload-dev-secret
namespace: argocd
data:
config: {
"execProviderConfig": {
"command": "kubelogin",
"args": [
"get-token",
"--login=msi",
"--server-id=REDACTED",
"--client-id= REDACTED"
],
"apiVersion": "client.authentication.k8s.io/v1beta1"
},
"tlsClientConfig": {
"insecure": false,
"caData": REDACTED
}
} name: aks-workload-dev
server: REDACTED
type: Opaque
With msi login flow, kubelogin does not useAZURE_CLIENT_ID
. It seems you need place the client id in AAD_SERVICE_PRINCIPAL_CLIENT_ID
instead. Perhaps the msi login flow should be added to the documentation as well.
---
apiVersion: v1
kind: Secret
metadata:
labels:
argocd.argoproj.io/secret-type: cluster
name: aks-workload-dev-secret-manual
namespace: argocd
stringData:
config: |
{
"execProviderConfig": {
"command": "argocd-k8s-auth",
"env": {
"AAD_SERVICE_PRINCIPAL_CLIENT_ID": REDACTED,
"AAD_LOGIN_METHOD": "msi"
},
"args": ["azure"],
"apiVersion": "client.authentication.k8s.io/v1beta1"
},
"tlsClientConfig": {
"insecure": true,
"caData": REDACTED
}
}
name: aks-workload-dev
server: REDACTED
type: Opaque
ArgoCD versions 2.10 and below have reached EOL. Can you upgrade and let us know if the issue is still present, please?
Checklist:
argocd version
.Describe the bug
I'm trying to add a new AKS cluster declaratively using kubelogin, but I'm getting the following error:
This is how my cluster Secret looks like:
I have already added the required configs to the deployment templates (for both the server and app controller) to use kubelogin:
The error could be caused by a formatting issue (maybe with my JSON in the Secret manifest), or I might have misconfigured something. I'd appreciate if someone could help, please.
To Reproduce
Expected behavior
Version
Logs