Skip to content

Simplify Workload Identity configuration #117

Description

@IvanJosipovic

What problem are you facing?

The current Workload Identity configuration requires a few unnecessary configurations.

Specifying the federatedTokenFile value in the azure-workload-identity-creds.yaml is unnecessary as this value can be retrieved using the AZURE_FEDERATED_TOKEN_FILE env var which is automatically injected into Pods when we enable Workload Identity.

Example Pod:

apiVersion: v1
kind: Pod
metadata:
  labels:
    azure.workload.identity/use: "true"
spec:
  containers:
  - env:
    - name: AZURE_FEDERATED_TOKEN_FILE
      value: /var/run/secrets/azure/tokens/azure-identity-token

Specifying the volume details in the DeploymentRuntimeConfig is also unnecessary as this automatically injected into Pods when we enable Workload Identity. The following config should be sufficient.

apiVersion: pkg.crossplane.io/v1beta1
kind: DeploymentRuntimeConfig
metadata:
  name: function-msgraph
spec:
  deploymentTemplate:
    spec:
      replicas: 1
      selector: {}
      template:
        metadata:
          labels:
            azure.workload.identity/use: "true"
        spec:
          serviceAccountName: function-msgraph
          containers:
            - name: package-runtime
  serviceAccountTemplate:
    metadata:
      annotations:
        azure.workload.identity/client-id: "your-client-id"
      name: function-msgraph

How could this Function help solve your problem?

The function should resolve this value from the env var instead of expecting users to provide it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions