-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Azure storage with federated workload identity #12614
Comments
Unless I am misinterpreting this PR, I think this is a documentation issue, not a feature support issue. It looks like Workload Identity is already implemented. I will be trying to get it working myself in the coming days. Edit: Nevermind, I see that PR was specificly for the Loki Operator, not Loki itself. |
Good news! |
I had to add this to the helm values to get it to work: loki:
podLabels:
azure.workload.identity/use: 'true' |
yes, I assumed that was a given when using workload identity. There are a number of other things that need to be setup, like a "federated credential" azure resource, and enabling some settings on your azure kubernetes cluster to allow it to issue OIDC tokens. serviceAccount:
annotations:
azure.workload.identity/client-id: 'your-client-id-here'
labels:
azure.workload.identity/use: 'true' |
To be fair, not everything requires the |
Tried this tonight, but getting a panic from ADAL(!?) The workload identity token is added to the pod with the usual AZURE_ env variables...
Helm Values
monitoring:
serviceMonitor:
enable: true
loki:
podLabels:
azure.workload.identity/use: 'true'
commonConfig:
path_prefix: /var/loki
replication_factor: 3
compactor_address: '{{ include "loki.compactorAddress" . }}'
schemaConfig:
configs:
- from: "2024-04-01"
store: tsdb
index:
prefix: loki_index_
period: 24h
object_store: azure
schema: v13
storage:
type: azure
bucketNames:
chunks: loki-chunks # Needs to pre-exist
ruler: loki-rulers # Needs to pre-exist
admin: loki-admin # Needs to pre-exist
azure:
accountName: redacted
userAssignedId: "redacted"
endpointSuffix: blob.core.windows.net
useFederatedToken: true
singleBinary:
replicas: 0
extraArgs:
- "-config.expand-env=true"
deploymentMode: SingleBinary |
@Richard87 Indeed, I came to this issue board to raise an issue on this when I saw this thread already open.
This is quite concerning as the |
This issue is about workload identity, not managed identity. While workload identity makes use of managed identities under the hood, it is a different authentication method. I'm not a Loki maintainer, but I suspect it would be better to create a new issue either about managed identity authentication, or more generally about the deprecated ADAL library, which might get more attention. When Loki is updated to the |
These are the relevant helm values I am using successfully for Workload Identity on Loki Helm Chart 6.5.2 loki:
podLabels:
"azure.workload.identity/use": "true"
storage:
type: "azure"
azure:
accountName: "redacted"
useFederatedToken: true
bucketNames:
chunks: "loki-chunk-store"
ruler: "loki-ruler-store"
serviceAccount:
annotations:
"azure.workload.identity/client-id": "redacted"
labels:
"azure.workload.identity/use": "true" |
Thanks, I added (And when creating the bucket names in the correct storage account, everything worked great! 🙏 ) |
In case somebody is having any issue to populate the ConfigMap with proper Azure storage values for the chunks: just try disabling MinIO. |
Is your feature request related to a problem? Please describe.
To configure Azure storage, there are some options like managed identities or service principal. I don't like managed identities becase they can be used by any pod in the cluster. If you think about service principal, SAS or blob storage token, they have sensitive data that should be managed carefully and secrets are not easily configured: #9143
Describe the solution you'd like
Azure has introduce Federated Identity Credentials. This will allow to sync a Service Account with a Azure application with required permisions without passwords.
Could be possible to implement Azure Federated Workload Identity to authenticate Loki against Azure Storage Account?
The text was updated successfully, but these errors were encountered: