This tutorial demonstrates how to deploy CKS Workload Federation for AI Object Storage automatically by configuring the Pod Identity Webhook.Documentation Index
Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- A CKS cluster with OIDC Workload Identity enabled on the cluster. The AI Object Storage federation configuration is covered in the steps below.
- Helm version 3.8 or higher.
kubectlinstalled and configured for your cluster.- Appropriate IAM roles (for example, CKS Admin and Object Storage Admin) assigned through an IAM Access Policy.
Install the Pod Identity Webhook
If you install the Pod Identity Webhook, you can use AI Object Storage with very little configuration. You can install the Pod Identity Webhook from CoreWeave Charts with the following steps:-
Set environment variables for your organization ID and region:
- Replace
[YOUR-ORG-ID]with your organization’s ID. You can find your organization ID on the CoreWeave Console settings page. - Replace
[YOUR-REGION]with your CoreWeave availability zone. Make sure to use an eligible CoreWeave availability zone that supports AI Object Storage.
Availability Zones that support AI Object Storage
Learn more about Regions and Availability Zones.- US-CENTRAL
- US-EAST
- US-WEST
- CA-EAST
- EU-SOUTH
US-CENTRAL-05AUS-CENTRAL-06AUS-CENTRAL-07AUS-CENTRAL-08AUS-CENTRAL-08B
- Replace
-
Add the CoreWeave Charts repository and install the Pod Identity Webhook:
Successful output should look like this:
Configure OIDC Workload Federation
Before the Pod Identity Webhook can obtain credentials, you must register your CKS cluster as an OIDC provider for AI Object Storage. Your cluster must have OIDC Workload Identity enabled so it can issue signed tokens.-
In the Cloud Console, retrieve the OIDC Issuer URL for your CKS cluster:
- Go to the Clusters page.
- Click the name of your cluster. A cluster details panel opens on the right.
- Copy the OIDC Issuer URL from the Overview section. You will need this URL again when configuring access policies.
-
Create a new OIDC Configuration in the Workload Federation page:
- Click Create OIDC configuration. The configuration form opens.
- Set the configuration name (choose a name that indicates it is for federating CKS tokens with AI Object Storage).
- Enter the CKS cluster’s OIDC Issuer URL into both the Issuer URL and Client ID (Audience) fields.
- Click Create to save the configuration.
Use your service account
The Pod Identity Webhook injects the configuration your pods need to obtain AI Object Storage credentials. Add one of these annotations to the Service Account that your workload uses:| Audience Type | Annotation Syntax |
|---|---|
| Default audience | caios.coreweave.com/inject: "true" |
| Custom audience | caios.coreweave.com/audience: custom(use when you need to match a specific WIF audience) |
-
Create the following manifest and save it to a file named
object-storage-sa.yaml. This example uses the default audience annotation. Adjust it if you want to use a custom audience:object-storage-sa.yaml -
Apply the manifest to create the service account:
-
Verify the service account has been created and has the appropriate annotation:
Grant the service account access to Object Storage
You must grant the service account’s federated identity access to AI Object Storage through an organization access policy. Use the OIDC Issuer URL you copied earlier and the service account name to construct the WIF principal:[OIDC-ISSUER-URL] with the OIDC Issuer URL from your cluster’s details panel.
The following example policy grants the service account full S3 access to all buckets in your organization:
Create a workload that uses the service account
This example creates a Pod that uses the service account you just created.-
Configure the Pod’s S3 endpoints:
To work with AI Object Storage, you need to configure your Pod’s S3 endpoints to use virtual addressing style and set the appropriate endpoint URL.
Configure S3 Endpoints for Pods
Because the environment variables handle credential exchange, your application only needs to configure the S3 endpoint and addressing style. For example, with the AWS CLI:Alternatively, this file can be mounted into the container from a ConfigMap, with theAWS_CONFIG_FILEvariable set to the location of the mounted file.Use the LOTA endpoint (cwlota.com) when your workloads run inside a CKS cluster for optimal performance. For more configuration options (Boto3, s3cmd, Multi-Storage Client), see Attaching endpoints. -
Create the following manifest and save it to a file named
object-storage-pod.yaml, making the following adjustments:- Fill in the container image with the image you want to use for your workload.
- Reference the same service account in your Pod so the Pod Identity Webhook can inject credentials:
object-storage-pod.yaml -
Apply the manifest to create the workload:
Verify the webhook injection (optional)
To confirm the Pod Identity Webhook is injecting credentials correctly before deploying your real workload, you can create a test pod using theamazon/aws-cli image and run an S3 command against AI Object Storage.
-
Create a test pod that uses the service account and lists your buckets:
test-webhook-pod.yaml
-
Apply the manifest:
-
Check the pod logs for the response:
If the webhook injection and your organization access policies are configured correctly, you should see a JSON response listing your buckets. If you see an
AccessDeniederror, verify that your organization access policies grant thes3:ListAllMyBucketsaction to the correct WIF principal. -
Clean up the test pod:
Next steps
- To configure OIDC Workload Federation manually or for debugging, see Manual OIDC token exchange.
- Learn more about OIDC Workload Identity for CKS.
- Learn more about Workload Identity Federation for AI Object Storage.
- Learn more about the CoreWeave Pod Identity Webhook for AI Object Storage