Skip to content

Quick start (GKE)

The installer (install.sh) bootstraps everything you need for a running Platform Agent on GKE: cluster, CRDs, IAM, secrets, Chat integration, inference gateway, and, for a GitOps repository on GitHub, the token minter. It drives the Terraform composition terraform/examples/full-install, which owns every GCP resource and installs the kube-agents Helm chart, which owns every Kubernetes resource.

Prefer declarative IaC over the interview? Apply the same composition by hand with your own terraform.tfvars — see the composition README for the hand-driven path. Both paths run the same Terraform, so they create the same resources. If your team reconciles Kubernetes workloads through Flux or Argo CD with separate Google Cloud IAM Terraform and an existing cert-manager, follow Enterprise Helm & GitOps instead of running install.sh.

Run the release-pinned installer (substituting <RELEASE_VERSION> with the desired release tag from GitHub Releases, for example 0.19.0; a GitLab install needs 0.9.0 or later, a Bitbucket install 0.29.0 or later):

Terminal window
curl -fsSL https://raw.githubusercontent.com/gke-labs/kube-agents/<RELEASE_VERSION>/install.sh | bash

The interactive installer is strongly recommended for initial installation: it detects context from your gcloud session and guides you through project selection, cluster options, and model provider credentials with minimal typing.

When running the release-pinned installer, the baked release version is used automatically.

For headless environments, AI Agents, or CI/CD automated deployments where an interactive TTY is unavailable, use --non-interactive with parameter flags:

Terminal window
curl -fsSL https://raw.githubusercontent.com/gke-labs/kube-agents/<RELEASE_VERSION>/install.sh | bash -s -- \
--non-interactive \
--gcp-project-id="my-gcp-project" \
--gke-cluster-name="platform-agent-host" \
--gcp-region="us-central1" \
--model-provider="gemini" \
--permission-set="read-only"

Give an AI coding assistant this prompt. It needs no checkout of the repository:

