Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of workload_identity_enabled and move container label #4

Open
loresuso opened this issue May 10, 2024 · 0 comments
Open

Use of workload_identity_enabled and move container label #4

loresuso opened this issue May 10, 2024 · 0 comments

Comments

@loresuso
Copy link

loresuso commented May 10, 2024

I don't know if I am right but this worked for me, you can entirely remove the helm module and use workload_identity_enabled when creating the cluster
See here:
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster#workload_identity_enabled
This should automatically enable workload identity e.g. by deploying the necessary mutating webhook

The other point is that the azure label should be put in the container in my opinion, not the service account:
https://github.com/epomatti/azure-workload-identity-terraform/blob/main/kubernetes/main.tf#L72
pretty much like here:
https://learn.microsoft.com/en-us/azure/aks/learn/tutorial-kubernetes-workload-identity#deploy-the-workload
(as you can see the label is in metadata of the pod definition). In this way, the mutating webhook will understand to inject the azure token + all the required env variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant