Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion MosipNexus/helm/nexus-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <ns>` (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 |
Expand Down
8 changes: 4 additions & 4 deletions MosipNexus/helm/nexus-server/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -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" }}

Expand All @@ -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.
8 changes: 4 additions & 4 deletions MosipNexus/helm/nexus-server/templates/backup-cronjob.yaml
Original file line number Diff line number Diff line change
@@ -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_<DATE>.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_<DATE>.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 }}
Expand Down
2 changes: 1 addition & 1 deletion MosipNexus/helm/nexus-server/templates/backup-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion MosipNexus/helm/nexus-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion MosipNexus/helm/nexus-server/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion MosipNexus/helm/nexus-server/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion MosipNexus/helm/nexus-server/templates/postgres-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions MosipNexus/helm/nexus-server/templates/prometheusrule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion MosipNexus/helm/nexus-server/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion MosipNexus/helm/nexus-server/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions MosipNexus/helm/nexus-server/templates/updater-cronjob.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion MosipNexus/helm/nexus-server/templates/updater-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nexus-data
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
Comment thread
ckm007 marked this conversation as resolved.
labels: {{- include "nexus-server.labels" (dict "name" "nexus-updater" "ctx" $) | nindent 4 }}
spec:
accessModes: {{- toYaml .Values.updater.pvc.accessModes | nindent 4 }}
Expand Down
2 changes: 1 addition & 1 deletion MosipNexus/helm/nexus-server/templates/virtualservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 4 additions & 5 deletions MosipNexus/helm/nexus-server/values.yaml
Original file line number Diff line number Diff line change
@@ -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 <ns>` 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).
Comment thread
ckm007 marked this conversation as resolved.

## Default StorageClass for every PVC this chart creates (postgres, updater,
## backup). Leave "" to use the cluster's default StorageClass. Each PVC's own
Expand Down
3 changes: 2 additions & 1 deletion MosipNexus/helm/nexus-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <ns>`, 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` |
Expand Down
6 changes: 3 additions & 3 deletions MosipNexus/helm/nexus-ui/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -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" }}

Expand All @@ -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
2 changes: 1 addition & 1 deletion MosipNexus/helm/nexus-ui/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion MosipNexus/helm/nexus-ui/templates/gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion MosipNexus/helm/nexus-ui/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion MosipNexus/helm/nexus-ui/templates/service-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion MosipNexus/helm/nexus-ui/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions MosipNexus/helm/nexus-ui/templates/virtualservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
7 changes: 4 additions & 3 deletions MosipNexus/helm/nexus-ui/values.yaml
Original file line number Diff line number Diff line change
@@ -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 <ns>` targets — see
## nexus-server/README.md for why this chart uses .Release.Namespace instead
## of a separate values-driven namespace field.

commonLabels: {}
commonAnnotations: {}
Expand Down
Loading