Install the latest official release of kube-agents (github.com/gke-labs/kube-agents) into my GCP project.
Follow INSTALL.md from that release tag — do not invent installer URLs, namespaces, or model names.
First inspect my gcloud project and existing GKE clusters and confirm the target, cluster, model provider,
and credential with me. Run install.sh with --dry-run and show me its printed summary before you change anything.
Only run the real install after I say yes.
  1. Obtain the release sources.

    Download and extract the self-contained release archive from GitHub Releases (recommended):

    Terminal window
    curl -fsSL https://github.com/gke-labs/kube-agents/releases/download/<RELEASE_VERSION>/kube-agents-<RELEASE_VERSION>.tar.gz | tar -xz
    cd kube-agents-<RELEASE_VERSION>

    Alternatively, if you require a Git checkout, clone pinned to an official release tag (for example, 0.19.0; a GitLab install needs 0.9.0 or later):

    Terminal window
    git clone --branch <RELEASE_VERSION> https://github.com/gke-labs/kube-agents.git
    cd kube-agents
  2. Run the installer. If you enable Slack, create the Slack app and its tokens first (Slack app setup): the installer asks for both tokens. Microsoft Teams is set up after the install (Microsoft Teams app setup).

    Terminal window
    ./install.sh

    The run is interactive and prompts for your project ID, region, cluster choice and shape, chat integrations, model settings, GitOps repo, permission set, gVisor, web UI, memory, and Stockout Investigator. When run from an official release checkout or bundle, install.sh automatically uses that release version and verifies that local files match the container images.

    Answers are saved to install.env (git-ignored, chmod 600), the install’s configuration; terraform/examples/full-install/terraform.tfvars is regenerated from it on every run, so the two stay in step. A re-run loads install.env first, so a flag you omit keeps the value it records instead of reverting to a default — with one exception: the installer never writes --github-pem-path there. After the first import the private key lives in Cloud KMS, so a re-run needs neither the flag nor the file, and you are meant to delete the .pem. The installer then runs the composition’s lifecycle.sh apply, and a re-run reconciles every change through one terraform apply — safe to Ctrl-C and run again.

  3. Configure Google Chat (only if you enabled the Google Chat integration). In the Chat API console, point the bot’s Pub/Sub connection at the created topic (projects/<CHAT_PROJECT_ID>/topics/<CHAT_TOPIC_NAME>, where <CHAT_PROJECT_ID> is <PROJECT_ID> unless you set --chat-project-id). The installer prints the exact topic name and step-by-step instructions when it finishes.

  4. Verify.

    Terminal window
    kubectl get platformagents -n kubeagents-system
    kubectl get pods -n kubeagents-system

    You should see one PlatformAgent resource plus pods for the operator (kube-agents-controller-manager), LiteLLM (litellm), and three for the Platform Agent itself: the gateway (platform-agent-gateway), the shell sandbox (platform-agent-shell), and the credential broker (platform-agent-credential-proxy). The GitHub token minter (github-token-minter) also appears if you enabled the GitHub integration. When all three agent pods are Running and Google Chat is configured, DM your Chat app and it should reply. With no chat platform configured, reach the agent through the A2A console every install serves, through the web console if you installed with --enable-web-console, or with the terminal command the installer prints; User interfaces has the port-forward for each.

    The gateway logs errors while it starts up, and they do not mean the install failed. Repeated Connection refused from the Google Chat relay, and a one-off slack connect timed out after 30s, are ordering: both relays dial the credential broker before it is listening. They retry until it is, and on a fresh install the messages stopped on their own within about seven minutes. Treat them as a fault only if they are still arriving well after that, and inspect the envoy-credential-proxy container in the platform-agent-credential-proxy pod rather than the relay reporting the error.

    If you enabled Slack, the A2A gateway holds its connection; step 5 of Verify the A2A stack checks it, and Slack app setup has the full check, including a test DM.

    Every install runs the A2A stack, which adds pods and conditions, and with Slack enabled its Slack connects from a different pod: check it with Verify the A2A stack as well.

  5. Talk to the agent.

    With Google Chat or Slack enabled, DM the app. Both are opt-in and off by default, so an install that enabled neither talks to the agent through the A2A console, which every install that enforces NetworkPolicy serves (User interfaces) or over kubectl exec. The installer prints these two commands when you choose “None” at its chat prompt and again when it finishes, with your cluster, region, project and namespace already filled in:

    Terminal window
    gcloud container clusters get-credentials <CLUSTER_NAME> --location <REGION> --project <PROJECT_ID> --dns-endpoint
    kubectl exec -it deployment/platform-agent-gateway -n kubeagents-system -c platform-agent -- hermes -p platform

    Drop --dns-endpoint on a cluster that publishes no externally reachable DNS endpoint, where gcloud rejects it. -p platform reaches the Platform Agent directly; a bare hermes reaches the Planning Agent front door, which is where a chat message would have landed. ChatOps covers the difference and what a chat-less install does not exercise.

