From 9f07d54dbb3a05470a3841494415c9491d0aa3a9 Mon Sep 17 00:00:00 2001 From: ckm007 Date: Mon, 10 Aug 2026 09:00:50 +0530 Subject: [PATCH 1/4] Use .Release.Namespace instead of a separate values.yaml namespace field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both charts had their own values.yaml `namespace` key, independently threaded through every template's `metadata.namespace`, completely disconnected from the `-n`/`--namespace` flag passed to `helm install`/`upgrade`. install.sh always kept these in sync by construction (same $NS var for `kubectl create ns` and `helm -n`), but anyone who edits $NS without also overriding `--set namespace=...` (or values.yaml) gets exactly what just happened on the live cluster: Helm's own release bookkeeping lives under the new namespace while every actual resource still targets the old (now-nonexistent) one, and the apply fails with "namespaces \"X\" not found" for every single resource. Other MOSIP module charts (e.g. kernel: `helm -n $NS install ... `, no values-file namespace field at all) don't have this problem because they use Helm's built-in `.Release.Namespace`, which is automatically and always exactly whatever `-n`/`--namespace` was passed — there is no second value that can drift out of sync. Match that pattern here: replace every `.Values.namespace` reference with `.Release.Namespace` across both charts' templates and drop the now-unused `namespace` key from both values.yaml files. install.sh needs no changes — it already passes `-n "$NS"` to `helm upgrade --install`, which is now the only thing that determines where resources land. Verified with the real kattu/mosip-helm-gh-pages toolchain (ct + yamale via uv, since pip/venv aren't available in this sandbox): - helm lint: clean - helm template --namespace nexus (a namespace other than the values.yaml default): every resource correctly follows it — this is the actual regression test for the bug this fixes - ct lint --validate-maintainers against the real chart-schema.yaml / lintconf.yaml: both charts pass - yamale against the real health-check-schema.yaml on rendered Deployment/StatefulSet manifests: both charts pass Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01A5KE4fZxHqbeiDaUJenSfU Signed-off-by: ckm007 --- MosipNexus/helm/nexus-server/README.md | 3 ++- .../helm/nexus-server/templates/NOTES.txt | 8 ++++---- .../templates/backup-cronjob.yaml | 8 ++++---- .../nexus-server/templates/backup-pvc.yaml | 2 +- .../nexus-server/templates/deployment.yaml | 2 +- .../helm/nexus-server/templates/hpa.yaml | 2 +- .../helm/nexus-server/templates/ingress.yaml | 2 +- .../templates/initial-ingest-job.yaml | 2 +- .../templates/postgres-configmap.yaml | 2 +- .../nexus-server/templates/postgres-pvc.yaml | 2 +- .../templates/postgres-service.yaml | 2 +- .../templates/postgres-statefulset.yaml | 2 +- .../templates/prometheusrule.yaml | 20 +++++++++---------- .../templates/service-account.yaml | 2 +- .../helm/nexus-server/templates/service.yaml | 2 +- .../templates/servicemonitor.yaml | 2 +- .../templates/updater-cronjob.yaml | 4 ++-- .../nexus-server/templates/updater-pvc.yaml | 2 +- .../templates/virtualservice.yaml | 2 +- MosipNexus/helm/nexus-server/values.yaml | 9 ++++----- MosipNexus/helm/nexus-ui/README.md | 3 ++- MosipNexus/helm/nexus-ui/templates/NOTES.txt | 6 +++--- .../helm/nexus-ui/templates/deployment.yaml | 2 +- .../helm/nexus-ui/templates/gateway.yaml | 2 +- .../helm/nexus-ui/templates/ingress.yaml | 2 +- .../nexus-ui/templates/service-account.yaml | 2 +- .../helm/nexus-ui/templates/service.yaml | 2 +- .../nexus-ui/templates/virtualservice.yaml | 4 ++-- MosipNexus/helm/nexus-ui/values.yaml | 7 ++++--- 29 files changed, 56 insertions(+), 54 deletions(-) diff --git a/MosipNexus/helm/nexus-server/README.md b/MosipNexus/helm/nexus-server/README.md index 4027110..4e6199e 100644 --- a/MosipNexus/helm/nexus-server/README.md +++ b/MosipNexus/helm/nexus-server/README.md @@ -97,9 +97,10 @@ mutually exclusive templates: ## Key parameters +Namespace isn't a chart parameter — every resource uses `.Release.Namespace`, so it's whatever namespace you pass to `helm install`/`upgrade -n ` (see [Installing](#installing)). + | Parameter | Default | Description | | --- | --- | --- | -| `namespace` | `mosip-nexus` | Namespace for all resources (create with `--create-namespace`) | | `storageClassName` | `""` (cluster default) | Default StorageClass for all three PVCs (postgres/updater/backup). Each PVC's own `*.storageClassName` overrides this individually | | `image.repository` / `image.tag` | `nexus-server` / `v1.0.0` | API + jobs image | | `api.workers` / `api.limitConcurrency` | `1` / `64` | uvicorn flags | diff --git a/MosipNexus/helm/nexus-server/templates/NOTES.txt b/MosipNexus/helm/nexus-server/templates/NOTES.txt index 1741e79..bfdf25d 100644 --- a/MosipNexus/helm/nexus-server/templates/NOTES.txt +++ b/MosipNexus/helm/nexus-server/templates/NOTES.txt @@ -1,4 +1,4 @@ -MOSIP Nexus Server ({{ .Chart.Name }} {{ .Chart.Version }}) has been installed into namespace "{{ .Values.namespace }}". +MOSIP Nexus Server ({{ .Chart.Name }} {{ .Chart.Version }}) has been installed into namespace "{{ .Release.Namespace }}". {{- if eq .Values.api.routing.mode "istio" }} @@ -13,18 +13,18 @@ Routing: nginx Ingress {{- if .Values.updater.enabled }} Trigger the first knowledge-base crawl now (don't wait for the nightly schedule): - kubectl create job --from=cronjob/nexus-updater nexus-updater-init -n {{ .Values.namespace }} + kubectl create job --from=cronjob/nexus-updater nexus-updater-init -n {{ .Release.Namespace }} {{- end }} {{- if .Values.initialIngest.enabled }} A one-time S3 vector-snapshot restore Job ("nexus-initial-ingest") ran as a post-install hook. Check its status: - kubectl get job nexus-initial-ingest -n {{ .Values.namespace }} + kubectl get job nexus-initial-ingest -n {{ .Release.Namespace }} {{- end }} Check health: - kubectl port-forward -n {{ .Values.namespace }} svc/nexus-api 8010:8000 + kubectl port-forward -n {{ .Release.Namespace }} svc/nexus-api 8010:8000 curl http://localhost:8010/health Next: install the helm/nexus-ui chart. diff --git a/MosipNexus/helm/nexus-server/templates/backup-cronjob.yaml b/MosipNexus/helm/nexus-server/templates/backup-cronjob.yaml index 113b799..1ac5841 100644 --- a/MosipNexus/helm/nexus-server/templates/backup-cronjob.yaml +++ b/MosipNexus/helm/nexus-server/templates/backup-cronjob.yaml @@ -1,14 +1,14 @@ {{- if .Values.backup.enabled }} # Restore from backup: -# POD=$(kubectl get pod -n {{ .Values.namespace }} -l app=nexus-postgres -o name | head -1) -# kubectl exec -n {{ .Values.namespace }} $POD -- pg_restore -U mosip -d mosipnexus /backups/nexus_.dump +# POD=$(kubectl get pod -n {{ .Release.Namespace }} -l app=nexus-postgres -o name | head -1) +# kubectl exec -n {{ .Release.Namespace }} $POD -- pg_restore -U mosip -d mosipnexus /backups/nexus_.dump # Trigger a manual backup: -# kubectl create job --from=cronjob/nexus-db-backup nexus-db-backup-manual -n {{ .Values.namespace }} +# kubectl create job --from=cronjob/nexus-db-backup nexus-db-backup-manual -n {{ .Release.Namespace }} apiVersion: batch/v1 kind: CronJob metadata: name: nexus-db-backup - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-db-backup" "ctx" $) | nindent 4 }} spec: schedule: {{ .Values.backup.schedule | quote }} diff --git a/MosipNexus/helm/nexus-server/templates/backup-pvc.yaml b/MosipNexus/helm/nexus-server/templates/backup-pvc.yaml index 9f87eb0..cb5857f 100644 --- a/MosipNexus/helm/nexus-server/templates/backup-pvc.yaml +++ b/MosipNexus/helm/nexus-server/templates/backup-pvc.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: nexus-db-backups - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-db-backup" "ctx" $) | nindent 4 }} spec: accessModes: {{- toYaml .Values.backup.pvc.accessModes | nindent 4 }} diff --git a/MosipNexus/helm/nexus-server/templates/deployment.yaml b/MosipNexus/helm/nexus-server/templates/deployment.yaml index 637dcb3..018e744 100644 --- a/MosipNexus/helm/nexus-server/templates/deployment.yaml +++ b/MosipNexus/helm/nexus-server/templates/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: nexus-api - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-api" "ctx" $) | nindent 4 }} annotations: {{- include "nexus-server.annotations" (dict "ctx" $) | nindent 4 }} spec: diff --git a/MosipNexus/helm/nexus-server/templates/hpa.yaml b/MosipNexus/helm/nexus-server/templates/hpa.yaml index 8e67b52..f7f6849 100644 --- a/MosipNexus/helm/nexus-server/templates/hpa.yaml +++ b/MosipNexus/helm/nexus-server/templates/hpa.yaml @@ -3,7 +3,7 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: nexus-api - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-api" "ctx" $) | nindent 4 }} spec: scaleTargetRef: diff --git a/MosipNexus/helm/nexus-server/templates/ingress.yaml b/MosipNexus/helm/nexus-server/templates/ingress.yaml index f5fa636..3691686 100644 --- a/MosipNexus/helm/nexus-server/templates/ingress.yaml +++ b/MosipNexus/helm/nexus-server/templates/ingress.yaml @@ -3,7 +3,7 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nexus-api - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-api" "ctx" $) | nindent 4 }} annotations: {{- toYaml .Values.api.routing.ingress.annotations | nindent 4 }} spec: diff --git a/MosipNexus/helm/nexus-server/templates/initial-ingest-job.yaml b/MosipNexus/helm/nexus-server/templates/initial-ingest-job.yaml index 99866b7..a6256de 100644 --- a/MosipNexus/helm/nexus-server/templates/initial-ingest-job.yaml +++ b/MosipNexus/helm/nexus-server/templates/initial-ingest-job.yaml @@ -18,7 +18,7 @@ apiVersion: batch/v1 kind: Job metadata: name: nexus-initial-ingest - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-initial-ingest" "ctx" $) | nindent 4 }} annotations: "helm.sh/hook": post-install diff --git a/MosipNexus/helm/nexus-server/templates/postgres-configmap.yaml b/MosipNexus/helm/nexus-server/templates/postgres-configmap.yaml index c218d62..2da4a1d 100644 --- a/MosipNexus/helm/nexus-server/templates/postgres-configmap.yaml +++ b/MosipNexus/helm/nexus-server/templates/postgres-configmap.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: postgres-init - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-postgres" "ctx" $) | nindent 4 }} data: init.sql: | diff --git a/MosipNexus/helm/nexus-server/templates/postgres-pvc.yaml b/MosipNexus/helm/nexus-server/templates/postgres-pvc.yaml index 982e4c9..40fc5df 100644 --- a/MosipNexus/helm/nexus-server/templates/postgres-pvc.yaml +++ b/MosipNexus/helm/nexus-server/templates/postgres-pvc.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: postgres-data - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-postgres" "ctx" $) | nindent 4 }} spec: accessModes: diff --git a/MosipNexus/helm/nexus-server/templates/postgres-service.yaml b/MosipNexus/helm/nexus-server/templates/postgres-service.yaml index 5183efc..056a440 100644 --- a/MosipNexus/helm/nexus-server/templates/postgres-service.yaml +++ b/MosipNexus/helm/nexus-server/templates/postgres-service.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: Service metadata: name: nexus-postgres - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-postgres" "ctx" $) | nindent 4 }} spec: selector: {{- include "nexus-server.selectorLabels" (dict "name" "nexus-postgres") | nindent 4 }} diff --git a/MosipNexus/helm/nexus-server/templates/postgres-statefulset.yaml b/MosipNexus/helm/nexus-server/templates/postgres-statefulset.yaml index 6c550b8..1a84891 100644 --- a/MosipNexus/helm/nexus-server/templates/postgres-statefulset.yaml +++ b/MosipNexus/helm/nexus-server/templates/postgres-statefulset.yaml @@ -3,7 +3,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: nexus-postgres - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-postgres" "ctx" $) | nindent 4 }} spec: serviceName: nexus-postgres diff --git a/MosipNexus/helm/nexus-server/templates/prometheusrule.yaml b/MosipNexus/helm/nexus-server/templates/prometheusrule.yaml index 7b5fcfd..7806bf2 100644 --- a/MosipNexus/helm/nexus-server/templates/prometheusrule.yaml +++ b/MosipNexus/helm/nexus-server/templates/prometheusrule.yaml @@ -3,7 +3,7 @@ apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: name: nexus-alerts - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-api" "ctx" $) | nindent 4 }} {{- if .Values.metrics.prometheusRule.additionalLabels }} {{- toYaml .Values.metrics.prometheusRule.additionalLabels | nindent 4 }} @@ -15,17 +15,17 @@ spec: rules: - alert: NexusUpdaterFailed expr: | - kube_job_failed{namespace="{{ .Values.namespace }}", job_name=~"nexus-updater-.*", condition=~"true|unknown"} > 0 + kube_job_failed{namespace="{{ .Release.Namespace }}", job_name=~"nexus-updater-.*", condition=~"true|unknown"} > 0 for: 5m labels: severity: critical annotations: summary: "nexus-updater CronJob failed" - description: "The nightly knowledge update job has failed. Check logs: kubectl logs -n {{ .Values.namespace }} job/{{ "{{ $labels.job_name }}" }}" + description: "The nightly knowledge update job has failed. Check logs: kubectl logs -n {{ .Release.Namespace }} job/{{ "{{ $labels.job_name }}" }}" - alert: NexusBackupFailed expr: | - kube_job_failed{namespace="{{ .Values.namespace }}", job_name=~"nexus-db-backup-.*", condition=~"true|unknown"} > 0 + kube_job_failed{namespace="{{ .Release.Namespace }}", job_name=~"nexus-db-backup-.*", condition=~"true|unknown"} > 0 for: 5m labels: severity: warning @@ -37,8 +37,8 @@ spec: rules: - alert: NexusApiHighMemory expr: | - container_memory_working_set_bytes{namespace="{{ .Values.namespace }}", container="nexus-api"} - / container_spec_memory_limit_bytes{namespace="{{ .Values.namespace }}", container="nexus-api"} + container_memory_working_set_bytes{namespace="{{ .Release.Namespace }}", container="nexus-api"} + / container_spec_memory_limit_bytes{namespace="{{ .Release.Namespace }}", container="nexus-api"} > 0.85 for: 10m labels: @@ -49,7 +49,7 @@ spec: - alert: NexusApiRestarting expr: | - increase(kube_pod_container_status_restarts_total{namespace="{{ .Values.namespace }}", container="nexus-api"}[1h]) > 2 + increase(kube_pod_container_status_restarts_total{namespace="{{ .Release.Namespace }}", container="nexus-api"}[1h]) > 2 for: 0m labels: severity: warning @@ -59,7 +59,7 @@ spec: - alert: NexusApiDown expr: | - kube_deployment_status_replicas_available{namespace="{{ .Values.namespace }}", deployment="nexus-api"} == 0 + kube_deployment_status_replicas_available{namespace="{{ .Release.Namespace }}", deployment="nexus-api"} == 0 for: 2m labels: severity: critical @@ -71,8 +71,8 @@ spec: rules: - alert: NexusPostgresDown expr: | - kube_deployment_status_replicas_available{namespace="{{ .Values.namespace }}", deployment="nexus-postgres"} == 0 - or kube_statefulset_status_replicas_ready{namespace="{{ .Values.namespace }}", statefulset="nexus-postgres"} == 0 + kube_deployment_status_replicas_available{namespace="{{ .Release.Namespace }}", deployment="nexus-postgres"} == 0 + or kube_statefulset_status_replicas_ready{namespace="{{ .Release.Namespace }}", statefulset="nexus-postgres"} == 0 for: 2m labels: severity: critical diff --git a/MosipNexus/helm/nexus-server/templates/service-account.yaml b/MosipNexus/helm/nexus-server/templates/service-account.yaml index 4594248..dd218d7 100644 --- a/MosipNexus/helm/nexus-server/templates/service-account.yaml +++ b/MosipNexus/helm/nexus-server/templates/service-account.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "nexus-server.serviceAccountName" . }} - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-api" "ctx" $) | nindent 4 }} annotations: {{- include "nexus-server.annotations" (dict "ctx" $) | nindent 4 }} {{- end }} diff --git a/MosipNexus/helm/nexus-server/templates/service.yaml b/MosipNexus/helm/nexus-server/templates/service.yaml index 23d87f3..901328e 100644 --- a/MosipNexus/helm/nexus-server/templates/service.yaml +++ b/MosipNexus/helm/nexus-server/templates/service.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: Service metadata: name: nexus-api - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-api" "ctx" $) | nindent 4 }} annotations: {{- include "nexus-server.annotations" (dict "ctx" $) | nindent 4 }} spec: diff --git a/MosipNexus/helm/nexus-server/templates/servicemonitor.yaml b/MosipNexus/helm/nexus-server/templates/servicemonitor.yaml index c336c95..94076f0 100644 --- a/MosipNexus/helm/nexus-server/templates/servicemonitor.yaml +++ b/MosipNexus/helm/nexus-server/templates/servicemonitor.yaml @@ -3,7 +3,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: nexus-api - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-api" "ctx" $) | nindent 4 }} {{- if .Values.metrics.serviceMonitor.additionalLabels }} {{- toYaml .Values.metrics.serviceMonitor.additionalLabels | nindent 4 }} diff --git a/MosipNexus/helm/nexus-server/templates/updater-cronjob.yaml b/MosipNexus/helm/nexus-server/templates/updater-cronjob.yaml index ed482c3..eb8f5b5 100644 --- a/MosipNexus/helm/nexus-server/templates/updater-cronjob.yaml +++ b/MosipNexus/helm/nexus-server/templates/updater-cronjob.yaml @@ -1,11 +1,11 @@ {{- if .Values.updater.enabled }} # Trigger a manual first run after install: -# kubectl create job --from=cronjob/nexus-updater nexus-updater-init -n {{ .Values.namespace }} +# kubectl create job --from=cronjob/nexus-updater nexus-updater-init -n {{ .Release.Namespace }} apiVersion: batch/v1 kind: CronJob metadata: name: nexus-updater - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-updater" "ctx" $) | nindent 4 }} spec: schedule: {{ .Values.updater.schedule | quote }} diff --git a/MosipNexus/helm/nexus-server/templates/updater-pvc.yaml b/MosipNexus/helm/nexus-server/templates/updater-pvc.yaml index ab04f96..07ce575 100644 --- a/MosipNexus/helm/nexus-server/templates/updater-pvc.yaml +++ b/MosipNexus/helm/nexus-server/templates/updater-pvc.yaml @@ -7,7 +7,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: nexus-data - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-updater" "ctx" $) | nindent 4 }} spec: accessModes: {{- toYaml .Values.updater.pvc.accessModes | nindent 4 }} diff --git a/MosipNexus/helm/nexus-server/templates/virtualservice.yaml b/MosipNexus/helm/nexus-server/templates/virtualservice.yaml index ea00d93..91f25c3 100644 --- a/MosipNexus/helm/nexus-server/templates/virtualservice.yaml +++ b/MosipNexus/helm/nexus-server/templates/virtualservice.yaml @@ -3,7 +3,7 @@ apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: nexus-api - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-server.labels" (dict "name" "nexus-api" "ctx" $) | nindent 4 }} annotations: {{- include "nexus-server.annotations" (dict "ctx" $) | nindent 4 }} spec: diff --git a/MosipNexus/helm/nexus-server/values.yaml b/MosipNexus/helm/nexus-server/values.yaml index 63696f7..e761b45 100644 --- a/MosipNexus/helm/nexus-server/values.yaml +++ b/MosipNexus/helm/nexus-server/values.yaml @@ -1,12 +1,11 @@ ## MOSIP Nexus Server — Helm values ## Faithful, values-driven equivalent of the raw manifests in ../../k8s/. ## See README.md for the full parameter reference. - -## Namespace this release's resources are created in. Helm does not manage -## the Namespace object itself (best practice) — create it with: -## helm install nexus-server . --namespace mosip-nexus --create-namespace ## -namespace: mosip-nexus +## Deployed into whatever namespace `helm install`/`upgrade -n ` targets — +## every template uses .Release.Namespace, not a separate values-driven +## namespace field, so there's exactly one place that decides where resources +## land (matching the pattern used by other MOSIP module charts, e.g. kernel). ## Default StorageClass for every PVC this chart creates (postgres, updater, ## backup). Leave "" to use the cluster's default StorageClass. Each PVC's own diff --git a/MosipNexus/helm/nexus-ui/README.md b/MosipNexus/helm/nexus-ui/README.md index 8ede21c..b800985 100644 --- a/MosipNexus/helm/nexus-ui/README.md +++ b/MosipNexus/helm/nexus-ui/README.md @@ -52,9 +52,10 @@ independently per chart if you need to: ## Key parameters +Namespace isn't a chart parameter — every resource uses `.Release.Namespace`, so install this into the same namespace as nexus-server (`-n `, same as it was installed with). + | Parameter | Default | Description | | --- | --- | --- | -| `namespace` | `mosip-nexus` | Must match the nexus-server release's namespace | | `image.repository` / `image.tag` | `nexus-ui` / `v1.0.0` | UI image | | `routing.mode` | `istio` | `istio` or `nginx` | | `routing.ingress.host` | `nexus.mosip.net` | Used when `routing.mode: nginx` | diff --git a/MosipNexus/helm/nexus-ui/templates/NOTES.txt b/MosipNexus/helm/nexus-ui/templates/NOTES.txt index bd7e51a..a38edfd 100644 --- a/MosipNexus/helm/nexus-ui/templates/NOTES.txt +++ b/MosipNexus/helm/nexus-ui/templates/NOTES.txt @@ -1,4 +1,4 @@ -MOSIP Nexus UI ({{ .Chart.Name }} {{ .Chart.Version }}) has been installed into namespace "{{ .Values.namespace }}". +MOSIP Nexus UI ({{ .Chart.Name }} {{ .Chart.Version }}) has been installed into namespace "{{ .Release.Namespace }}". {{- if eq .Values.routing.mode "istio" }} @@ -12,8 +12,8 @@ Routing: nginx Ingress The UI's nginx proxies same-origin /api/* to the "nexus-api" Service — make sure helm/nexus-server is installed in the same namespace -("{{ .Values.namespace }}") first. +("{{ .Release.Namespace }}") first. Check it's up: - kubectl port-forward -n {{ .Values.namespace }} svc/nexus-ui 8501:{{ .Values.service.port }} + kubectl port-forward -n {{ .Release.Namespace }} svc/nexus-ui 8501:{{ .Values.service.port }} curl http://localhost:8501/healthz diff --git a/MosipNexus/helm/nexus-ui/templates/deployment.yaml b/MosipNexus/helm/nexus-ui/templates/deployment.yaml index e31dcb9..13692bb 100644 --- a/MosipNexus/helm/nexus-ui/templates/deployment.yaml +++ b/MosipNexus/helm/nexus-ui/templates/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: nexus-ui - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-ui.labels" . | nindent 4 }} annotations: {{- include "nexus-ui.annotations" . | nindent 4 }} spec: diff --git a/MosipNexus/helm/nexus-ui/templates/gateway.yaml b/MosipNexus/helm/nexus-ui/templates/gateway.yaml index bda3c75..5f10272 100644 --- a/MosipNexus/helm/nexus-ui/templates/gateway.yaml +++ b/MosipNexus/helm/nexus-ui/templates/gateway.yaml @@ -6,7 +6,7 @@ apiVersion: networking.istio.io/v1 kind: Gateway metadata: name: nexus-ui - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-ui.labels" . | nindent 4 }} annotations: {{- include "nexus-ui.annotations" . | nindent 4 }} spec: diff --git a/MosipNexus/helm/nexus-ui/templates/ingress.yaml b/MosipNexus/helm/nexus-ui/templates/ingress.yaml index 1191f22..9af51ba 100644 --- a/MosipNexus/helm/nexus-ui/templates/ingress.yaml +++ b/MosipNexus/helm/nexus-ui/templates/ingress.yaml @@ -3,7 +3,7 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nexus-ui - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-ui.labels" . | nindent 4 }} annotations: {{- toYaml .Values.routing.ingress.annotations | nindent 4 }} spec: diff --git a/MosipNexus/helm/nexus-ui/templates/service-account.yaml b/MosipNexus/helm/nexus-ui/templates/service-account.yaml index 874c18d..133d6da 100644 --- a/MosipNexus/helm/nexus-ui/templates/service-account.yaml +++ b/MosipNexus/helm/nexus-ui/templates/service-account.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "nexus-ui.serviceAccountName" . }} - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-ui.labels" . | nindent 4 }} annotations: {{- include "nexus-ui.annotations" . | nindent 4 }} {{- end }} diff --git a/MosipNexus/helm/nexus-ui/templates/service.yaml b/MosipNexus/helm/nexus-ui/templates/service.yaml index 48dc560..0169fc3 100644 --- a/MosipNexus/helm/nexus-ui/templates/service.yaml +++ b/MosipNexus/helm/nexus-ui/templates/service.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: Service metadata: name: nexus-ui - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-ui.labels" . | nindent 4 }} annotations: {{- include "nexus-ui.annotations" . | nindent 4 }} spec: diff --git a/MosipNexus/helm/nexus-ui/templates/virtualservice.yaml b/MosipNexus/helm/nexus-ui/templates/virtualservice.yaml index 2d8f870..3de4e49 100644 --- a/MosipNexus/helm/nexus-ui/templates/virtualservice.yaml +++ b/MosipNexus/helm/nexus-ui/templates/virtualservice.yaml @@ -3,14 +3,14 @@ apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: nexus-ui - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "nexus-ui.labels" . | nindent 4 }} annotations: {{- include "nexus-ui.annotations" . | nindent 4 }} spec: hosts: {{- toYaml .Values.routing.istio.hosts | nindent 4 }} gateways: {{- if .Values.routing.istio.createGateway }} - - {{ .Values.namespace }}/nexus-ui + - {{ .Release.Namespace }}/nexus-ui {{- else }} - {{ .Values.routing.istio.gateway }} {{- end }} diff --git a/MosipNexus/helm/nexus-ui/values.yaml b/MosipNexus/helm/nexus-ui/values.yaml index 8523283..d7e3148 100644 --- a/MosipNexus/helm/nexus-ui/values.yaml +++ b/MosipNexus/helm/nexus-ui/values.yaml @@ -1,9 +1,10 @@ ## MOSIP Nexus UI — Helm values ## Faithful, values-driven equivalent of the raw manifests in ../../k8s/. ## Prerequisite: install helm/nexus-server first (same namespace) — the -## UI's nginx proxies same-origin /api/* to the "nexus-api" Service. - -namespace: mosip-nexus +## UI's nginx proxies same-origin /api/* to the "nexus-api" Service. Deployed +## into whatever namespace `helm install`/`upgrade -n ` targets — see +## nexus-server/README.md for why this chart uses .Release.Namespace instead +## of a separate values-driven namespace field. commonLabels: {} commonAnnotations: {} From 8868e6c113579ab9ad46e01ea281458c95327eb1 Mon Sep 17 00:00:00 2001 From: ckm007 Date: Mon, 10 Aug 2026 09:06:13 +0530 Subject: [PATCH 2/4] Bump chart versions to 1.0.1 so this fix actually gets published MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit install.sh pulls the chart from the published Helm repo (mosip.github.io/mosip-helm), not local chart source — republishing under the same 1.0.0 version number would be bad practice regardless (chart versions should be immutable once published; a 1.0.0 already exists in the repo), so this needs its own version for the .Release.Namespace fix to actually reach anyone. appVersion (the app image tag) is unchanged since no application code changed. install.sh's own CHART_VERSION default is intentionally left at 1.0.0 for now — pass CHART_VERSION=1.0.1 explicitly while still in dev/testing. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01A5KE4fZxHqbeiDaUJenSfU Signed-off-by: ckm007 --- MosipNexus/helm/nexus-server/Chart.yaml | 2 +- MosipNexus/helm/nexus-ui/Chart.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MosipNexus/helm/nexus-server/Chart.yaml b/MosipNexus/helm/nexus-server/Chart.yaml index 9d6dad9..6d2a6ff 100644 --- a/MosipNexus/helm/nexus-server/Chart.yaml +++ b/MosipNexus/helm/nexus-server/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: nexus-server description: Helm chart for the MOSIP Nexus Server (RAG API, crawlers, ingestion, MCP) type: application -version: 1.0.0 +version: 1.0.1 appVersion: "1.0.0" home: https://docs.mosip.io keywords: diff --git a/MosipNexus/helm/nexus-ui/Chart.yaml b/MosipNexus/helm/nexus-ui/Chart.yaml index e398112..473bb00 100644 --- a/MosipNexus/helm/nexus-ui/Chart.yaml +++ b/MosipNexus/helm/nexus-ui/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: nexus-ui description: Helm chart for the MOSIP Nexus UI (React + nginx) type: application -version: 1.0.0 +version: 1.0.1 appVersion: "1.0.0" home: https://docs.mosip.io keywords: From 1ce47ad354f1dc926ade3458ec081102b49c66dd Mon Sep 17 00:00:00 2001 From: Chandra Keshav Mishra Date: Mon, 10 Aug 2026 09:10:57 +0530 Subject: [PATCH 3/4] Downgrade version from 1.0.1 to 1.0.0 Signed-off-by: Chandra Keshav Mishra --- MosipNexus/helm/nexus-ui/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MosipNexus/helm/nexus-ui/Chart.yaml b/MosipNexus/helm/nexus-ui/Chart.yaml index 473bb00..e398112 100644 --- a/MosipNexus/helm/nexus-ui/Chart.yaml +++ b/MosipNexus/helm/nexus-ui/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: nexus-ui description: Helm chart for the MOSIP Nexus UI (React + nginx) type: application -version: 1.0.1 +version: 1.0.0 appVersion: "1.0.0" home: https://docs.mosip.io keywords: From 6ac70311b3abef8bd78a2f17bdafddf4eb18667e Mon Sep 17 00:00:00 2001 From: Chandra Keshav Mishra Date: Mon, 10 Aug 2026 09:11:41 +0530 Subject: [PATCH 4/4] Downgrade version from 1.0.1 to 1.0.0 Signed-off-by: Chandra Keshav Mishra --- MosipNexus/helm/nexus-server/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MosipNexus/helm/nexus-server/Chart.yaml b/MosipNexus/helm/nexus-server/Chart.yaml index 6d2a6ff..9d6dad9 100644 --- a/MosipNexus/helm/nexus-server/Chart.yaml +++ b/MosipNexus/helm/nexus-server/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: nexus-server description: Helm chart for the MOSIP Nexus Server (RAG API, crawlers, ingestion, MCP) type: application -version: 1.0.1 +version: 1.0.0 appVersion: "1.0.0" home: https://docs.mosip.io keywords: