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

Production and UAT environments

What production and the optional UAT environment each consist of, which branch, Jenkins folder, namespace and files belong to each, what they share, the guards that keep them apart, and how code moves from UAT to production.

Production is always deployed. UAT is optional: a second, complete, separate copy of the platform, only if KIMS wants one. Ask KIMS at the start of the day which they want: production only, UAT and production, or production now and UAT later. Nothing in the code changes between these.

Note

Every page in this section says what differs at each step. Where a command shows <NAMESPACE>, use kims for production and kims-uat for UAT. Where it shows <FOLDER>, use kims-production or kims-uat.

#What belongs to each environment

#The table to keep beside you

Production UAT (only if KIMS wants it)
Git branch main uat, made from main
Jenkins folder (holds both jobs and their credentials) kims-production kims-uat
Kubernetes namespace kims kims-uat
Helm release name kims kims (in its own namespace)
Helm values file (Jenkins credential kims-helm-values in the folder) from deploy/helm/kims/values-production.example.yaml from deploy/helm/kims/values-uat.example.yaml
Site build settings (Jenkins credential kims-site-env in the folder) from deploy/jenkins/site-env-production.example from deploy/jenkins/site-env-uat.example
KIMS_ENVIRONMENT (Helm values) production uat
KIMS_ENV (site build settings) production uat
SITE_NOINDEX Not set (indexed by search engines) true (kept out)
JENKINS_JOB_URL https://<JENKINS_HOST>/job/kims-production/job/kims-site-build https://<JENKINS_HOST>/job/kims-uat/job/kims-site-build
IRSA trust: service account system:serviceaccount:kims:kims system:serviceaccount:kims-uat:kims
RDS Multi-AZ, Production template, deletion protection Single instance, Dev/Test template
Keycloak Its own CMS client and cms-access role Its own CMS client and role (testers can have UAT without production)

#Separate for each environment

Database (RDS instance or at least its own database), assets bucket, website bucket, CloudFront distribution, website host, CMS host and certificates, the pods' IAM role, the four Kubernetes Secrets (including its own SECRETS_KEY), the Keycloak client, the Jenkins folder with its credentials, the Google translation API key, and the CMS's own data (people, content, Google sign-ins).

#Shared

The Git repository, the image registry (production reuses UAT's image of the same commit), the Jenkins agent (needs about 30 GB free disk if it builds both), KIMS's Keycloak realm, and the Google Cloud project.

Warning

Never create kims-database-url, kims-site-env or kims-helm-values as global Jenkins credentials. Jenkins looks in the folder first and falls back to global ones, so a production folder missing its own credential would silently use UAT's database or buckets. Only kims-registry and kims-kubeconfig may be global, and only if both environments really use the same ones.

#The guards

#What stops one environment deploying over the other

Guard Where What it refuses Message
Branch decides the environment kims-platform (Jenkinsfile.platform) Deploying from any branch but main (production) or uat (UAT) Branch '<name>' deploys nowhere: production deploys from main, UAT from uat. Untick DEPLOY to only build it.
Values file must match the branch kims-platform, Deploy stage A values file whose KIMS_ENVIRONMENT differs from the branch's environment The Helm values file says KIMS_ENVIRONMENT 'uat', but branch main deploys production. Check the kims-helm-values credential in this folder.
Site settings must match the branch kims-site-build, first stage Check environment (deploy/jenkins/check-environment.sh) KIMS_ENV in kims-site-env not matching the branch This run is for uat, which builds only from the 'uat' branch, but it checked out 'main'.
Robots gate Site build quality gates A non-production build whose robots.txt allows crawling; a production build that disallows it without SITE_NOINDEX=true Names the locale and the reason

So: leave KIMS_ENVIRONMENT and KIMS_ENV exactly as the example files have them.

#Search engines

The website is indexable only when KIMS_ENV=production and SITE_NOINDEX is not true. Any other environment builds a robots.txt that disallows everything, whatever SITE_NOINDEX says. The website build also treats a SITE_URL host starting poc., staging. or preview. as non-public; so a production SITE_URL on such a host would fail the robots gate. UAT host names like uat.kimshospitals.com are fine.

Production can be held out of search until launch with SITE_NOINDEX=true in its kims-site-env, then released: see deploy/production-cutover.

#Order on the day

#Production only

  1. deploy/push-code (push main).
  2. AWS pieces for production (aws/access onward), Keycloak client (keycloak/client), Jenkins folder kims-production (jenkins/overview).
  3. deploy/secrets, deploy/helm-values, deploy/first-deploy, deploy/content-load, deploy/people, deploy/website, deploy/acceptance.
  4. Google services (google/translation-api-key, google/reviews-oauth).
  5. deploy/production-cutover when KIMS says go.

#UAT and production

Do step 2 to 4 for UAT first, including all acceptance checks. Then do them again for production. Pushing the code and setting up the Jenkins agent happen once.

#Adding UAT later

Make the uat branch from main (deploy/push-code), a second set of AWS resources, the kims-uat folder, and repeat steps 2 to 4. Nothing in production changes.

#How code moves after go-live

#With UAT

  1. A change is pushed to the uat branch in KIMS's Git.
  2. kims-uat/kims-platform builds the image (tagged with the commit SHA), pushes it and deploys it to kims-uat.
  3. KIMS tests it on UAT.
  4. main is moved to the same commit: git push kims uat:main. This only succeeds as a fast-forward, so main is never ahead of uat.
  5. kims-production/kims-platform runs on that commit. It finds the image already in the registry and deploys it as it is (<image> is already in the registry; deploying it as it is.), so production runs exactly what UAT tested.

#Production only

A change is pushed to main; kims-production/kims-platform deploys it.

#Content is not promoted

Each environment loads the data bundle on its first day (deploy/content-load). After that, content is edited and published in each CMS separately; production's CMS is where real content is published. UAT's content is for testing code against.

#Sources

  • kims-v2/docs/ON-SITE-DEPLOYMENT.md (main)
  • kims-v2/deploy/jenkins/README.md
  • kims-v2/deploy/jenkins/README-site.md
  • kims-v2/deploy/jenkins/Jenkinsfile.platform
  • kims-v2/deploy/jenkins/Jenkinsfile.site
  • kims-v2/deploy/jenkins/check-environment.sh
  • kims-v2/deploy/jenkins/site-env-production.example
  • kims-v2/deploy/jenkins/site-env-uat.example
  • kims-v2/deploy/helm/kims/values-production.example.yaml
  • kims-v2/deploy/helm/kims/values-uat.example.yaml
  • kims-v2/apps/website/src/app/robots.ts
  • kims-v2/scripts/gates/sitemap-robots.mjs
  • kims-v2/scripts/site-build/run.mjs
Built 2026-11-29. Commands are shown for the system picked at the top; every block has all three.