Every install runs the A2A stack in front of the agent: the NATS bus, its auth callout, the capability verifier, the A2A console, the MCP server, the profile dispatcher, and the A2A gateway, which takes the chat backend. An install that mirrors its third-party images with --third-party-registry-prefix pulls the bus’s four images from that mirror too; the chart points the operator at them, as it does for fluent-bit. These checks come after step 4’s, against the same namespace and the PlatformAgent named platform-agent.

  1. Wait for Ready. Ready also waits for the NATS StatefulSet, the auth callout, the first completion of the bus provisioning Job and the A2A gateway, which every install runs (on the console door alone when no chat backend is configured). A first boot can take over fifteen minutes.

    Terminal window
    kubectl wait platformagent/platform-agent -n kubeagents-system --for=condition=Ready --timeout=25m

    While it waits, the phase reads Provisioning. Once the agent’s own pod is ready, the Ready condition’s message names the A2A workload it is waiting on; before that it reads Waiting for deployment replicas to be ready. That is a slow start. phase: Degraded with reason A2AProvisionFailed is a broken one: the provisioning Job failed, and its pod log says why.

  2. Read the A2A conditions.

    Terminal window
    kubectl get platformagent platform-agent -n kubeagents-system \
    -o jsonpath='{range .status.conditions[*]}{.type}{"\t"}{.status}{"\t"}{.reason}{"\n"}{end}'

    A healthy install shows the rows below, and the Ready message reads Gateway, shell sandbox, credential broker, NATS, auth callout, bus provisioning and A2A gateway are all ready:

    Type Status Reason
    Ready True Reconciled
    BusProvisioned True ProvisionJobComplete
    BusCredentialsReady True CalloutServing
    NoChatPlatform True NoChatPlatform

    NoChatPlatform is there because this install enabled no chat platform: it says where the agent’s findings go instead, and goes away once you enable Google Chat or Slack. A2AGateway and A2AVerifier appear only when something needs a look. With no chat backend enabled the A2A gateway runs on the console door alone. A2AGateway False with WaitingForReplica appears only after an upgrade from an operator that ran no A2A gateway without a chat backend: the gateway is back at one replica, and that replica is not ready yet. A2AVerifier False with VerifierNotReady means no verifier replica is ready, and every task submitted meanwhile is refused.

    BusCredentialsReady False with CalloutAbsent means no auth callout is deployed and nothing can authenticate to the bus. With CalloutUnavailable, fewer than all callout replicas are ready on the current spec, which every rollout of the callout passes through; the message gives the counts, and only with none ready does the bus refuse every new connection. The status reference has every condition.

  3. List the A2A pods. Every pod the A2A stack runs carries the label app.kubernetes.io/part-of=a2a-next, so this lists them apart from step 4’s pods:

    Terminal window
    kubectl get pods -n kubeagents-system -l app.kubernetes.io/part-of=a2a-next
    Pod How many Expected state
    platform-agent-a2a-nats-0, -1, -2 3; 1 with busReplicas: 1 Running
    platform-agent-a2a-callout-… 2 Running
    platform-agent-a2a-verifier-… 2 Running
    platform-agent-a2a-console-… 1; 0 on an install without NetworkPolicy enforcement Running
    platform-agent-a2a-mcp-… 1; 0 with operator.mcpServer.enabled: false Running
    platform-agent-a2a-dispatcher-… 1; 0 with operator.profileDispatcher.enabled: false Running
    platform-agent-a2a-gateway-… 1 Running
    platform-agent-a2a-provision-<hash>-… 1 per run, more if it retries Completed; a failed attempt stays Error; all removed 24 hours after the Job finishes
    <profile>-<animal>-<hex> 1 per session For a /session conversation, Running until 30 minutes after its last message (5 for a DM conversation with one message so far), and for 4 hours at most; for a delegate message, Running while its one task runs

    The A2A gateway creates a session pod only for a conversation switched to /session or a message that starts with delegate; other tasks run in the agent pod. It runs up to spec.harness.tuning.maxSessions (10 by default) at once, and a fresh install has none. The console pod serves the A2A console, a browser page over the bus with a chat pane, reached with kubectl -n kubeagents-system port-forward svc/platform-agent-a2a-console 8080:8080.

  4. Check the agent’s bridge. The agent pod carries a hermes-bridge container from its first start. Until the bus is provisioned, it waits for it and logs that it’s waiting. The bridge takes tasks off the bus and runs them on the agent’s API server.

    Terminal window
    kubectl get deployment platform-agent-gateway -n kubeagents-system -o jsonpath='{.spec.template.spec.containers[*].name}{"\n"}'
    kubectl logs deployment/platform-agent-gateway -n kubeagents-system -c hermes-bridge | grep 'hermes bridge consuming'

    The first command lists hermes-bridge among the containers. The second prints one JSON line with "msg":"hermes bridge consuming", "profile":"platform" and "executor":"api". api is the only executor. A PlatformAgent that declares its own hermes-bridge sidecar in spec.deployment.sidecars keeps it, and the operator adds none. That sidecar needs the agent’s API_SERVER_KEY in its environment, or it exits at start.

  5. Check Slack, if you enabled it. The A2A gateway holds Slack’s Socket Mode connection, with or without Google Chat. First confirm which backend the gateway took:

    Terminal window
    kubectl logs deployment/platform-agent-a2a-gateway -n kubeagents-system -c gateway | grep '"msg":"a2a gateway starting"'

    "backends":["slack"] means the gateway holds Slack, and "backends":["gchat","slack"] means it holds Google Chat and Slack together. Either way, check the connection with the gateway steps in Slack app setup. "backends":["gchat"] with Slack enabled means an operator from before Slack joined Google Chat on the gateway: Slack is then on the Hermes Slack platform, and step 4’s check applies.

    After two consecutive five-minute usage polls reading kubeagents_a2a_gateway_slack_connected as 0, the PlatformAgent reports SlackConnected=False (ConnectionFailed) and Degraded=True (SlackConnectionFailed) without changing Ready or phase. The gateway pod stays Running and retries with a backoff, while its log carries the specific auth.test or Socket Mode error (for example chat backend stopped; restarting it, the console stays up).

