Skip to content

Commit

Permalink
Allow using azure workload identity for operator auth
Browse files Browse the repository at this point in the history
  • Loading branch information
swoehrl-mw committed Mar 8, 2024
1 parent 69d0541 commit 8cc0a07
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,25 @@ For the operator to interact with Azure it needs credentials. For local testing
* `Microsoft.Storage/*`
* `Microsoft.Authorization/locks/*`, optional, if you want the operator to set delete locks

### Using Azure Managed Identity

Instead of using a service principal the operator can also be used with a managed identity using [Workload Identity](https://learn.microsoft.com/en-us/azure/aks/workload-identity-deploy-cluster). To do so:

* Make sure your AKS cluster is configured with the workload identity feature.
* Create the managed identity and assign it the needed permissions (e.g. Contributor role).
* Establish the federated identity (as described in the linked guide), as subject use `system:serviceaccount:default:hybrid-cloud-object-storage-operator` (assuming you install the operator into the `default` namespace and do not change the name of the serviceaccount).
* Configure the operator to use the workload identity. Add the following to the values:

```yaml
podLabels:
azure.workload.identity/use: "true"
serviceAccount:
annotations:
azure.workload.identity/client-id: <client-id-of-managed-identity>
```

* You do not need to provide a secret with credentials as described for the service principal.

### Deployment

The operator can be deployed via helm chart:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ spec:
{{- end }}
labels:
{{- include "operator.selectorLabels" . | nindent 8 }}
{{- if .Values.podLabels }}
{{- toYaml .Values.podLabels | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
4 changes: 4 additions & 0 deletions helm/hybrid-cloud-object-storage-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ volumes: []
# List of volume mounts for the operator pod
volumeMounts: []

# Extra annotations to add to the operator pods
podAnnotations: {}

# Extra labels to add to the operator pods
podLabels: {}

podSecurityContext: {}

securityContext: {}
Expand Down

0 comments on commit 8cc0a07

Please sign in to comment.