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.
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.
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
- deploy/push-code (push
main). - AWS pieces for production (aws/access onward), Keycloak client (keycloak/client), Jenkins folder
kims-production(jenkins/overview). - deploy/secrets, deploy/helm-values, deploy/first-deploy, deploy/content-load, deploy/people, deploy/website, deploy/acceptance.
- Google services (google/translation-api-key, google/reviews-oauth).
- 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
- A change is pushed to the
uatbranch in KIMS's Git. kims-uat/kims-platformbuilds the image (tagged with the commit SHA), pushes it and deploys it tokims-uat.- KIMS tests it on UAT.
mainis moved to the same commit:git push kims uat:main. This only succeeds as a fast-forward, somainis never ahead ofuat.kims-production/kims-platformruns 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.mdkims-v2/deploy/jenkins/README-site.mdkims-v2/deploy/jenkins/Jenkinsfile.platformkims-v2/deploy/jenkins/Jenkinsfile.sitekims-v2/deploy/jenkins/check-environment.shkims-v2/deploy/jenkins/site-env-production.examplekims-v2/deploy/jenkins/site-env-uat.examplekims-v2/deploy/helm/kims/values-production.example.yamlkims-v2/deploy/helm/kims/values-uat.example.yamlkims-v2/apps/website/src/app/robots.tskims-v2/scripts/gates/sitemap-robots.mjskims-v2/scripts/site-build/run.mjs