On a first boot the operator creates the A2A gateway only once an auth callout replica is serving. For the first several minutes there is therefore no gateway pod, and the agent pod’s hermes-bridge container logs that it’s waiting for the bus; the Ready message names what is still missing. The A2A gateway reads the Slack tokens from the install’s Secret and dials Slack itself, so the one-off slack connect timed out after 30s from step 4 is not expected. If it does appear, the Hermes Slack platform is running, which means an operator from before Slack moved to the gateway.

The installer collected your answers, wrote install.env and terraform.tfvars, and ran one terraform apply through the composition’s lifecycle.sh. That apply set up the GCP APIs, the GKE cluster (CMEK, Workload Identity, the host-discovery label), IAM and Workload Identity bindings, and cert-manager. It also set up the drift detector’s Log Router sink, Pub/Sub topic and pull subscription, and the Helm chart carrying the operator, the PlatformAgent CR, the credentials Secret, and the LiteLLM gateway. Terraform state lives in a versioned GCS bucket (<project>-kube-agents-tfstate, prefix kube-agents/<cluster>), so uninstall.sh and upgrade.sh can find the install from a fresh clone.

When adopting an existing cluster, four settings stay gcloud pre-steps because a Terraform data source cannot express them: CMEK database encryption, Workload Identity pool enablement, node-pool migration to GKE_METADATA (requires --migrate-node-pools), and legacy Calico NetworkPolicy enforcement (requires --enable-network-policy). For the last, --accept-no-network-policy installs without it instead and changes nothing on the cluster. On freshly created clusters, setting the managed OpenTelemetry collection scope stays a gcloud post-step (no provider field exists). The one-shot GitHub App key import into KMS also runs outside Terraform, so the PEM never enters state.

Changing your mind later is the same engine: running the installer with --menu (e.g. ./install.sh --menu or $HOME/kube-agents/install.sh --menu) opens a Day-2 control panel whose Save & Apply regenerates terraform.tfvars and re-applies.

