Installing Gremlin on Kubernetes with the Gremlin Operator
The Gremlin Kubernetes Operator runs the Gremlin agent in your cluster for you. You install the operator with Helm, then describe the agent you want in a Kubernetes resource, and the operator creates and updates the agent pods to match. It also runs Chao, which discovers your Kubernetes workloads so you can target them in Gremlin.
This page takes about 15 minutes. You install the operator, give it your team's certificate, and create an Agent resource. You finish with an agent on each node and your cluster listed in the Gremlin web app.
The operator is an alternative to installing the Gremlin agent with the Gremlin Helm chart. Both install the agent, so use one or the other on a cluster.
Before you start
You need:
- A Kubernetes cluster and
kubectlaccess that can create cluster-scoped resources: CRDs, ClusterRoles and ClusterRoleBindings. - Helm 3.14 or later.
- Your team ID, and a certificate and private key for your team. In the Gremlin web app, open Team Settings, then Details, then Certificates, and select Download. The team ID is shown on the same page. The key file must start with
-----BEGIN EC PRIVATE KEY-----. See Authenticating the Gremlin agent for more on certificates. - A way for the agents to reach
https://api.gremlin.com, directly or through an HTTPS proxy, and a way for the cluster to pull the operator, agent and Chao images from Docker Hub or from a registry mirror of your own. The operator image isgremlin/gremlin-operatoron Docker Hub. TheAgentresource sets the proxy (see the Kubernetes Operator API reference).
Behind a proxy, cloud metadata lookups (169.254.169.254 and metadata.google.internal) bypass it. To bypass it for more hosts, domains, IP addresses or CIDR ranges, list them in spec.network.proxy.noProxy (see the API reference).
If the cluster pulls through a private registry, point the chart and the Agent at it. For the operator, set the chart values image.repository and imagePullSecrets, for example --set imagePullSecrets[0].name=<secret name>. For the agent and Chao, set the Agent's spec.image.registry to the registry host, with a path prefix if your mirror uses one, and spec.image.pullSecrets to a list of Secret names in the agents' namespace. The operator adds gremlin/gremlin and gremlin/chao itself, so the mirrored images must be at <registry>/gremlin/gremlin and <registry>/gremlin/chao, and spec.image.registry must not end in /gremlin.
Only one operator can run in a cluster. If the cluster runs the agent from the Gremlin Helm chart, that chart's agents use a namespace named gremlin, and this install fails on it. Follow Managing the Gremlin Operator instead, which moves the cluster over in place. If the cluster runs Gremlin agents from manifests, remove them first.
Install the operator
The operator uses two namespaces. Its own pods run in OPERATOR_NS. The agents and Chao run in AGENT_NS, which the chart creates, and this page keeps your team's credential there too. Set both once. The variables last for this terminal session, so set them again in a new one.
Add the Gremlin chart repository and install the chart:
This installs the latest chart release, which runs the operator image version that the chart names. To install a specific release, add --version followed by the chart version.
Each of the operator's two processes runs three replicas, one active and two on standby. On a small cluster, add --set reconciler.replicas=1 --set credentialManager.replicas=1.
Check the install:
Every pod should be Running, and the CRDs agents.gremlin.com and teamcredentials.gremlin.com should exist. The pod names tell the two processes apart: gremlin-operator-controller-manager is the reconciler, which runs the agents and Chao, and gremlin-operator-credential-manager is the credential manager, which checks your team's certificate and copies it where the agents can read it.
Give the operator your team's credential
Point the shell at the files you downloaded, and check the key format:
The last command must print -----BEGIN EC PRIVATE KEY-----.
Create a Secret that holds the certificate and key, and a TeamCredential that points at it. The names platform-team-cert and platform-team are examples. Use your own, and keep each the same wherever it appears.
Within a few seconds READY shows True and EXPIRES shows when the certificate expires. The operator checks that the key is a SEC1 EC key, that it belongs to the certificate, and that the certificate is in date. If READY is FALSE, the REASON column names the problem: see Troubleshooting. The operator does not contact Gremlin, so True does not yet mean Gremlin accepts the certificate. Verify the installchecks that.
A team that authenticates with a team secret instead of a certificate uses mode: secret and a Secret with the key teamSecret.
Create the Agent
An Agent says what to run and where. There is exactly one per cluster, and it is named default. clusterId is the name this cluster has in Gremlin. Choose one that is unique to the cluster. Two clusters that share a cluster ID collide in Gremlin and cause errors. You cannot change it later without deleting and recreating the Agent.
The agent runs on every node it can run on. That excludes nodes with a NoSchedule taint, such as control-plane nodes, unless the Agent tolerates the taint. If your cluster has tainted nodes that you want the agent on, add tolerations to the Agent under spec. This example allows the agent on control-plane nodes:
Add one entry for each taint your nodes carry. For a full reference of the Agent resource, see the Kubernetes Operator API reference.
Verify the install
Wait for the Agent to become ready, then look at what the operator created:
A healthy install has READY True on the Agent, one gremlin-agent pod on each node it can run on, and one chao pod. Run kubectl get agents again two minutes later, because a credential that Gremlin refuses only shows up then.
Ready means the operator's own checks passed. The operator never calls Gremlin, so confirm that Gremlin accepted the agents. Read the logs, which should show no authentication errors: 401 unauthorized or AuthError in the agent logs, and 401 or 409 in the Chao logs:
Then open the Gremlin web app and go to Configurations > Agents. Each agent registers as a client, and your nodes should appear with the cluster ID you set. If Gremlin refuses the credential, within about two minutes the agent pods fail and restart, READY turns False with the reason AgentsDegraded, and the pods show Error or CrashLoopBackOff. READY can read True again after a few seconds while a pod restarts, so check twice. Then, check spec.teamId on the TeamCredential, and check that the certificate belongs to the same team.
If the Agent does not become ready, or your nodes do not appear in Gremlin, see the Troubleshooting section of Managing the Gremlin Operator. This page also explains how to upgrade, rotate the certificate, or uninstall the operator.

