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

Write the Helm values file

Fill in the environment's Helm values file from values-production.example.yaml or values-uat.example.yaml, with every key of the chart explained (image, IRSA service account, env, secretEnv, CMS ingress with ALB annotations, resources, PodDisruptionBudgets, CronJobs, migrate), check it, and store it in Jenkins as kims-helm-values.

The chart is deploy/helm/kims. Its defaults are in values.yaml; each environment overrides them with one file that you fill in, keep outside Git, and upload to Jenkins as the secret file kims-helm-values in the environment's folder.

Environment Start from Jenkins credential
Production deploy/helm/kims/values-production.example.yaml kims-helm-values in folder kims-production
UAT deploy/helm/kims/values-uat.example.yaml kims-helm-values in folder kims-uat

The file holds no secrets, but it is environment configuration (bucket names, hosts, role ARN), so it stays out of Git.

#Before you start

Collect these (the page that produces each is linked):

Value Example From
<REGISTRY> 123456789012.dkr.ecr.ap-south-2.amazonaws.com aws/ecr
Pods' IAM role ARN arn:aws:iam::123456789012:role/kims-app-prod aws/iam
Region ap-south-2 aws/access
Assets and website buckets kims-hospitals-assets-prod, kims-hospitals-website-prod aws/s3-buckets
Keycloak issuer and client id https://sso.kims.example/realms/kims, kims-cms keycloak/client
CMS host cms.kimshospitals.com KIMS
Website host www.kimshospitals.com KIMS
Ingress class and CMS certificate ARN alb, arn:aws:acm:ap-south-2:...:certificate/... aws/eks, aws/certificates-and-dns
Jenkins host and the CMS's Jenkins user jenkins.kims.example, kims-cms jenkins/api-token
First Admin's email it.admin@kimshospitals.com KIMS

#Copy the example

#Step 1: copy it outside Git

bash
mkdir -p ~/kims-config
cp deploy/helm/kims/values-production.example.yaml ~/kims-config/values-production.yaml
# UAT: cp deploy/helm/kims/values-uat.example.yaml ~/kims-config/values-uat.yaml
bash
mkdir -p ~/kims-config
cp deploy/helm/kims/values-production.example.yaml ~/kims-config/values-production.yaml
# UAT: cp deploy/helm/kims/values-uat.example.yaml ~/kims-config/values-uat.yaml
powershell
New-Item -ItemType Directory -Force "$HOME\kims-config" | Out-Null
Copy-Item deploy\helm\kims\values-production.example.yaml "$HOME\kims-config\values-production.yaml"
# UAT: Copy-Item deploy\helm\kims\values-uat.example.yaml "$HOME\kims-config\values-uat.yaml"

Edit it with an editor that keeps YAML intact (VS Code, Notepad++). On Windows, save as UTF-8 without BOM.

#Every key, explained

#image

Key Default Set to Notes
image.repository registry.example/kims/kims-v2 <REGISTRY>/kims/kims-v2 The platform job overrides it with --set image.repository=$REGISTRY/$IMAGE_NAME, so keep both the same
image.tag "" Leave "" The platform job sets the full commit SHA. Rendering without a tag fails on purpose: image.tag is required (the commit SHA)
image.pullPolicy IfNotPresent Leave Tags are commit SHAs and never move
image.pullSecrets [] Only if the nodes cannot pull from the registry: [<PULL_SECRET_NAME>] ECR in the same account usually needs none

#serviceAccount (IRSA)

Key Default Set to Notes
serviceAccount.create true Leave Creates the service account kims (the release name)
serviceAccount.name "" Leave Empty means kims. The IAM role's trust policy names system:serviceaccount:<NAMESPACE>:kims, so changing this breaks IRSA
serviceAccount.roleArn "" arn:aws:iam::<ACCOUNT_ID>:role/<KIMS_APP_ROLE> Becomes the annotation eks.amazonaws.com/role-arn. The role has read and write on the assets bucket only
serviceAccount.annotations {} Usually leave Extra annotations, for example eks.amazonaws.com/sts-regional-endpoints: "true" if KIMS's cluster needs it

