Workload identity for cloud operations in Portworx
Portworx supports workload identity to securely access cloud resources used by CloudSnap backups and CloudDrive provisioning, without using static cloud credentials or assigning permissions at the node level.
Workload identity allows applications running in Kubernetes to authenticate with external cloud services by using a Kubernetes ServiceAccount (KSA) and an OIDC (OpenID Connect) token issued by the cluster. Portworx Operator configures this integration and injects short-lived tokens into Portworx pods through projected service account tokens. The cloud provider validates the OIDC token through a federated trust relationship and issues temporary credentials, which Portworx uses at runtime to call cloud APIs.
This approach eliminates the need to store long-lived credentials in Kubernetes Secrets, improves security, simplifies credential management, and supports enterprise compliance requirements for cloud-based Kubernetes environments.
The supported integrations are:
- AWS: IAM Roles for Service Accounts (IRSA) for accessing Amazon S3 and Amazon EBS.
- Azure: Azure Workload Identity for accessing Azure Blob Storage and Azure managed disks.
- GCP: Workload Identity Federation for accessing Google Cloud Storage and Compute Engine persistent disks.
note
- Portworx Enterprise supports Workload Identity Federation for GCP only on Gardener clusters.
- Portworx Enterprise does not support GKE Workload Identity. Portworx pods run with
hostNetwork: true, which bypasses the GKE metadata server.
How it works
When this feature is configured:
- The Portworx service account is annotated or bound to a cloud identity (AWS IAM role or Azure managed identity client ID).
- The Portworx Operator ensures pods are injected with a projected service account token and the environment variables or credential configuration required by the cloud SDK.
- On AWS and Azure, a cloud-provider mutating webhook running on the cluster mutates the Portworx pods to add the projected token volume, volume mount, and required environment variables. On GCP, the Portworx Operator mounts a credential configuration
ConfigMapdirectly on the Portworx pods and the Google Cloud SDK reads the projected token from the configuredcredential_sourcepath. - The cloud SDK inside Portworx exchanges the projected token for short-lived cloud credentials and uses them to call the cloud APIs.
How identity is delivered to the Portworx pods differs by cloud provider:
- AWS:
eks-pod-identity-webhook. This webhook is included by default on EKS and ROSA. On other AWS distributions running on EC2, you must deploy it manually. - Azure:
azure-workload-identitywebhook. On AKS you can enable it as a cluster feature. For self-managed clusters, you must install it manually. - GCP: No mutating webhook is required. The Portworx Operator mounts the credential configuration generated by
gcloud iam workload-identity-pools create-cred-config(stored in the ConfigMap you specify in theStorageClusterfieldspec.workloadIdentity.gcp.credentialsConfigMap) at/etc/workload-identity/, projects the service account token at/var/run/service-account/token, and exposes the credential configuration through theGOOGLE_APPLICATION_CREDENTIALSenvironment variable.
Why use workload identity
Traditional cloud credential mechanisms involve provisioning access keys or service principal secrets and rotating them securely, which is an operational and security risk. Workload identity offers the following benefits:
- Eliminates long-lived access keys and static credentials.
- Avoids granting cloud IAM permissions to the entire Kubernetes node.
- Enforces least-privilege access at the workload level.
- Automatically injects short-lived credentials, scoped to specific pods, that are rotated by the platform.
Supported platforms
- AWS
- Azure
- GCP
This feature is supported on the following AWS-based Kubernetes distributions:
- Amazon Elastic Kubernetes Service (EKS)
- Red Hat OpenShift Service on AWS (ROSA)
- Google Anthos on AWS
- Gardener on AWS
This feature is supported on the following Azure-based Kubernetes distributions:
- Azure Kubernetes Service (AKS)
- Gardener on Azure
This feature is supported on the following GCP-based Kubernetes distributions:
- Gardener on GCP
Prerequisites
- AWS
- Azure
- GCP
Before configuring workload identity on AWS, ensure that the following prerequisites are met:
- A Kubernetes cluster on the AWS platform.
- Portworx Enterprise version 3.4.0 or later.
- Portworx Operator version 25.3.1 or later.
note
On an AWS Gardener cluster, workload identity requires Portworx Enterprise version 3.6.2 or later and Portworx Operator version 26.3.0 or later.
- An OIDC provider linked to your Kubernetes cluster. For more information, see Create an OpenID Connect (OIDC) identity provider in IAM.
- The Pod Identity Webhook is deployed and running:
- Included by default in EKS and ROSA clusters.
- For other clusters running on EC2 instances, you need to manually deploy the webhook. For more information, see Amazon EKS Pod Identity Webhook.
important
After cloning the repository, edit the deployment-base.yaml file to include
--aws-default-region <aws-region>flag in thespec.template.spec.containers.commandfield before deploying the webhook.
If you plan to deploy the webhook after installing Portworx, you must manually restart the Portworx pods after deploying the webhook.
Before configuring workload identity on Azure, ensure that the following prerequisites are met:
- A Kubernetes cluster on the Azure platform.
- Portworx Enterprise version 3.6.1 or later.
- Portworx Operator version 26.2.0 or later.
- The OIDC issuer is configured on the cluster and its issuer URL is known. On AKS, see Enable OIDC issuer.
- The Azure Workload Identity mutating webhook is deployed on the cluster. On self-managed clusters, install it from the azure-workload-identity project. On AKS, enable the workload identity feature on the cluster.
- The Azure CLI (
az) is installed and authenticated against the subscription where your cluster runs.
If you deploy the webhook after installing Portworx, you must manually restart the Portworx and Stork pods so that the webhook can inject the required environment variables and volumes.
Before configuring workload identity on GCP, ensure that the following prerequisites are met:
- A Gardener shoot cluster on the GCP platform.
- Portworx Enterprise version 3.6.2 or later.
- Portworx Operator version 26.3.0 or later (workload identity for Stork is available from Operator 26.3.0 onwards).
- An OIDC issuer configured on the cluster and its issuer URL is known. SAP Gardener automatically configures a public OIDC issuer for every shoot cluster. Verify it by running
kubectl get --raw /.well-known/openid-configuration | jq -r '.issuer', which must return a non-empty HTTPS URL. - The Google Cloud CLI (
gcloud) is installed and authenticated (gcloud auth login) against the project where your cluster runs. jqis installed (used to parse OIDC discovery metadata).- Owner or equivalent IAM permissions on the GCP project, and your GCP project ID and project number.
Configure workload identity
The cluster preparation steps (creating the IAM role and trust policy on AWS; the user-assigned managed identity, custom role, role assignments, and federated credentials on Azure; or the service account, custom role, workload identity pool and provider, IAM bindings, and credential ConfigMap on GCP) and the corresponding StorageCluster configuration are documented in the per-distribution installation topics. Use the topic that matches your platform:
- AWS
- Azure
- GCP
- Installation on Amazon EKS — covers the IAM role, trust policy, and the matching
spec.workloadIdentity.credentialsblock for EKS. - Installation on Red Hat OpenShift Service on AWS (ROSA) — covers the IAM role, ROSA-specific trust policy, and the matching
spec.workloadIdentity.credentialsblock. - Installation on an AWS Gardener cluster — covers the IAM role, the trust policy that federates the shoot's OIDC issuer with the Portworx service accounts, and the matching
spec.workloadIdentity.credentialsblock.
- Installation on an Azure Kubernetes Service cluster — covers enabling the OIDC issuer and workload identity feature on AKS, the user-assigned managed identity, custom role, role assignment, federated credentials, and the matching
spec.workloadIdentity.credentialsblock. - Installation on an Azure Gardener cluster — covers the user-assigned managed identity, custom role, role assignment, federated credentials, and the matching
spec.workloadIdentity.credentialsblock.
- Installation on a GCP Gardener cluster — covers the GCP service account, custom role, node service account binding, GCS bucket permissions, workload identity pool and provider, the Kubernetes service account IAM bindings, the credential ConfigMap, and the matching
spec.workloadIdentity.gcp.credentialsConfigMapblock.
After you complete the installation steps for your platform, Portworx is configured to use workload identity. The StorageCluster includes the required workload identity configuration (spec.workloadIdentity.credentials on AWS and Azure, or spec.workloadIdentity.gcp.credentialsConfigMap on Google Cloud). After you apply the configuration, Portworx Operator restarts the pods as needed. The restarted pods include the projected service account token, volume mount, and environment variables required to authenticate with the cloud provider and access cloud APIs.
What to do next
After you configure workload identity, you can use it to authenticate CloudSnap backup and restore operations without storing static cloud credentials:
- Create credentials using workload identity — create the cloud credentials that authenticate through workload identity.
- Create and use cloud snapshots — use those credentials to back up and restore volumes.