/glean-connector-builder:connector-deploymentfrom glean-connector-builder
Plans and operates customer-hosted deployment for Glean Indexing SDK connectors using glean-idx deploy. Covers deployment artifacts, cloud secrets, Kubernetes CronJobs, logs, status, and teardown for GCP or AWS.
Ships in glean-connector-builder. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill when deployment or hosting is in scope for a connector build. It covers the SDK's glean-idx deploy CLI for customer self-deployment to GCP or AWS.
<connector-folder>/.glean/connector_plan.mdgcp or awsglean-idx deploy for connector-specific deployment artifacts and operations. It delegates to Docker Buildx, Terraform, provider SDKs, and kubectl; keep those standard tools and their authentication visible rather than inventing files or alternate clients by hand.secrets upload, apply, destroy) without explicit user confirmation..env or raw secrets. Use .env.example as the template and upload real secrets through glean-idx deploy secrets upload.create_connector() factory for production wiring. Cloud runners load secrets into environment variables before calling it; never put source credentials in glean_deployment.yaml or factory metadata..glean planning artifacts inside the connector folder, and deployment artifacts in the connector folder root.Before using glean-idx deploy, confirm the user has:
glean-idx deploy console command is registered by the SDK package.docker info and docker buildx version.kubectl.gcloud auth login --update-adc, Artifact Registry Docker authentication, and explicit cluster credentials.gcloud config get auth/impersonate_service_account
# If set, clear it: gcloud config unset auth/impersonate_service_account
glean_deployment.yaml in the connector project directory..env in the connector project directory, created from .env.example.Deployment commands are subcommands of glean-idx, the SDK's single CLI:
glean-idx deploy --help
These commands read glean_deployment.yaml from the connector project, so run
them from inside that project. From a local SDK checkout, prefix with uv run:
uv run glean-idx deploy --help
glean-idx doctor checks credentials before any of this, and needs no project:
uvx --from glean-indexing-sdk glean-idx doctor
Use this sequence for a normal customer-hosted deployment:
# 1. Scaffold deployment files
glean-idx deploy init --cloud gcp --connector-factory create_connector # or --cloud aws
# Edit glean_deployment.yaml: image registry, schedule, cluster, resources, etc.
# Edit .env: GLEAN_INDEXING_API_TOKEN, GLEAN_SERVER_URL, source credentials, etc.
# 2. Register the API-facing datasource configuration.
glean-idx datasource configure
# 3. Build and push the configured image/tag (linux/amd64 by default).
glean-idx deploy build --push
# 4. Upload exact secrets from .env to cloud secret manager.
glean-idx deploy secrets upload
# 5. Display an exact Terraform plan, confirm it, and apply that same plan.
glean-idx deploy apply
# 6. Start one Job immediately instead of waiting for the schedule.
glean-idx deploy run
After deployment:
glean-idx deploy status
glean-idx deploy logs -f
glean-idx document status --datasource NAME --document TYPE ID --poll
glean-idx deploy build uses docker buildx and defaults to --platform linux/amd64. This is correct for all standard GKE and EKS node pools (amd64). Do not override unless the cluster is explicitly running arm64 nodes.
If you see exec format error in pod logs, confirm the image platform:
docker inspect <image> | grep Architecture
# Should be: "amd64"
For private-only clusters, the machine running Terraform needs network access to either the private IP or a GKE DNS control-plane endpoint. The generated provider uses the cluster CA for the discovered IP endpoint and system trust for an explicit DNS endpoint.
Get the GKE DNS endpoint and add it to glean_deployment.yaml:
gcloud container clusters describe <cluster-name> \
--region <region> \
--format="value(privateClusterConfig.privateEndpoint,controlPlaneEndpointsConfig.dnsEndpointConfig.endpoint)"
Then set in glean_deployment.yaml:
cluster_endpoint: "abc123def.gke.goog" # the *.gke.goog DNS hostname
glean-idx deploy apply and glean-idx deploy destroy both pick this up automatically.
Use the glean-idx deploy CLI:
| Command | What it does |
|---|---|
| `glean-idx deploy init --cloud gcp | aws` |
glean-idx deploy build | Build the connector container image locally. |
glean-idx deploy build --push | Build and push the connector image to the configured registry. |
glean-idx deploy build --tag v1.2 | Compatibility check only: the value must match image_tag in the YAML so build and apply cannot diverge. |
glean-idx deploy secrets upload | Upload connector secrets from .env to GCP Secret Manager or AWS Secrets Manager. |
glean-idx deploy secrets list | List connector secrets currently stored in the cloud. |
glean-idx deploy secrets delete KEY | Delete a specific connector secret after confirmation. |
glean-idx deploy apply | Run Terraform init, display an exact saved plan, prompt, and apply that same plan. |
glean-idx deploy run | Create one immediate Job from the configured CronJob and namespace. |
glean-idx deploy status | Show CronJob status and recent job history. |
glean-idx deploy logs | Show logs from the most recent run. |
glean-idx deploy logs -f | Tail logs in follow mode. |
glean-idx deploy destroy | Tear down Terraform resources and manifest-owned secrets, then report retained image, namespace, datasource registration, and local files. Two-step confirmation: y/n prompt then type the connector name. |
glean-idx deploy destroy --yes | Tear down without prompts (CI only). |
For glean-idx deploy init, only --cloud is required. If omitted, --connector-name defaults to the current directory name, --connector-class defaults to MyConnector, and --connector-module defaults to connector. Pass those options when the generated connector uses different names. When the class takes a name, data client, or other dependencies, pass --connector-factory create_connector; the named module-level function must take no arguments and return an instance of connector_class.
Use the Python deployment APIs only when writing tests or advanced tooling:
DeploymentConfiggenerate_artifactsglean-idx deploy init generates:
Dockerfilerun.pyterraform/main.tfterraform/variables.tfglean_deployment.yaml.env.exampleFor GCP, generated artifacts target GKE, Artifact Registry, Secret Manager, and Workload Identity.
For AWS, generated artifacts target EKS, ECR, Secrets Manager, and IRSA.
Ensure glean_deployment.yaml has the correct fields before running build/apply:
connector_nameconnector_classconnector_moduleconnector_factory (optional zero-argument production construction hook)cloud (fixed by provider-specific artifacts at deploy init; rerun init to change providers)regioncluster_namenamespace (must already exist and remains customer-managed)image_tagcpumemorycron_scheduleindexing_modeFor GCP, also confirm:
project_idartifact_registry_reposervice_account_namecluster_endpoint — required for private-only GKE clusters (see Known Issues)For AWS, also confirm:
account_idecr_repoiam_role_nameUse .env.example to create .env, then run glean-idx deploy secrets upload.
The secret name prefix is:
CUSTOM_DATASOURCE_PLATFORM_<CONNECTOR_NAME>_
The deployment code redlists deployment-control variables so they are not uploaded as connector secrets:
GOOGLE_CLOUD_PROJECTAWS_REGIONDATASOURCE_NAMECLOUD_PLATFORMINDEXING_MODECONNECTOR_CLASSCONNECTOR_MODULECONNECTOR_FACTORYConnector secrets should include values such as:
GLEAN_SERVER_URLGLEAN_INDEXING_API_TOKENTo rotate a secret:
glean-idx deploy secrets delete OLD_KEY
glean-idx deploy secrets upload
To inspect currently uploaded connector secrets:
glean-idx deploy secrets list
Before implementation or deployment, ensure <connector-folder>/.glean/connector_plan.md records:
After generating and configuring the deployment artifacts, immediately before running any build, push, secret-upload, or apply command:
<connector-folder>/.glean/connector_plan.md and <connector-folder>/.glean/source_investigation.md.After connector code and plan are ready:
glean-idx deploy init --cloud gcp|aws (optionally add --connector-name <name> --connector-class <ClassName> --connector-module <module> when defaults do not match)glean_deployment.yaml..env.example to .env and fill secrets locally.glean-idx deploy build --pushglean-idx deploy secrets uploadglean-idx deploy applyglean-idx deploy statusglean-idx deploy logsUse glean-idx deploy destroy only when the user explicitly wants teardown.
destroy requires two confirmations interactively: a y/n prompt then typing the connector name. This prevents accidental teardown of production deployments. For CI pipelines use --yes to skip both.
glean-idx deploy destroy
# Prompt 1: "This will permanently destroy 'my_connector'... Continue? [y/N]"
# Prompt 2: "Type the connector name 'my_connector' to confirm:"
For planning-only evals, do not run cloud commands. The deployment plan should be enough.
For implementation evals with cloud access, verify:
glean-idx deploy init creates all expected artifacts.glean_deployment.yaml validates for the selected cloud..env excludes deployment-control variables from uploaded connector secrets.secrets upload is run only after user confirmation.apply, status, logs, and destroy are run only in an approved test environment.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
glean, connector-deployment, kubernetes, terraform, docker-buildx
8 skills in this plugin
/connector-api-explorationExplore third-party datasource API docs and read-only endpoints for a Glean Indexing SDK connector. Use before connector planning or generation to produce a cited API inventory and source investigation./connector-authPlan source API authentication for Glean Indexing SDK connectors. Use during connector planning and implementation to separate API-exploration credentials from production connector auth./connector-builderBuild Glean Indexing SDK connectors from source-system documentation. Use when planning, generating, validating, or evaluating a custom connector built with the Glean Indexing SDK.npx claudepluginhub gleanwork/glean-indexing-sdk --plugin glean-connector-builderOther plugins' skills for the same job