Once Ready holds, check the install by talking to it. First prompts gives the one message to send first, what a healthy answer contains and how long it took on a measured run, what the first message also brings with it, and five things to ask next.

  • --generate-only — writes install.env (when absent) and terraform.tfvars, runs pre-apply validation checks, prints out-of-Terraform prerequisites and lifecycle.sh commands, and exits 0 without applying. Those checks include the existing-cluster consent gates, so adopting a cluster that needs --migrate-node-pools, or one that enforces no NetworkPolicy and was given neither --enable-network-policy nor --accept-no-network-policy, exits 1 instead; INSTALL.md is canonical for the mode.

  • --dry-run — always runs terraform validate, and adds a full terraform plan preview when Application Default Credentials exist. On an adopted cluster lacking Workload Identity, or lacking NetworkPolicy enforcement without --accept-no-network-policy, the plan is skipped with remediation commands. Nothing is created, and state stays local. It writes no install.env: a dry run provisions nothing, so it has no install to record.

  • --gke-cluster-mode=autopilot|standard — the shape of a cluster this run creates; autopilot unless you say otherwise, and the interactive installer asks when it is about to create one. Autopilot clusters are regional, and what a zonal --gcp-region does depends on who chose Autopilot: passing --gke-cluster-mode=autopilot explicitly aborts at the interview, while leaving the flag unset builds Standard instead, since nothing asked for Autopilot there. An invalid mode value aborts the run whatever the target is. The chosen shape has no bearing on a cluster that already exists: the installer writes that cluster’s probed shape instead, for the reason scripts/installer/README.md gives.

  • --migrate-node-pools — authorizes migrating existing node pools using the legacy GCE metadata server to GKE_METADATA when adopting a cluster (recreates nodes and restarts workloads; required on clusters with legacy pools, else the install aborts).

  • --enable-network-policy — authorizes enabling the legacy Calico NetworkPolicy addon and node enforcement when adopting a GKE Standard cluster without Dataplane V2 (may recreate nodes and restart workloads). One of two answers for such a cluster; with neither, the install aborts unchanged.

  • --accept-no-network-policy — the other answer: install onto that cluster without modifying it. Every NetworkPolicy the install ships is then inert, the agent sandbox’s included, and the choice is recorded in the install report and on the PlatformAgent. Installing without NetworkPolicy enforcement says exactly what that costs.

  • --enable-gvisor=false — runs the model-executing workloads on the standard container runtime. The default is true: the shell sandbox (<agent>-shell), AgentProfile workers, and A2A session pods run under the gvisor RuntimeClass unless you say otherwise, while <agent>-gateway stays on the standard runtime. Autopilot, the default shape, ships that RuntimeClass and needs no node pool, from GKE 1.27.4-gke.800 onwards — the installer stops before applying anything if an Autopilot cluster it is adopting is older than that. On a Standard cluster the sandbox needs a node pool of its own, which the run provisions (the gke-cluster module’s enable_gvisor_node_pool).

  • --enable-google-chat — provisions the Google Chat Pub/Sub backend and enables the CR’s googleChat integration. --chat-project-id (when the Chat app lives in another GCP project or organization), --chat-manage-project=false (when the installing identity cannot administer that project), --google-chat-home-channel, and --google-chat-home-channel-policy (auto or manual) are optional.

  • --enable-slack — enables the CR’s slack integration. It needs --slack-bot-token and --slack-app-token; a non-interactive run missing either aborts before applying, since the relay cannot open a socket without both. --slack-allowed-users (Slack member IDs such as U0123ABCD, not emails), --slack-home-channel, --slack-home-channel-name and --slack-home-channel-policy (auto or manual) are optional, and an empty allowlist allows everyone in the workspace. Create the app and its tokens first: Slack app setup.

  • On a later run, the chat flags must agree with install.env. upgrade.sh renders Slack and Google Chat from that file and takes no chat flag. So install.sh refuses --enable-slack, --enable-google-chat or a --slack-*, --google-chat-allowed-users, --google-chat-home-channel, --google-chat-home-channel-policy, --google-chat-mode, --chat-project-id, --chat-manage-project or --chat-topic-name value that disagrees with a key the file sets; change the key instead. A key the file does not set is recorded there with the value the run applies, except the Slack tokens, which later runs recover from the cluster. scripts/installer/README.md has the full rule.

  • --agent-namespace=NAME — the namespace the agent and operator are installed into; kubeagents-system unless you say otherwise.

  • --sizing-profile=auto|small|medium|fleet — runtime pod sizing profile (spec.deployment.sizingProfile); defaults to auto, which steps up at 10 and 25 clusters when namespace quota allows. On fresh GKE Standard installs with 25 or more visible clusters, install.sh sets or offers TF_VAR_sizing_profile=fleet; see Fleet and host-cluster sizing.

  • The A2A gateway answers Slack, with or without Google Chat. The interactive installer’s chat menu pre-selects Google Chat on a first install, so choose Slack (Socket Mode App) or Both Google Chat and Slack there, or pass --enable-slack. The A2A gateway serves one Slack workspace: pass one bot token in --slack-bot-token. With a comma-separated list the gateway fails to authenticate and Slack goes unanswered. After two usage polls the CR reports SlackConnected=False and Degraded=True (SlackConnectionFailed) without changing Ready or phase, while the gateway pod’s log carries invalid_auth.

  • --enable-gke-backup-plan — provisions the GKE Backup plan for the cluster. Left unset, the composition’s own default decides.

  • --enable-stockout-investigator — turns on cluster-autoscaler scale-up failure diagnostics (noScaleUp Cloud Logging sink, Pub/Sub topic and subscription, and the Pub/Sub adapter). Interactive installs ask and default to yes when a chat home channel is configured; non-interactive runs stay false unless you pass this flag.

  • --enable-drift-detector=false — installs without out-of-band change detection. The default is true: a cluster reconciled from a GitOps repository is one where a change made outside that repository is worth reporting, and nothing else reports it. Turning it on costs three GCP resources in the install’s project (a Log Router sink, a Pub/Sub topic and a pull subscription) and a sink in each project a declared scope lists. It also reaches past the clusters this install manages: the sinks export the admin-activity audit records of every GKE cluster in those projects, including clusters this install does not manage. The subscription retains a copy of them for 31 days.

    On this first install the flag sticks: install.sh writes install.env and records the value you passed. It never rewrites that key afterwards, so on a later run the same flag applies to that run alone — which is why the durable opt-out is an ENABLE_DRIFT_DETECTOR=false line in install.env. spec.harness.driftDetector has the rest: what the detector reports, what it drops, and why the file is the place to opt out.

  • --gitops-org=ORG, --gitops-repo=REPO, --github-app-id=ID, --github-pem-path=PATH — configures GitOps PR automation via the in-cluster GitHub token minter (Minty). When --github-pem-path is provided, install.sh imports the private key into Cloud KMS during install; alternatively, pre-provision the key AOT beforehand (see Token minter). The fleet audits put their ledger issue and their fix pull requests in the --gitops-repo repository, never in a context repository; see Which repository gets the ledger.

  • --gitops-forge=gitlab, --gitops-host=HOST, --gitlab-token-file=PATH, --gitops-ca-file=PATH — connects a GitOps project on gitlab.com or a self-managed GitLab instead, with no token minter. --gitops-ca-file gives the private CA that signed a self-managed instance’s certificate. See GitLab as the GitOps forge.

  • --gitops-forge=bitbucket or --gitops-forge=bitbucket-datacenter, --gitops-host=HOST (Data Center), --gitops-repo=PATH, --gitops-token-file=PATH, --gitops-identity=UUID (Cloud access tokens) — connects a GitOps repository on Bitbucket Cloud or a Bitbucket Data Center instance, with no token minter. See Bitbucket as the GitOps forge.

  • --gitops-host=HOST, --gitops-ca-file=PATH with the GitHub flags above — connects a GitOps repository on a GitHub Enterprise Server, with the GitHub App created on the instance. See GitHub Enterprise Server in INSTALL.md.

  • --memory=file|hindsight|off — the agent’s long-term memory store; hindsight deploys the Hindsight API and Postgres into the cluster.

