KKIMS on-site docs
Deploy KIMS (UAT and production)

Handover to KIMS

What to tell KIMS before you leave, what to leave written down (without any secret value), and how to remove the engineer's own access from AWS, Kubernetes, Jenkins, Keycloak, the CMS and Google.

The last step of the visit. Do it with KIMS's infrastructure team and the person who will run the CMS (the first Admin).

#Things to tell KIMS

#Revocation timing

Signing someone out in Keycloak ends their CMS session at once. Disabling an account, or removing cms-access, ends it at the CMS's next check with Keycloak, within 5 minutes. Details: keycloak/revocation.

#Two jobs per environment

Their Jenkins gains a kims-production folder (and kims-uat if they have UAT), each with kims-platform and kims-site-build. Nothing else in their Jenkins changes. The CMS worker starts kims-site-build after every publish, as the Jenkins user whose token is in kims-jenkins.

#UAT can come later

If KIMS started with production only, adding UAT later is: a uat branch made from main (deploy/push-code), a second set of AWS resources, a kims-uat folder, and deploy/secrets to deploy/acceptance again with UAT's files. Nothing in production changes.

#How code changes reach production

  • With UAT: change uat, kims-uat/kims-platform deploys it, KIMS accepts it, then git push kims uat:main (fast-forward only) and kims-production/kims-platform deploys the same image.
  • Production only: change main, and kims-production/kims-platform deploys it.
  • Content is never promoted between environments; it is edited and published in production's CMS.

#Rollback

  • Code: rerun kims-platform on an earlier commit (a revert commit), or helm rollback kims <REVISION> -n kims (UAT: -n kims-uat).
  • Content: restore a page's earlier version from its version history in the CMS, then publish.
  • Database: RDS point-in-time recovery, the last resort.

Full steps: deploy/production-cutover.

#What reaches AWS

S3 and CloudFront only, through IAM roles: the pods' role (assets bucket) and the Jenkins agent's role (assets read, website write, CloudFront invalidation, the redirects store if used). No Lambda, no access keys.

#The secrets key must never change

secrets-key in the kims-app Secret encrypts what Admins save in the CMS (the Translation API key, the Google reviews client and connection). If it is lost or changed, those must be entered again. Keep the copy in KIMS's vault. Details: deploy/secrets.

#Alerts

The alerts scheduled task writes a log line with "level":"alert" once per problem: a publish that no site build picked up (publish-without-build), or a latest site build that failed (build-failed). KIMS should send those lines to whoever looks after the site: their log platform can search the pods' logs for "level":"alert". To look by hand:

bash
kubectl -n kims logs -l kims.org/cron-task=alerts --tail=-1 | grep '"level":"alert"'
bash
kubectl -n kims logs -l kims.org/cron-task=alerts --tail=-1 | grep '"level":"alert"'
powershell
kubectl -n kims logs -l kims.org/cron-task=alerts --tail=-1 | Select-String '"level":"alert"'

Expected on a healthy site: no output.

#People

Everyone who works in the CMS needs cms-access on the environment's Keycloak client and a row on the CMS People screen. Keep at least two Admins. A person cannot approve their own change. Details: deploy/people.

#Google services

Admins manage them in the CMS: the Translation screen (API key) and the Google reviews screen (connection). The reviews OAuth client is saved by a script, not a CMS screen (google/reviews-oauth). Reviews reach the website only at the next site build.

#What to leave written down

Fill this in with KIMS and give it to their infrastructure team. Names, addresses and identifiers only. Never a secret value: secrets stay in Kubernetes Secrets, Jenkins credentials and KIMS's vault.

Item Production UAT
Website host
CMS host
CloudFront distribution ID and domain
Website bucket, assets bucket, region
RDS instance identifier and endpoint
EKS cluster and namespace
ECR repository
IAM role for the pods (ARN)
IAM role for the Jenkins agent (ARN)
Jenkins folder and jobs
Jenkins user the worker uses
Keycloak realm and client ID
Helm release name and current revision
Commit deployed (12 characters)
Live published version
Google Cloud project ID
Translation API key name (not the key)
Reviews OAuth client name (not the secret)
GTM container ID, if any
Redirects KeyValueStore ARN, if any
Where the vault copies of the Secrets are
Who decides go-live and rollbacks
Open questions and known issues

#Find the values to fill in

