Overview
This guide walks through a complete production deployment of CrewAI Platform on GKE using:- Cloud SQL for PostgreSQL (four databases including Wharf) via Cloud SQL Auth Proxy with IAM authentication
- Google Cloud Storage for object storage via Workload Identity
- Artifact Registry for crew container images
- Microsoft Entra ID for SSO authentication
- Wharf for OTLP trace collection (enabled by default)
- Studio V2 configured post-install
This guide assumes:
- A GKE cluster running Kubernetes 1.28+ with Workload Identity enabled
- Gateway API enabled on the cluster
gcloudCLI,kubectl, and Helm 3.10+ installed- An active Microsoft Entra ID (Azure AD) tenant
- Basic familiarity with GCP services (Cloud SQL, GCS, Artifact Registry)
Prerequisites Checklist
Complete each item before runninghelm install:
- GKE cluster with Workload Identity enabled
- Gateway API enabled (
gcloud container clusters update --gateway-api=standard) - GCP APIs enabled (see below)
- GCP Service Account created with required IAM roles
- Workload Identity binding created for platform and crews namespaces
- Cloud SQL instance created with IAM authentication enabled
- All four databases created:
crewai_plus_production,crewai_plus_cable_production,crewai_plus_oauth_production,wharf - SQL privileges granted to IAM user on all four databases
- GCS bucket created
- Artifact Registry repository created (mutable tags, ends in
/crewai-enterprise) - Entra ID App Registration complete with redirect URI configured
- Redirect URI
https://<YOUR_DOMAIN>/auth/entra_id/callbackregistered in Azure beforehelm install -
factory-adminApp Role created in Azure and assigned to admin users -
values.yamlassembled with all placeholders filled in
Part 1: GCP Infrastructure Setup
Enable Required APIs
Set Shell Variables
Create GCP Service Account
Grant IAM Roles
Bind Workload Identity
Part 2: Cloud SQL Setup
Create the Cloud SQL Instance
Enable IAM Authentication on the Instance
Create the Four Required Databases
Create the IAM Database User
Grant SQL Privileges
Connect to the instance as thepostgres superuser:
GSA_NAME@GCP_PROJECT_ID.iam with your actual IAM user, e.g., crewai-platform@my-project.iam):
Part 3: GCS and Artifact Registry
Create GCS Bucket
Create Artifact Registry Repository
CREW_IMAGE_REGISTRY_OVERRIDE value for this repository is:
${GCP_REGION}-docker.pkg.dev/${GCP_PROJECT_ID}/${AR_REPO}
For example: us-central1-docker.pkg.dev/my-project/crewai
Enable Gateway API on the Cluster
Part 4: Microsoft Entra ID App Registration
Create the App Registration
- Go to portal.azure.com and navigate to Microsoft Entra ID → App registrations → New registration
- Set the application name (suggested:
CrewAI) - Under Supported account types, select Accounts in this organizational directory only
- Under Redirect URI, select platform Web and enter:
https://<YOUR_DOMAIN>/auth/entra_id/callback - Click Register
Collect Credentials
From the app’s Overview page, copy:- Application (client) ID → this is
ENTRA_ID_CLIENT_ID - Directory (tenant) ID → this is
ENTRA_ID_TENANT_ID
Create a Client Secret
- In the left sidebar under Manage, click Certificates & secrets
- Click New client secret, set a description and expiration, then click Add
- Copy the secret Value immediately — you cannot view it again after leaving the page
- This is
ENTRA_ID_CLIENT_SECRET
Grant Admin Consent
- Navigate to Enterprise applications → All applications and select your app
- In the left sidebar under Security, click Permissions
- Click Grant admin consent for <your organization>
- Confirm that Microsoft Graph User.Read is granted
Configure App Roles
In the left sidebar under Manage, click App roles, then Create app role. Create both of the following roles:
Ensure “Do you want to enable this app role?” is checked for each role before saving.
Assign Users
- Go to Enterprise applications → <your app> → Users and groups
- Click Add user/group
- Assign regular users the Member role
- Assign admin users the Factory Admin role
With Entra ID, admin access is granted via the
factory-admin App Role in Azure. Do not run the factory:grant_admin Rails task — that command is for WorkOS/Okta/local auth only. For Entra ID, assign the factory-admin App Role to the user in the Azure portal instead.Part 5: Complete values.yaml
The following is a complete, production-readyvalues.yaml. Fill in all <PLACEHOLDER> values before deploying.
Generate your SECRET_KEY_BASE:
values.yaml
The
image.registries block is required for direct Helm installs. It provides credentials for pulling platform images (busybox, redis, buildkit, wharf, etc.) from the Replicated proxy at images.crewai.com. Use the same email and token used for helm registry login registry.crewai.com.When installing via Replicated KOTS, these credentials are injected automatically — image.registries is not needed.Part 6: Install
Create GCP-Managed TLS Certificate (if using certmap)
Log In to the Helm Registry
Run Helm Install
Annotate the Crews Namespace (Post-Install, Required)
After the first install creates thecrewai-crews namespace, annotate the default ServiceAccount so build pods can push images to Artifact Registry via Workload Identity:
Part 7: Post-Install (Required for All Deployments)
Wait for all pods to reachRunning status, then run the following commands:
For Entra ID deployments, do not run
factory:grant_admin. Admin access is controlled entirely by the factory-admin App Role assigned in the Azure portal. Running factory:grant_admin is only needed for WorkOS, Okta, and local auth deployments.Part 8: Studio V2 Setup (Post-Install)
Studio V2 has no Helm values and cannot be configured invalues.yaml. Adding studioV2.enabled, STUDIO_V2_ENABLED, or any similar key to your values has no effect — Helm silently ignores unrecognized keys.
Setup is always performed post-install in this order:
Step 1: Create the LLM Connection (UI)
- Log in to the platform at
https://<YOUR_DOMAIN> - Navigate to Settings → LLM Connections
- Click New Connection
- Set the name to exactly
studio-v2(lowercase, no spaces — this exact string is required) - Select your LLM provider, enter the model name and API key
- Click Save
Step 2: Set as Default Connection (UI)
- Navigate to Settings → Crew Studio
- Under Default Connection, select
studio-v2 - Click Save
Step 3: Run Install Commands (kubectl)
Run these commands in order. Each must complete successfully before running the next.Part 9: Verify
Platform Health
Gateway and DNS
Entra ID Authentication
- Open
https://<YOUR_DOMAIN>in a browser - Click Sign in — you should be redirected to the Microsoft login page
- Log in with an Entra ID account that has been assigned either the Member or Factory Admin App Role
- After login, verify you are redirected back to the platform and successfully authenticated
Wharf Trace Collection
Studio V2
studio-assistant and studio-runner deployments should show Running.
Troubleshooting
Entra ID: Silent Auth Failure (No Error, Login Loops)
Cause:ENTRA_ID_CLIENT_ID or ENTRA_ID_TENANT_ID were placed under secrets: instead of envVars:.
The chart template does not inject Entra ID values from the secrets: section into pod environment variables. The pod starts normally but cannot authenticate because the identifiers are absent from the environment.
Fix: Move ENTRA_ID_CLIENT_ID and ENTRA_ID_TENANT_ID to envVars:. Only ENTRA_ID_CLIENT_SECRET belongs under secrets:.
Entra ID: “Redirect URI mismatch” Error
Cause: The redirect URI registered in Azure does not exactly matchhttps://<YOUR_DOMAIN>/auth/entra_id/callback.
Fix: In the Azure portal, go to App registrations → <your app> → Authentication and verify the redirect URI matches exactly, including the https:// prefix, exact domain, and the path /auth/entra_id/callback.
Cloud SQL: Auth Proxy Authentication Failure
Symptoms: Pods showissue connecting with your username/password or fe_sendauth: no password supplied.
- Verify
autoIamAuthn: trueis set incloudSqlProxy: - Verify
cloudsql.iam_authentication=onis set on the Cloud SQL instance: - Verify the IAM database user exists:
- Verify
DB_USERuses the truncated format (without.gserviceaccount.com)
GCS: SignedUrlUnavailable Error
Symptoms: Logs showGoogle::Cloud::Storage::SignedUrlUnavailable.
Fix: Ensure GCS_IAM_SIGNING: "true" is set in envVars: and the GSA has roles/iam.serviceAccountTokenCreator. This setting is required whenever Workload Identity is used.
Cloud SQL: Missing OAuth Database
Symptoms: OAuth service fails to start; logs show database does not exist. Fix: VerifyPOSTGRES_OAUTH_DB: "crewai_plus_oauth_production" is set in envVars:. The chart default is oauth_db. If you created the database as crewai_plus_oauth_production but did not override this value, the service connects to the wrong database name.
Studio V2: studio:agent:install Fails
Cause: The studio-v2 LLM Connection does not exist in the database yet.
Fix: Complete the UI steps (Settings → LLM Connections → New Connection named exactly studio-v2, then Settings → Crew Studio → set as Default Connection) before running any Rails tasks.
Artifact Registry: Build Pod Push Failures
Symptoms: Crew image builds fail withunauthorized or denied during push.
Fix: Verify the Workload Identity annotation on the crews namespace ServiceAccount:
