Repository navigation
Helm chart: load the Azure service principal from a Secret - #6095
Conversation
| gcpTokenLifespan: "" | ||
| # -- The key in the secret to pull the Azure tenant ID from. Only required when using Azure with a service principal. | ||
| # @section -- Storage | ||
| azureTenantId: "" |
There was a problem hiding this comment.
It could be good to have support for named storages (for all providers).
There was a problem hiding this comment.
Agreed, that would be useful. I would like to keep this PR to the unnamed Azure keys, which match the existing AWS and GCP keys, and add named storage support for all three providers in a separate PR. It needs a new values structure with one entry per storage name, rather than a few more keys next to these.
|
Heads-up: #5967 has been merged, so Could you rebase onto |
storage.secret.azureTenantId, azureClientId and azureClientSecret load polaris.storage.azure.tenant-id, client-id and client-secret from the Secret named by storage.secret.name, like the existing AWS and GCP keys.
d2bb072 to
9db87e2
Compare
orca-review-bot
left a comment
There was a problem hiding this comment.
Looks good. It's a small change that matches how AWS and GCP already work. I checked that the env names match the @WithName values in StorageConfiguration and that polaris.secretToEnv outputs nothing when a key is empty, so existing installs render the same. Tests, schema, reference.md, the Azure page and the changelog fragment are all in. One small doc nit inline about setting all three keys together.
🤖 AI-generated review comment — agents make mistakes, so please verify before acting on it.
| # -- The key in the secret to pull the GCP token expiration time from. Only required when using GCP. Must be a valid ISO 8601 duration. The default is PT1H (1 hour). | ||
| # @section -- Storage | ||
| gcpTokenLifespan: "" | ||
| # -- The key in the secret to pull the Azure tenant ID from. Only required when using Azure with a service principal. |
There was a problem hiding this comment.
These keys only work as a set. If someone sets just the client secret, Polaris starts fine, then the first Azure request fails with "Incomplete Azure credentials on the server". Can we add "set all three or none" to these three descriptions? Then it shows up in reference.md too, not just in the PR description.
🤖 AI-generated review comment — agents make mistakes, so please verify before acting on it.
dimas-b
left a comment
There was a problem hiding this comment.
LGTM 👍 Thanks, @sririshindra !
flyrain
left a comment
There was a problem hiding this comment.
+1 Thanks @sririshindra !
| | storage.secret.gcpTokenLifespan | string | `""` | The key in the secret to pull the GCP token expiration time from. Only required when using GCP. Must be a valid ISO 8601 duration. The default is PT1H (1 hour). | | ||
| | storage.secret.azureTenantId | string | `""` | The key in the secret to pull the Azure tenant ID from. Only required when using Azure with a service principal. | | ||
| | storage.secret.azureClientId | string | `""` | The key in the secret to pull the Azure client ID from. Only required when using Azure with a service principal. | | ||
| | storage.secret.azureClientSecret | string | `""` | The key in the secret to pull the Azure client secret from. Only required when using Azure with a service principal. | |
There was a problem hiding this comment.
Did we cover the named storage secret config as well? If not, it could be a followup. Something like this:
advancedConfig:
polaris.features."RESOLVE_CREDENTIALS_BY_STORAGE_NAME": "true"
polaris.storage.azure.team-a.tenant-id: <tenant>
polaris.storage.azure.team-a.client-id: <appId>
extraEnv:
- name: polaris.storage.azure.team-a.client-secret
valueFrom:
secretKeyRef:
name: polaris-azure-team-a
key: client-secret
The chart can load the AWS and GCP server credentials from a Kubernetes
Secret(storage.secret.awsAccessKeyId,awsSecretAccessKey,gcpToken), but has nothing for Azure. #5952 addedpolaris.storage.azure.tenant-id,client-idandclient-secret, the Azure service principal used when nostorageNameselects a named one. This addsstorage.secret.azureTenantId,azureClientIdandazureClientSecret, which map those three properties from theSecretnamed bystorage.secret.name, in the same way as the existing keys. Each key is optional. A key left empty sets nothing, so a deployment that doesn't use them is unchanged. As with the properties themselves, set all three keys or none: if only some are set, Azure storage access fails.Named Azure storages (
polaris.storage.azure.<name>.*) still go throughadvancedConfigandextraEnv, as the Azure page shows. The chart has no per-name keys for any cloud today.Tested with
helm unittest(the deployment test now checks the three env vars).values.schema.jsonand the chart reference were regenerated withmake helm-schema-generateandmake helm-doc-generate.I used Claude Code while preparing this change.
Checklist
changelog.d/(if needed, seechangelog.d/README.md)site/content/in-dev/unreleased(if needed)CONTRIBUTING.md)