Managing the Gremlin Kubernetes Operator
This page covers what you do after the Gremlin Operator is running: upgrading it, rotating your team's certificate, uninstalling it, moving to it from the Gremlin Helm chart, and troubleshooting.
The commands use the namespace variables OPERATOR_NS and AGENT_NS from Installing Gremlin on Kubernetes with the Gremlin Operator. If you are in a new terminal, set them again.
Upgrade the operator
Helm installs CRDs once and never upgrades them, so apply the new CRDs first and then upgrade the chart. This needs Helm 3.14 or later.
Without --reset-then-reuse-values, helm upgrade drops every --set option from the install, including the install namespace, the image tag and the replica counts, and goes back to the chart defaults. The flag keeps them. To change an option, add --set for it.
The CRD apply is a server-side apply. --force-conflicts lets it take over the CRD fields that Helm set when it installed them. To move to a specific chart version, add the same --version to helm pull and helm upgrade.
To upgrade the agents or Chao, change agentVersion or chao.version on the Agent. The operator rolls the agent pods one node at a time by default.
Rotate the certificate
Gremlin certificates expire one year after they are issued. The operator posts a Warning Event on the TeamCredential at 30 days and again at 7 days before expiry. Events do not last long, so also check the date now and then:
To rotate, create a new certificate in the Gremlin web app: open Team Settings, then Details, then Certificates, select + New, and download the new certificate and key. Use + New, not Replace, so the old certificate keeps working until the agents have moved over.
Before you rotate, confirm that the file you downloaded is the new one. A download taken right after clicking + New will return the old certificate. Compare the certificate in the cluster with the downloaded file:
The fingerprints must differ, and the new start date must be later than the old one. If the fingerprints match, download again. Do not compare serial numbers: Gremlin can issue certificates with the same serial. Then point CERT and KEY at the new files and replace the Secret:
The operator checks the new pair. If it passes, the agents and Chao restart on their own. If it fails, nothing restarts and the agents keep running on the old certificate. To see which happened, run:
CredentialProjected means the agents moved to the new certificate. RotationFailed means the new one was refused, and the message says why, for example KeyMismatch. Fix the Secret and the rotation completes.
When the agents run on the new certificate, run kubectl -n $AGENT_NS get teamcredentials and check that EXPIRES shows the new certificate's date. Only then go back to Certificates in the Gremlin web app and select Delete on the old certificate.
Uninstall
Delete the Agent first. The agents and Chao belong to the Agent and keep running after the operator is gone if you remove the operator first.
Helm does not remove the CRDs, and the uninstall keeps both namespaces, your Secret and your TeamCredential, so that removing the operator never deletes a credential. The agents' namespace also keeps its pod-security.kubernetes.io/enforce=privileged label. To remove everything, run the commands below. Deleting a CRD deletes every resource of that kind, and deleting a namespace deletes everything in it, so check first that nothing else uses them.
If you stored credentials in other namespaces, delete those TeamCredential resources and Secrets as well.
Move from the Gremlin Helm chart
A cluster can run the agent from the Gremlin Helm chart or from the operator, not both. To switch, uninstall the Gremlin chart release first, which stops its agents, then install the operator into the same gremlin namespace. The chart does not own that namespace, so tell it to use the existing one and label the namespace yourself so that Pod Security admits the privileged agent pods:
Without installNamespace.create=false, Helm stops with the error exists and cannot be imported into the current release: invalid ownership metadata. Then create the TeamCredential and Agent as described in Installing Gremlin on Kubernetes with the Gremlin Operator (INSTALL_PAGE_URL, to be set). You can reuse the certificate and key you already have. Create the Secret from the same two files, as the install page describes, and use the same clusterId as before if you want the cluster to keep its identity in Gremlin.
The operator's credential manager can write every Secret in the agents' namespace, and its reconciler creates workloads there. If the gremlin namespace holds more than the Gremlin chart release, use a new namespace instead: set AGENT_NS to a new name such as gremlin-operator-agents, leave out installNamespace.create=false, and the install creates it. Do not rely on a Secret from the old release in that case, because it stays in the old namespace.
If you delete the gremlin namespace and create it again, Chao may be rejected with 409 Conflict: Active chao client with the clusterId ... already exists for about 3.5 minutes and restart once. The agents are not affected, and it clears on its own. This is what was observed, and the cause is not confirmed.
Troubleshooting
Start with the status conditions on the two resources. Each reason names what is wrong.
If the operator's own pods are not running, read their logs:

