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

Don't add empty AZURE_CLIENT_ID #1555

Open
weisdd opened this issue Feb 14, 2025 · 0 comments
Open

Don't add empty AZURE_CLIENT_ID #1555

weisdd opened this issue Feb 14, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@weisdd
Copy link

weisdd commented Feb 14, 2025

Is your feature request related to a problem? Please describe.

When AZURE_CLIENT_ID env is imported into a pod using envFrom secretRef method (meaning no annotation is set on a ServiceAccount), the workload identity webhook adds an empty AZURE_CLIENT_ID to env section of a container spec.
Due to env section having higher precedence in Kubernetes, when a container starts it gets an empty AZURE_CLIENT_ID.

Describe the solution you'd like

Since having empty AZURE_CLIENT_ID is of no use, it would be better if webhook stops adding empty AZURE_CLIENT_ID.

Describe alternatives you've considered

env:
  - name: AZURE_CLIENT_ID
    valueFrom:
      secretKeyRef:
        name: postgresql-scripts-database-backups-kv
        key: AZURE_CLIENT_ID

The issue with this approach is that not every helm chart offers a way to pass secretKeyRef, sometimes only envFrom secretRef is available.

Additional context

In our environment, terraform is used to generate a managed identity and to save a client ID into an Azure Key Vault.

Then, external-secrets operator fetches the client ID (along with other secrets) from the Key Vault and saves it into a k8s secret with a key AZURE_CLIENT_ID.

Pods have the following in their spec to populate environment variables:

envFrom:
  - secretRef:
      name: <name>
@weisdd weisdd added the enhancement New feature or request label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant