Docs Home
Start your 30 day free trial.
START FOR FREE

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.

‍

Error Cause Solution
TeamCredential is False, reason SecretNotFound or MissingSecretKeys The Secret is missing, is in another namespace, or lacks gremlin.cert or gremlin.key. Create the Secret in the TeamCredential's namespace with both keys, or correct spec.authRef.secretName.
TeamCredential is False, reason InvalidCertificate The key is not in EC PRIVATE KEY format, the key and certificate are not a pair, or the certificate has expired. Download a new pair in Team Settings and replace the Secret.
TeamCredential is False, reason KeyMismatch The private key does not belong to the certificate. Use the key that was downloaded with the certificate, and replace the Secret. EXPIRES is blank.
TeamCredential is False, reason UnsupportedKeyFormat The key file is not a SEC1 EC PRIVATE KEY that parses. A PKCS#8 key (-----BEGIN PRIVATE KEY-----) is the usual cause. For PKCS#8, run openssl ec -in <key file> -out <SEC1 key file>, check that the new file starts with -----BEGIN EC PRIVATE KEY-----, and put it in the Secret. For other problems read the message. EXPIRES is blank.
AgentsReady or ChaoReady is False The agent or Chao pods are not running, or are being refused by the cluster. Read the reason and message that the command above prints. They name what is wrong, and often what the cluster refused and why.
AgentsReady or ChaoReady is False with the reason NetworkSettingsNotReady A Secret or ConfigMap that spec.network names, such as the proxy credentials, is missing or incomplete in the agents' namespace Read the NetworkSettingsValid condition, which the command above prints. Its message names the object and key. Create or fix it in the agents' namespace.
READY turns False within about a minute of the install, AgentsReady has the reason AgentsDegraded and the agent pods show Error or CrashLoopBackOff. READY may read True again for a few seconds between restarts The agent cannot start. A common cause is a credential that Gremlin refused. Read the agent logs, check spec.teamId on the TeamCredential, and check that the certificate belongs to the same team.
CredentialReady is False and no agent pods are created The credential is not yet usable. Read the CredentialReady reason, then the TeamCredential rows above.

‍

If the operator's own pods are not running, read their logs:

‍

On this page
Back to top