The migrate Job does not use this service account (it runs before the chart's objects exist and needs only the database), so it runs as the namespace's default one.

#env (plain settings, every pod)

Key Production UAT
S3_REGION ap-south-2 (Hyderabad) or ap-south-1 (Mumbai): the cluster's region Same
ASSETS_BUCKET <ASSETS_BUCKET> <UAT_ASSETS_BUCKET>
WEBSITE_BUCKET <WEBSITE_BUCKET> <UAT_WEBSITE_BUCKET>
KEYCLOAK_ISSUER https://<KEYCLOAK_HOST>/realms/<REALM> (exactly the issuer in .well-known/openid-configuration) Same
KEYCLOAK_CLIENT_ID Production CMS client UAT CMS client
KEYCLOAK_ACCESS_ROLE cms-access cms-access
CMS_URL https://<CMS_HOST> https://<CMS_UAT_HOST>
SITE_URL https://<SITE_HOST> https://<SITE_UAT_HOST>
JENKINS_JOB_URL https://<JENKINS_HOST>/job/kims-production/job/kims-site-build https://<JENKINS_HOST>/job/kims-uat/job/kims-site-build
JENKINS_USER <JENKINS_USER> <JENKINS_USER>
KIMS_BOOTSTRAP_ADMINS <FIRST_ADMIN_EMAIL> Same or a tester
KIMS_ENVIRONMENT production: leave as the example has it uat
DATABASE_POOL_MAX "10" (default) "5" is plenty

Rules:

  • Quote anything YAML might misread: DATABASE_POOL_MAX: "10".
  • CMS_URL and SITE_URL have no trailing slash.
  • The host in CMS_URL must equal cms.ingress.host.
  • A key set to null is left out of the pods. Never add S3_ENDPOINT, S3_FORCE_PATH_STYLE, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY or KIMS_AUTH_STUB on KIMS.
  • Optional worker tuning (WORKER_CONCURRENCY and others) can be added here: deploy/configuration.

Every setting is described in deploy/configuration.

#secretEnv (secrets, every pod)

Each entry names an existing Secret and key; nothing secret is written in the file. Leave them as the example has them unless KIMS named its Secrets differently:

yaml
secretEnv:
  DATABASE_URL:            { secretName: kims-database, key: url }
  KEYCLOAK_CLIENT_SECRET:  { secretName: kims-keycloak, key: client-secret }
  SESSION_SECRET:          { secretName: kims-app,      key: session-secret }
  SECRETS_KEY:             { secretName: kims-app,      key: secrets-key }
  JENKINS_TOKEN:           { secretName: kims-jenkins,  key: token }

An entry may also carry optional: true; none should on KIMS. Creating them: deploy/secrets.

#Scheduling, shared by every pod

Key Default Use
podAnnotations {} Annotations on CMS and worker pods (for example a log router's)
nodeSelector {} Pin to a node group, for example kubernetes.io/arch: amd64 if the image is built for one architecture only
tolerations [] If KIMS taints the nodes meant for this app
fullnameOverride (not set) Changes object names from kims-.... Do not set it: every page on this site assumes kims-cms, kims-worker, kims-migrate

#cms

Key Default Production UAT Notes
cms.enabled true Leave Leave
cms.replicas 2 2 1 or 2 Rolling updates keep one up (maxUnavailable: 0)
cms.service.type ClusterIP Leave Leave The ALB reaches pods directly (target-type: ip)
cms.service.port 80 Leave Leave kubectl port-forward svc/kims-cms 3000:80 uses it
cms.ingress.enabled false true true
cms.ingress.className "" From kubectl get ingressclass, for example alb Same
cms.ingress.host "" <CMS_HOST> <CMS_UAT_HOST> Required when enabled
cms.ingress.tlsSecretName "" "" when TLS ends at the load balancer (ALB) Same A TLS Secret's name for nginx-style ingress
cms.ingress.annotations {} See below See below
cms.cacheSizeLimit 512Mi Leave Leave Next.js cache (emptyDir); the root filesystem is read-only
cms.resources requests 250m CPU, 512Mi; limits 1 CPU, 1Gi Leave Leave
cms.pdb.enabled, cms.pdb.minAvailable true, 1 Leave false if replicas: 1 (a PDB with min 1 of 1 blocks node drains)

#cms.ingress with the AWS Load Balancer Controller

If kubectl get ingressclass lists alb:

yaml
cms:
  ingress:
    enabled: true
    className: alb
    host: <CMS_HOST>
    tlsSecretName: ""
    annotations:
      alb.ingress.kubernetes.io/scheme: internet-facing       # internal if the CMS is VPN only
      alb.ingress.kubernetes.io/target-type: ip               # required: the Service is ClusterIP
      alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
      alb.ingress.kubernetes.io/ssl-redirect: "443"
      alb.ingress.kubernetes.io/certificate-arn: <CMS_CERTIFICATE_ARN>
      alb.ingress.kubernetes.io/healthcheck-path: /api/health
  • target-type: ip is required: with the default (instance) the ALB needs a NodePort Service, and the chart's is ClusterIP.
  • healthcheck-path: /api/health matters: / redirects to sign-in, which the ALB counts as unhealthy.
  • The certificate is an ACM certificate for <CMS_HOST> in the cluster's region (not us-east-1): aws/certificates-and-dns.
  • Optional: alb.ingress.kubernetes.io/group.name: kims to share one ALB between UAT and production CMS ingresses, and alb.ingress.kubernetes.io/inbound-cidrs: <OFFICE_CIDRS> to limit who reaches the CMS.

If the class is nginx (or another), use the annotations KIMS's other services use, and their TLS Secret in tlsSecretName. If there is no ingress class at all, the CMS cannot be reached by host name: installing a controller is a cluster-wide change KIMS's platform team makes. Raise it on arrival.

#worker

Key Default Notes
worker.enabled true Without it a publish only queues
worker.replicas 1 Two is fine; jobs are claimed with locks
worker.terminationGracePeriodSeconds 60 Keep above WORKER_SHUTDOWN_GRACE_SECONDS (25)
worker.tmpSizeLimit 1Gi Image resizing spills to /tmp
worker.resources requests 250m, 512Mi; limits 1 CPU, 1Gi
worker.pdb.enabled, worker.pdb.maxUnavailable true, 1

#cron: the scheduled tasks

Key Default Notes
cron.enabled true
cron.suspend false true pauses every CronJob (useful during a restore)
cron.timeZone "" (the controller's zone, UTC); the examples set Asia/Kolkata The zone the schedules below are read in
cron.startingDeadlineSeconds 300
cron.activeDeadlineSeconds 900 Per run
cron.resources requests 100m, 256Mi; limits 500m, 512Mi
cron.tasks five tasks, below One CronJob each, kims-cron-<task>

The tasks as values.yaml defines them (each run only queues a job; the worker does the work):

CronJob Task Schedule Meaning (with Asia/Kolkata)
kims-cron-scheduled-publish-tick scheduled-publish.tick * * * * * Every minute: publish anything whose scheduled time has passed
kims-cron-translation-tick translation.tick */5 * * * * Every 5 minutes: carry on translation jobs
kims-cron-site-build-reap site-build.reap */10 * * * * Every 10 minutes: mark stuck site builds failed
kims-cron-alerts alerts */15 * * * * Every 15 minutes: alert on a publish no build picked up, or a failed latest build
kims-cron-reviews-sync reviews.sync 0 */6 * * * 00:00, 06:00, 12:00, 18:00 IST: Google reviews
Note

apps/worker/src/schedule.ts (used by the local dev worker) has different times for some tasks, for example reviews.sync nightly at 21:00 UTC (02:30 IST). On KIMS, the chart's cron.tasks is what runs. To change one schedule, copy the whole cron.tasks list into your values file: Helm replaces lists, it does not merge them. A task can be switched off with enabled: false on its entry.

#migrate

Key Default Notes
migrate.enabled true The kims-migrate Job runs as a pre-install,pre-upgrade hook: a failed migration stops the deploy and the running version stays up
migrate.serviceAccountName "" (the namespace's default) Needs only the database
migrate.backoffLimit 2
migrate.activeDeadlineSeconds 600
migrate.resources requests 100m, 128Mi; limits 500m, 256Mi

#Local-only keys

cms.keycloakProxy and cms.service.nodePort exist for the local kind rehearsal (local/kubernetes). cms.keycloakProxy is only on the windows-fixes branch. Never set them on KIMS.

#A complete production file

What a filled-in production file looks like (placeholders in capitals):

yaml
image:
  repository: <REGISTRY>/kims/kims-v2
  tag: ""

serviceAccount:
  create: true
  roleArn: arn:aws:iam::<ACCOUNT_ID>:role/kims-app-prod

env:
  S3_REGION: ap-south-2
  ASSETS_BUCKET: <ASSETS_BUCKET>
  WEBSITE_BUCKET: <WEBSITE_BUCKET>
  KEYCLOAK_ISSUER: https://<KEYCLOAK_HOST>/realms/<REALM>
  KEYCLOAK_CLIENT_ID: <KEYCLOAK_CLIENT_ID>
  KEYCLOAK_ACCESS_ROLE: cms-access
  CMS_URL: https://<CMS_HOST>
  SITE_URL: https://<SITE_HOST>
  JENKINS_JOB_URL: https://<JENKINS_HOST>/job/kims-production/job/kims-site-build
  JENKINS_USER: <JENKINS_USER>
  KIMS_BOOTSTRAP_ADMINS: <FIRST_ADMIN_EMAIL>
  KIMS_ENVIRONMENT: production

secretEnv:
  DATABASE_URL:           { secretName: kims-database, key: url }
  KEYCLOAK_CLIENT_SECRET: { secretName: kims-keycloak, key: client-secret }
  SESSION_SECRET:         { secretName: kims-app, key: session-secret }
  SECRETS_KEY:            { secretName: kims-app, key: secrets-key }
  JENKINS_TOKEN:          { secretName: kims-jenkins, key: token }

cms:
  replicas: 2
  ingress:
    enabled: true
    className: alb
    host: <CMS_HOST>
    tlsSecretName: ""
    annotations:
      alb.ingress.kubernetes.io/scheme: internet-facing
      alb.ingress.kubernetes.io/target-type: ip
      alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
      alb.ingress.kubernetes.io/ssl-redirect: "443"
      alb.ingress.kubernetes.io/certificate-arn: <CMS_CERTIFICATE_ARN>
      alb.ingress.kubernetes.io/healthcheck-path: /api/health

cron:
  timeZone: Asia/Kolkata

For UAT the differences are the hosts, buckets, role, client id, kims-uat in JENKINS_JOB_URL, and KIMS_ENVIRONMENT: uat.

#Check the file

#Step 2: nothing left in angle brackets

bash
grep -n '<[^>]*>' ~/kims-config/values-production.yaml
bash
grep -n '<[^>]*>' ~/kims-config/values-production.yaml
powershell
Select-String -Path "$HOME\kims-config\values-production.yaml" -Pattern '<[^>]+>'

Expected: no output.

#Step 3: render the chart

From the kims-v2 folder (Helm 3.14 or later):

bash
helm template kims deploy/helm/kims -n kims -f ~/kims-config/values-production.yaml --set image.tag=check | grep '^kind:' | sort | uniq -c
bash
helm template kims deploy/helm/kims -n kims -f ~/kims-config/values-production.yaml --set image.tag=check | grep '^kind:' | sort | uniq -c
powershell
helm template kims deploy/helm/kims -n kims -f "$HOME\kims-config\values-production.yaml" --set image.tag=check | Select-String '^kind:' | Group-Object Line | Select-Object Count, Name

Expected (production, ingress enabled, PDBs on):

text
   5 kind: CronJob
   2 kind: Deployment
   1 kind: Ingress
   1 kind: Job
   2 kind: PodDisruptionBudget
   1 kind: Service
   1 kind: ServiceAccount

An error such as cms.ingress.host is required when the ingress is enabled or secretEnv.X.secretName is required names the key to fix.

#Step 4 (optional): the deploy helper's check

bash
node deployment-steps/scripts/deploy.mjs kims values check --file <PATH_TO_VALUES_FILE>

Expected: OK: the values file is ready. It finds leftover placeholders, checks the required values and URL formats, and renders the chart. It does not check KIMS_ENVIRONMENT; the platform job does.

#Store it in Jenkins

#Step 5: upload as kims-helm-values

  1. Jenkins > the environment's folder (kims-production or kims-uat) > Credentials > the folder's store > Global credentials (unrestricted) > Add Credentials.
  2. Kind: Secret file. File: your values file. ID: kims-helm-values. Description: KIMS Helm values, production (or UAT).
  3. Create.

To change it later: the same credential > Update > upload the new file, then run the folder's kims-platform. Details: jenkins/credentials.

#If it goes wrong

What you see Cause Fix
Platform job: The Helm values file says KIMS_ENVIRONMENT 'uat', but branch main deploys production. The other environment's file in this folder Upload the right file to this folder's kims-helm-values
image.tag is required (the commit SHA) Rendering by hand without --set image.tag=... Add it; Jenkins always sets it
The CMS host gives 503 or the ALB target group is unhealthy Missing target-type: ip or healthcheck-path Add the annotations, redeploy
Ingress has no address after 5 minutes No controller for that class, or the controller cannot find public subnets (kubernetes.io/role/elb tag) kubectl -n <NAMESPACE> describe ingress kims-cms, then KIMS's platform team
Pods Pending with exceeded quota Namespace ResourceQuota below the chart's needs (about 2 CPU and 4Gi requested, 7 CPU and 7Gi limits at a rollout) Ask KIMS to raise it

#Sources

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