Run the installer with --help (e.g. ./install.sh --help) for the full list.

Some operator behaviour is set by environment variables on the operator’s controller manager. The images of the A2A NATS bus (A2A_NATS_IMAGE, A2A_PROVISION_IMAGE, A2A_NATS_RELOADER_IMAGE and A2A_NATS_EXPORTER_IMAGE) are ones the chart renders itself, from its a2aBus.images values under --third-party-registry-prefix, so a mirrored install sets nothing for them. install.sh has no flag for the others. Set one in the chart’s operator.extraEnv list, which is appended after the variables the chart renders and so wins over them. On an install made with install.sh, put the list in a TF_VAR_extra_helm_values line in install.env, which every later install.sh and upgrade.sh run reads:

Terminal window
TF_VAR_extra_helm_values='{operator={extraEnv=[{name="<VARIABLE>",value="<VALUE>"}]}}'

The value is an HCL object that Helm merges over the chart values the composition computes, so the same line can carry other chart keys; there is one such line, so put every extra value in it. Do not edit terraform/examples/full-install/terraform.tfvars for this: the installer regenerates that file on every run. Check it took after the next run:

Terminal window
kubectl get deployment kube-agents-controller-manager -n kubeagents-system -o jsonpath='{range .spec.template.spec.containers[0].env[*]}{.name}={.value}{"\n"}{end}' | grep '^A2A_'

On a hand-driven Terraform apply, set extra_helm_values in terraform.tfvars instead; on a bare Helm install, set operator.extraEnv in your values file.

Run the upgrade.sh published for the release you are moving to; it carries that version, so the run names no tag. See Upgrade for the modes, the previews, and what a run refuses.

Run ./uninstall.sh — it drives the same composition’s lifecycle.sh destroy against the state in GCS. See Uninstall for the full procedure and the asymmetries it handles.