These are planned changes, not incident actions. Do staging first.
export CTX=gke_gl-orbit-stg_us-east1_orbit-stg # production: gke_gl-orbit-prd_us-east1_orbit-prdBefore you start (GitLab.com)
A new version in an ExternalSecret updates its Secret only with refreshPolicy: OnChange.
Check it:
kubectl --context "$CTX" -n gkg get externalsecret \
-o 'custom-columns=NAME:.metadata.name,POLICY:.spec.refreshPolicy,STATUS:.status.conditions[0].reason'All secrets except gkg-security-image-pull must show OnChange and SecretSynced. If one
does not, add refreshPolicy: OnChange to it in services/gkg/env/orbit-<env>/values-vault-secrets.yaml
first.
| Secret | Vault path (<env> is prd or stg) |
ExternalSecret |
|---|---|---|
| JWT shared key | k8s/shared/knowledge-graph/<env>/jwt |
gkg-gitlab-jwt |
| ClickHouse passwords | k8s/orbit-<env>/gkg/clickhouse-cloud |
gkg-graph, gkg-graph-readonly, gkg-datalake |
| CA that Rails trusts | k8s/shared/knowledge-graph/<env>/tls |
Rails side, gitlab-knowledge-graph-tls-certificate-v1 |
Reloader restarts the Orbit pods when their Secret changes. Check a restart with
kubectl --context "$CTX" -n gkg get pods: the AGE of the pods is new. Do not put secret
values on the shell command line.
If a rotation breaks connections
Symptoms: authentication or TLS errors right after a rotation.
- Set
versionback on the side you changed last, and merge. Exception: after ClickHouse step 6, add a new password instead. - Check: the health check passes.
JWT shared key
Rails and Orbit each hold one key, so there is a short downtime. Do it in a low-traffic window and change both sides close together.
-
A Vault administrator writes a new key (base64 of exactly 32 bytes):
vault kv put -mount=k8s shared/knowledge-graph/<env>/jwt key="$(openssl rand -base64 32)" -
Orbit: set
versionofgkg-gitlab-jwtto the new Vault version. Check: the webserver and indexer pods restart. -
In
k8s-workloads/gitlab-com, add the ExternalSecretgitlab-knowledge-graph-jwt-v2with the new version. Pointglobal.appConfig.knowledgeGraph.jwtSecret.secretto it. -
Ask the release managers in
#releasesto hold auto-deploy while you merge. An auto-deploy can roll the change back. -
Check: the health check passes. Then remove the old ExternalSecret.
ClickHouse passwords
The three passwords are properties of one Vault secret. Use vault kv patch. vault kv put
deletes the other passwords.
-
Make the new password in a file:
openssl rand -base64 32 | tr -d '\n' > /tmp/pw && chmod 600 /tmp/pw -
Add it to the SQL user in the ClickHouse console. The old password continues to work:
ALTER USER <user> ADD IDENTIFIED WITH sha256_password BY '<contents of /tmp/pw>' -
Write it to Vault:
vault kv patch -mount=k8s orbit-<env>/gkg/clickhouse-cloud <user>_password=@/tmp/pw -
Set
versionin the matching ExternalSecret to the version thatvault kv patchshows. The number can go up by more than 1. -
Check that the Orbit pods restarted. If they did not, restart them:
kubectl --context "$CTX" -n gkg rollout restart deployWarning
Do not run the next step before the pods restart. Orbit then loses access to ClickHouse.
-
Remove the old password. This keeps only the last password that you added:
ALTER USER <user> RESET AUTHENTICATION METHODS TO NEW -
Check: no ClickHouse authentication errors in the Orbit logs, and the health check passes. Delete
/tmp/pw.
gkg_siphon_reader is on the datalake service. Coordinate with the Siphon team.
Certificates
cert-manager renews the leaf certificates by itself. The private CA orbit-<env>-root-ca
renews by itself at its RENEWAL time, with a new key. That breaks all connections, so rotate
it by hand before then. Check its dates:
kubectl --context "$CTX" -n cert-manager get certificate orbit-<env>-root-ca \
-o 'custom-columns=NOT_AFTER:.status.notAfter,RENEWAL:.status.renewalTime'Warning
Do not run cmctl renew on the root CA and do not delete its Secret. Both make a new CA key.
After TLS errors, check the leaf certificates:
kubectl --context "$CTX" -n gkg get certificate (READY must be True).
CA rotation
Rails can trust two certificate authorities at once, so the gRPC side has no downtime. NATS has a short window: the server and the clients must change together.
-
In argocd-apps
services/cert-manager/env/orbit-<env>/values.yaml, add a Certificateorbit-<env>-root-ca-v2(common nameorbit-<env>-root-ca-v2) and a ClusterIssuerorbit-<env>-ca-v2. Keep the old ones. -
Get the public certificate of the new CA. This Secret also holds the CA private key, so copy only
ca.crt:kubectl --context "$CTX" -n cert-manager get secret orbit-<env>-root-ca-v2 \ -o jsonpath='{.data.ca\.crt}' | base64 -d > orbit-<env>-ca-v2.crt -
Put both CA certificates in one file. A Vault administrator writes it as a new version of
k8s/shared/knowledge-graph/<env>/tls, propertycertificate. -
In
k8s-workloads/gitlab-com, add the ExternalSecretgitlab-knowledge-graph-tls-certificate-v2with that version. Replace v1 with it inglobal.certificates.customCAs. Rails pods restart. -
Webserver: set
issuerRef.nameofgkg-server-tlstoorbit-<env>-ca-v2. cert-manager issues the new certificate at once. Check: the health check passes. -
NATS, in one window: set
issuerRef.nametoorbit-<env>-ca-v2onnats-server-tls,nats-box-client-tls,nats-client-gkg,siphon-client-tls(production) andnats-surveyor-client-tls(staging). Merge.-
Sync
natsat once, thensiphon, if ArgoCD does not sync them by itself. -
Orbit pods crash with
UnknownIssueruntil NATS has the new certificate. Indexing stops for those minutes. -
Restart Orbit and Siphon. Reloader does not restart Siphon for this Secret:
kubectl --context "$CTX" -n gkg rollout restart deploy kubectl --context "$CTX" -n siphon rollout restart deploy -
Check: all NATS pods are ready and all Orbit pods are
Running.
-
-
Check that no Certificate uses the old issuer:
kubectl --context "$CTX" get certificates -A \ -o 'custom-columns=NS:.metadata.namespace,NAME:.metadata.name,ISSUER:.spec.issuerRef.name' -
Remove the old ClusterIssuer, then the old CA Certificate. Removing the CA Certificate also deletes the CA key, so do it last.
Dedicated
- Onboarding creates the JWT key and the ClickHouse passwords in AWS Secrets Manager. There is no tested rotation. Talk to the Orbit and Dedicated teams first.
- At every install and upgrade, the Orbit chart sets each ClickHouse password to the Secret value. It removes all other passwords. Do not upgrade Orbit while a user has two passwords.
- Orbit uses no TLS inside the tenant cluster, so there are no certificates to rotate.