bash
helm -n <NAMESPACE> list
kubectl -n <NAMESPACE> get deploy kims-cms -o jsonpath='{.spec.template.spec.containers[0].image}'; echo
kubectl -n <NAMESPACE> get sa -o jsonpath='{range .items[*]}{.metadata.name}{"  "}{.metadata.annotations.eks\.amazonaws\.com/role-arn}{"\n"}{end}'
kubectl -n <NAMESPACE> get ingress
bash
helm -n <NAMESPACE> list
kubectl -n <NAMESPACE> get deploy kims-cms -o jsonpath='{.spec.template.spec.containers[0].image}'; echo
kubectl -n <NAMESPACE> get sa -o jsonpath='{range .items[*]}{.metadata.name}{"  "}{.metadata.annotations.eks\.amazonaws\.com/role-arn}{"\n"}{end}'
kubectl -n <NAMESPACE> get ingress
powershell
helm -n <NAMESPACE> list
kubectl -n <NAMESPACE> get deploy kims-cms -o jsonpath="{.spec.template.spec.containers[0].image}"
kubectl -n <NAMESPACE> get sa -o jsonpath="{range .items[*]}{.metadata.name}{'  '}{.metadata.annotations.eks\.amazonaws\.com/role-arn}{'\n'}{end}"
kubectl -n <NAMESPACE> get ingress

Expected: the release kims with its REVISION and STATUS deployed; the image ending :<COMMIT_SHA>; the kims service account with its role ARN; the ingress with the CMS host and the load balancer address.

#Remove the engineer's access

Do this last, with KIMS watching, once nothing else needs you. Before each removal make sure someone at KIMS has the same access, so nothing is left without an owner.

#Files on your computer

Delete anything copied for the visit: values files, kims-site-env files, the data bundle, kubeconfig contexts.

bash
kubectl config get-contexts
kubectl config delete-context <CONTEXT_NAME>
rm -f <VALUES_FILE> <SITE_ENV_FILE>
bash
kubectl config get-contexts
kubectl config delete-context <CONTEXT_NAME>
rm -f <VALUES_FILE> <SITE_ENV_FILE>
powershell
kubectl config get-contexts
kubectl config delete-context <CONTEXT_NAME>
Remove-Item <VALUES_FILE>, <SITE_ENV_FILE>

Expected: deleted context <CONTEXT_NAME> from ..., and the context gone from get-contexts. The temporary folders the deploy/secrets steps made should already be gone; check.

#AWS

KIMS's AWS admin removes (or ends the session of) the IAM user, role or Identity Center assignment you used, and any EKS access entry made for you:

  1. IAM > Users (or IAM Identity Center > AWS accounts > the account > your assignment) > remove.
  2. EKS > the cluster > Access > IAM access entries > your entry > Delete.

Check from your machine:

bash
aws sts get-caller-identity
kubectl -n <NAMESPACE> get pods
bash
aws sts get-caller-identity
kubectl -n <NAMESPACE> get pods
powershell
aws sts get-caller-identity
kubectl -n <NAMESPACE> get pods

Expected: an error (ExpiredToken, InvalidClientTokenId or AccessDenied) and error: You must be logged in to the server (Unauthorized) or similar.

#Jenkins

  1. Manage Jenkins > Users > your account > Delete, or ask KIMS to remove your rights.
  2. If you made an API token for yourself, revoke it: your user > Security > API Token > the token > Revoke.

Keep the worker's Jenkins user and its token; the CMS needs them.

#Keycloak and the CMS

  1. Keycloak: Users > your account > Role mapping > cms-access > Unassign (each environment's client), or ask KIMS to disable the account.
  2. CMS: an Admin removes you from People.

Expected: your next click in the CMS goes to sign-in, then "no access".

#Google Cloud

  1. IAM & Admin > IAM > your account > Edit principal (pencil) > remove each role > Save.
  2. Confirm at least one KIMS account is Owner first.
  3. Billing > Account management: remove yourself from the billing account if you were added.
  4. Google Business Profile: KIMS removes you as a manager if you were added (support.google.com/business/answer/3415589).
  5. Google Tag Manager: Admin > User Management > your account > remove.

#Git

Remove your access to KIMS's Git repository (or the deploy key you used), and remove the kims remote from your clone if you keep it:

bash
git remote remove kims
bash
git remote remove kims
powershell
git remote remove kims

#UAT and production

Everything above is done for each environment that exists. The access removal is done once, at the very end.

#Sources

Built 2026-11-29. Commands are shown for the system picked at the top; every block has all three.