From b97743670f68ab5f8220297933d91e8265e2d169 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 20:12:09 -0700 Subject: [PATCH 01/18] Add NATS via Helm pattern --- .github/workflows/deploy-nats.yml | 62 ------------------------------- charts/app/Chart.yaml | 3 ++ charts/app/values.yaml | 31 +++++++++++++++- 3 files changed, 33 insertions(+), 63 deletions(-) delete mode 100644 .github/workflows/deploy-nats.yml diff --git a/.github/workflows/deploy-nats.yml b/.github/workflows/deploy-nats.yml deleted file mode 100644 index 6f60ce0b5..000000000 --- a/.github/workflows/deploy-nats.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Deploy NATS to OpenShift - -on: - pull_request: - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up OpenShift CLI - uses: redhat-actions/oc-login@v1 - with: - openshift_server_url: ${{ vars.OC_SERVER }} - openshift_token: ${{ secrets.OC_TOKEN }} - namespace: ${{ vars.OC_NAMESPACE }} - - - name: Add NATS Helm repo - run: helm repo add nats https://nats-io.github.io/k8s/helm/charts/ - - - name: Check if NATS release exists - id: check_release - run: | - RELEASE_NAME=${{ github.event.repository.name }}-${{ github.event.number }}-nats - if helm list -q | grep -q $RELEASE_NAME; then - echo "Release $RELEASE_NAME already exists. Skipping install." - echo "release_exists=true" >> $GITHUB_ENV - else - echo "Release $RELEASE_NAME does not exist. Proceeding with install." - echo "release_exists=false" >> $GITHUB_ENV - fi - - name: Deploy NATS using Helm - if: env.release_exists == 'false' - run: | - helm install ${{ github.event.repository.name }}-${{ github.event.number }}-nats nats/nats \ - --set config.jetstream.enabled=true \ - --set config.jetstream.fileStore.pvc.size=200Mi \ - --set config.jetstream.memoryStore.enabled=true \ - --set config.jetstream.memoryStore.maxSize=250Mi \ - --set cluster.enabled=true \ - --set natsBox.enabled=false \ - --set persistence.enabled=true \ - --set persistence.size=200Mi \ - --set container.merge.resources.requests.cpu=25m \ - --set container.merge.resources.limits.cpu=100m \ - --set container.merge.resources.requests.memory=50Mi \ - --set container.merge.resources.limits.memory=250Mi \ - --set reloader.enabled=false \ - --set replicaCount=1 - - - name: Label NATS Deployment - run: | - RELEASE_NAME=${{ github.event.repository.name }}-${{ github.event.number }}-nats - oc label statefulset $RELEASE_NAME app=${{ github.event.repository.name }}-${{ github.event.number }} - - name: Label NATS PVCs - run: | - RELEASE_NAME=${{ github.event.repository.name }}-${{ github.event.number }}-nats - for pvc in $(oc get pvc -l release=$RELEASE_NAME -o name); do - oc label $pvc app=${{ github.event.repository.name }}-${{ github.event.number }} - done diff --git a/charts/app/Chart.yaml b/charts/app/Chart.yaml index 8662d4109..374ba8279 100644 --- a/charts/app/Chart.yaml +++ b/charts/app/Chart.yaml @@ -30,6 +30,9 @@ dependencies: version: 15.5.13 repository: https://charts.bitnami.com/bitnami alias: bitnami-pg + - name: nats + version: 0.8.0 + repository: "https://nats-io.github.io/k8s/helm/charts" maintainers: - name: Om Mishra email: omprakash.2.mishra@gov.bc.ca diff --git a/charts/app/values.yaml b/charts/app/values.yaml index 94ef7f62f..0cc759d8b 100644 --- a/charts/app/values.yaml +++ b/charts/app/values.yaml @@ -352,7 +352,36 @@ backup: cpu: 20m memory: 128Mi -#-- the components of the application, backend. +# Deploys JetStream +nats: + enabled: true + replicaCount: 1 + resources: + requests: + cpu: 100m + memory: 100Mi + limits: + cpu: 200m + memory: 400Mi + jetstream: + enabled: true + fileStore: + pvc: + size: 200Mi + memoryStore: + enabled: true + maxSize: 250Mi + cluster: + enabled: true + natsBox: + enabled: false + persistence: + enabled: true + size: 200Mi + reloader: + enabled: false + +#-- WebEOC Container webeoc: #-- enable or disable backend enabled: true From e5b79367ee6935198bf590a7fccaa83f8565084f Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 20:16:57 -0700 Subject: [PATCH 02/18] Update main.ts --- backend/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main.ts b/backend/src/main.ts index e72cf0cdb..1a4fd1193 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -20,7 +20,7 @@ async function bootstrap() { const config = new DocumentBuilder() .setTitle("Compliance and Enforcement - Complaint Management API") .setDescription("The Complicance and Enforcement - Complaint Management API") - .setVersion("1.0") + .setVersion("1.0.0") .addTag("Compliance and Enforcement - Complaint Management") .build(); From 199c7af9b89d6a84eb62bf287392acee4a31febe Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 20:22:16 -0700 Subject: [PATCH 03/18] NATS Helm --- backend/src/main.ts | 2 +- charts/app/values.yaml | 31 ++++++++++++++++--------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/backend/src/main.ts b/backend/src/main.ts index 1a4fd1193..e72cf0cdb 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -20,7 +20,7 @@ async function bootstrap() { const config = new DocumentBuilder() .setTitle("Compliance and Enforcement - Complaint Management API") .setDescription("The Complicance and Enforcement - Complaint Management API") - .setVersion("1.0.0") + .setVersion("1.0") .addTag("Compliance and Enforcement - Complaint Management") .build(); diff --git a/charts/app/values.yaml b/charts/app/values.yaml index 0cc759d8b..1e11053da 100644 --- a/charts/app/values.yaml +++ b/charts/app/values.yaml @@ -355,22 +355,23 @@ backup: # Deploys JetStream nats: enabled: true - replicaCount: 1 - resources: - requests: - cpu: 100m - memory: 100Mi - limits: - cpu: 200m - memory: 400Mi - jetstream: - enabled: true - fileStore: - pvc: - size: 200Mi - memoryStore: + nats: + replicaCount: 1 + resources: + requests: + cpu: 100m + memory: 100Mi + limits: + cpu: 200m + memory: 400Mi + jetstream: enabled: true - maxSize: 250Mi + fileStore: + pvc: + size: 200Mi + memoryStore: + enabled: true + maxSize: 250Mi cluster: enabled: true natsBox: From a0857458106efae151768fdcf47992c20c3dd160 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 20:26:22 -0700 Subject: [PATCH 04/18] NATS Helm --- backend/src/main.ts | 2 +- charts/app/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main.ts b/backend/src/main.ts index e72cf0cdb..1a4fd1193 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -20,7 +20,7 @@ async function bootstrap() { const config = new DocumentBuilder() .setTitle("Compliance and Enforcement - Complaint Management API") .setDescription("The Complicance and Enforcement - Complaint Management API") - .setVersion("1.0") + .setVersion("1.0.0") .addTag("Compliance and Enforcement - Complaint Management") .build(); diff --git a/charts/app/values.yaml b/charts/app/values.yaml index 1e11053da..9d753a679 100644 --- a/charts/app/values.yaml +++ b/charts/app/values.yaml @@ -355,7 +355,7 @@ backup: # Deploys JetStream nats: enabled: true - nats: + config: replicaCount: 1 resources: requests: From 157b10b68caf99bef2c6b3199be09d2b1ad331ea Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 20:32:56 -0700 Subject: [PATCH 05/18] Nats Helm --- backend/src/main.ts | 2 +- charts/app/Chart.yaml | 4 ++-- charts/app/values.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/main.ts b/backend/src/main.ts index 1a4fd1193..e72cf0cdb 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -20,7 +20,7 @@ async function bootstrap() { const config = new DocumentBuilder() .setTitle("Compliance and Enforcement - Complaint Management API") .setDescription("The Complicance and Enforcement - Complaint Management API") - .setVersion("1.0.0") + .setVersion("1.0") .addTag("Compliance and Enforcement - Complaint Management") .build(); diff --git a/charts/app/Chart.yaml b/charts/app/Chart.yaml index 374ba8279..6a0755800 100644 --- a/charts/app/Chart.yaml +++ b/charts/app/Chart.yaml @@ -31,8 +31,8 @@ dependencies: repository: https://charts.bitnami.com/bitnami alias: bitnami-pg - name: nats - version: 0.8.0 - repository: "https://nats-io.github.io/k8s/helm/charts" + version: 0.18.0 + repository: "https://nats-io.github.io/k8s/helm/charts/" maintainers: - name: Om Mishra email: omprakash.2.mishra@gov.bc.ca diff --git a/charts/app/values.yaml b/charts/app/values.yaml index 9d753a679..1e11053da 100644 --- a/charts/app/values.yaml +++ b/charts/app/values.yaml @@ -355,7 +355,7 @@ backup: # Deploys JetStream nats: enabled: true - config: + nats: replicaCount: 1 resources: requests: From 2d8531b4359fca17410a0d9550dce7d64a15e8ce Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 20:35:20 -0700 Subject: [PATCH 06/18] Update main.ts --- backend/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main.ts b/backend/src/main.ts index e72cf0cdb..1a4fd1193 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -20,7 +20,7 @@ async function bootstrap() { const config = new DocumentBuilder() .setTitle("Compliance and Enforcement - Complaint Management API") .setDescription("The Complicance and Enforcement - Complaint Management API") - .setVersion("1.0") + .setVersion("1.0.0") .addTag("Compliance and Enforcement - Complaint Management") .build(); From 448812b5e49fb4f2f3001812e0c64ed53e59221c Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 20:43:40 -0700 Subject: [PATCH 07/18] nats helm --- backend/src/main.ts | 2 +- charts/app/templates/{knp.yaml => knp.back} | 0 charts/app/templates/service-lb.yaml | 15 +++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) rename charts/app/templates/{knp.yaml => knp.back} (100%) create mode 100644 charts/app/templates/service-lb.yaml diff --git a/backend/src/main.ts b/backend/src/main.ts index 1a4fd1193..e72cf0cdb 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -20,7 +20,7 @@ async function bootstrap() { const config = new DocumentBuilder() .setTitle("Compliance and Enforcement - Complaint Management API") .setDescription("The Complicance and Enforcement - Complaint Management API") - .setVersion("1.0.0") + .setVersion("1.0") .addTag("Compliance and Enforcement - Complaint Management") .build(); diff --git a/charts/app/templates/knp.yaml b/charts/app/templates/knp.back similarity index 100% rename from charts/app/templates/knp.yaml rename to charts/app/templates/knp.back diff --git a/charts/app/templates/service-lb.yaml b/charts/app/templates/service-lb.yaml new file mode 100644 index 000000000..59fe0e0e9 --- /dev/null +++ b/charts/app/templates/service-lb.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "mynats.fullname" . }}-lb + labels: + {{- include "mynats.labels" . | nindent 4 }} +spec: + type: LoadBalancer + selector: + {{- include "nats.selectorLabels" .Subcharts.nats | nindent 4 }} + ports: + - name: nats + port: 4222 + protocol: TCP + targetPort: 4222 \ No newline at end of file From 186a0278af6170c20b27b218fddd06f02b3f028b Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 20:50:58 -0700 Subject: [PATCH 08/18] Update index.tsx --- frontend/src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index c0299cec5..19440e2ba 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -35,5 +35,5 @@ UserService.initKeycloak(onAuthenticatedCallback); // If you want to start measuring performance in your app, pass a function // to log results (for example: reportWebVitals(console.log)) -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals +// Or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals reportWebVitals(); From 225b46c6e772b6d3918e01633d4ee32e307e2265 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 20:58:41 -0700 Subject: [PATCH 09/18] nats helm --- charts/app/templates/nats/service.yaml | 13 +++++++++++++ charts/app/templates/service-lb.yaml | 15 --------------- frontend/src/index.tsx | 2 +- 3 files changed, 14 insertions(+), 16 deletions(-) create mode 100644 charts/app/templates/nats/service.yaml delete mode 100644 charts/app/templates/service-lb.yaml diff --git a/charts/app/templates/nats/service.yaml b/charts/app/templates/nats/service.yaml new file mode 100644 index 000000000..a2709ae19 --- /dev/null +++ b/charts/app/templates/nats/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: { { include "nats.fullname" . } } + labels: { { - include "nats.labels" . | nindent 4 } } +spec: + type: LoadBalancer + selector: { { - include "nats.selectorLabels" .Subcharts.nats | nindent 4 } } + ports: + - name: nats + port: 4222 + protocol: TCP + targetPort: 4222 diff --git a/charts/app/templates/service-lb.yaml b/charts/app/templates/service-lb.yaml deleted file mode 100644 index 59fe0e0e9..000000000 --- a/charts/app/templates/service-lb.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "mynats.fullname" . }}-lb - labels: - {{- include "mynats.labels" . | nindent 4 }} -spec: - type: LoadBalancer - selector: - {{- include "nats.selectorLabels" .Subcharts.nats | nindent 4 }} - ports: - - name: nats - port: 4222 - protocol: TCP - targetPort: 4222 \ No newline at end of file diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index 19440e2ba..3bfd26148 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -35,5 +35,5 @@ UserService.initKeycloak(onAuthenticatedCallback); // If you want to start measuring performance in your app, pass a function // to log results (for example: reportWebVitals(console.log)) -// Or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals +// OR send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals reportWebVitals(); From d9721fc39a246b620c3881630245e6398a35667d Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 21:00:03 -0700 Subject: [PATCH 10/18] fixing paths --- charts/app/templates/nats/{ => templates}/service.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename charts/app/templates/nats/{ => templates}/service.yaml (100%) diff --git a/charts/app/templates/nats/service.yaml b/charts/app/templates/nats/templates/service.yaml similarity index 100% rename from charts/app/templates/nats/service.yaml rename to charts/app/templates/nats/templates/service.yaml From 44b07e075e979e19f20308ffe4917a625a995288 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 21:06:11 -0700 Subject: [PATCH 11/18] Create _helpers.tpl --- .../app/templates/nats/templates/_helpers.tpl | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 charts/app/templates/nats/templates/_helpers.tpl diff --git a/charts/app/templates/nats/templates/_helpers.tpl b/charts/app/templates/nats/templates/_helpers.tpl new file mode 100644 index 000000000..38439764b --- /dev/null +++ b/charts/app/templates/nats/templates/_helpers.tpl @@ -0,0 +1,42 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "nats.name" -}} +{{- printf "nats" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "nats.fullname" -}} +{{- $componentName := include "nats.name" . }} +{{- if .Values.nats.fullnameOverride }} +{{- .Values.nats.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $componentName | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "nats.labels" -}} +{{ include "nats.selectorLabels" . }} +{{- if .Values.global.tag }} +app.kubernetes.io/image-version: {{ .Values.global.tag | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kubernetes.io/short-name: {{ include "nats.name" . }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "nats.selectorLabels" -}} +app.kubernetes.io/name: {{ include "nats.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + + From 5718004abff05fbd2b341b62cb4137525cf25c2c Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 21:10:29 -0700 Subject: [PATCH 12/18] Update service.yaml --- charts/app/templates/nats/templates/service.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/charts/app/templates/nats/templates/service.yaml b/charts/app/templates/nats/templates/service.yaml index a2709ae19..cdc1becc1 100644 --- a/charts/app/templates/nats/templates/service.yaml +++ b/charts/app/templates/nats/templates/service.yaml @@ -1,13 +1,18 @@ +{{- if .Values.nats.enabled }} +--- apiVersion: v1 kind: Service metadata: - name: { { include "nats.fullname" . } } - labels: { { - include "nats.labels" . | nindent 4 } } + name: {{ include "webeoc.fullname" . }} + labels: + {{- include "webeoc.labels" . | nindent 4 }} spec: type: LoadBalancer - selector: { { - include "nats.selectorLabels" .Subcharts.nats | nindent 4 } } + selector: + {{- include "nats.selectorLabels" .Subcharts.nats | nindent 4 }} ports: - name: nats port: 4222 protocol: TCP targetPort: 4222 +{{- end }} \ No newline at end of file From e783075f926a985e0bf4dfa9271a439896a9117b Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 21:20:56 -0700 Subject: [PATCH 13/18] nats pvc --- charts/app/templates/nats/templates/pvc.yaml | 14 ++++++++++++++ charts/app/templates/nats/templates/service.yaml | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 charts/app/templates/nats/templates/pvc.yaml diff --git a/charts/app/templates/nats/templates/pvc.yaml b/charts/app/templates/nats/templates/pvc.yaml new file mode 100644 index 000000000..be549bec6 --- /dev/null +++ b/charts/app/templates/nats/templates/pvc.yaml @@ -0,0 +1,14 @@ +{{- if .Values.nats.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "nats.fullname" . }}-pvc + labels: + {{- include "nats.labels" . | nindent 4 }} +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.nats.nats.jetstream.fileStore.pvc.size }} +{{- end }} \ No newline at end of file diff --git a/charts/app/templates/nats/templates/service.yaml b/charts/app/templates/nats/templates/service.yaml index cdc1becc1..5bccb9a01 100644 --- a/charts/app/templates/nats/templates/service.yaml +++ b/charts/app/templates/nats/templates/service.yaml @@ -3,9 +3,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "webeoc.fullname" . }} + name: {{ include "nats.fullname" . }} labels: - {{- include "webeoc.labels" . | nindent 4 }} + {{- include "nats.labels" . | nindent 4 }} spec: type: LoadBalancer selector: From d67bc6e02c4ca984cc7d9d555f090fa74350b286 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 21:25:05 -0700 Subject: [PATCH 14/18] nats helm --- charts/app/templates/nats/templates/pvc.yaml | 2 +- charts/app/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/app/templates/nats/templates/pvc.yaml b/charts/app/templates/nats/templates/pvc.yaml index be549bec6..303a0882e 100644 --- a/charts/app/templates/nats/templates/pvc.yaml +++ b/charts/app/templates/nats/templates/pvc.yaml @@ -10,5 +10,5 @@ spec: - ReadWriteOnce resources: requests: - storage: {{ .Values.nats.nats.jetstream.fileStore.pvc.size }} + storage: {{ .Values.nats.config.jetstream.fileStore.pvc.size }} {{- end }} \ No newline at end of file diff --git a/charts/app/values.yaml b/charts/app/values.yaml index 1e11053da..9d753a679 100644 --- a/charts/app/values.yaml +++ b/charts/app/values.yaml @@ -355,7 +355,7 @@ backup: # Deploys JetStream nats: enabled: true - nats: + config: replicaCount: 1 resources: requests: From 4ae96bd2d63ec6763c274d6dc8e04b285720ca8b Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 21:33:39 -0700 Subject: [PATCH 15/18] Update service.yaml --- charts/app/templates/nats/templates/service.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/app/templates/nats/templates/service.yaml b/charts/app/templates/nats/templates/service.yaml index 5bccb9a01..7a21f3437 100644 --- a/charts/app/templates/nats/templates/service.yaml +++ b/charts/app/templates/nats/templates/service.yaml @@ -7,9 +7,9 @@ metadata: labels: {{- include "nats.labels" . | nindent 4 }} spec: - type: LoadBalancer + type: ClusterIP selector: - {{- include "nats.selectorLabels" .Subcharts.nats | nindent 4 }} + {{- include "nats.selectorLabels" . | nindent 4 }} ports: - name: nats port: 4222 From d492a8b683f95906d675f3f49c9142f413319d70 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 21:56:17 -0700 Subject: [PATCH 16/18] Helm test --- .../templates/{_helpers.tpl => _helpers.btpl} | 0 .../nats/templates/{pvc.yaml => pvc.back} | 0 .../templates/{service.yaml => service.back} | 2 +- charts/app/values.yaml | 19 ++++++++++--------- 4 files changed, 11 insertions(+), 10 deletions(-) rename charts/app/templates/nats/templates/{_helpers.tpl => _helpers.btpl} (100%) rename charts/app/templates/nats/templates/{pvc.yaml => pvc.back} (100%) rename charts/app/templates/nats/templates/{service.yaml => service.back} (87%) diff --git a/charts/app/templates/nats/templates/_helpers.tpl b/charts/app/templates/nats/templates/_helpers.btpl similarity index 100% rename from charts/app/templates/nats/templates/_helpers.tpl rename to charts/app/templates/nats/templates/_helpers.btpl diff --git a/charts/app/templates/nats/templates/pvc.yaml b/charts/app/templates/nats/templates/pvc.back similarity index 100% rename from charts/app/templates/nats/templates/pvc.yaml rename to charts/app/templates/nats/templates/pvc.back diff --git a/charts/app/templates/nats/templates/service.yaml b/charts/app/templates/nats/templates/service.back similarity index 87% rename from charts/app/templates/nats/templates/service.yaml rename to charts/app/templates/nats/templates/service.back index 7a21f3437..9c6158a52 100644 --- a/charts/app/templates/nats/templates/service.yaml +++ b/charts/app/templates/nats/templates/service.back @@ -3,7 +3,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "nats.fullname" . }} + name: {{ include "nats.fullname" . }}-nats labels: {{- include "nats.labels" . | nindent 4 }} spec: diff --git a/charts/app/values.yaml b/charts/app/values.yaml index 9d753a679..ed9c0d0a0 100644 --- a/charts/app/values.yaml +++ b/charts/app/values.yaml @@ -372,15 +372,16 @@ nats: memoryStore: enabled: true maxSize: 250Mi - cluster: - enabled: true - natsBox: - enabled: false - persistence: - enabled: true - size: 200Mi - reloader: - enabled: false + nats: + cluster: + enabled: true + natsBox: + enabled: false + persistence: + enabled: true + size: 200Mi + reloader: + enabled: false #-- WebEOC Container webeoc: From 9b18bc7d0a9c9bfae1bd090dfdafe91eecef1575 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 22:04:02 -0700 Subject: [PATCH 17/18] nats updates --- .../templates/nats/templates/_helpers.btpl | 42 ------------------- charts/app/templates/nats/templates/pvc.back | 14 ------- .../app/templates/nats/templates/service.back | 18 -------- 3 files changed, 74 deletions(-) delete mode 100644 charts/app/templates/nats/templates/_helpers.btpl delete mode 100644 charts/app/templates/nats/templates/pvc.back delete mode 100644 charts/app/templates/nats/templates/service.back diff --git a/charts/app/templates/nats/templates/_helpers.btpl b/charts/app/templates/nats/templates/_helpers.btpl deleted file mode 100644 index 38439764b..000000000 --- a/charts/app/templates/nats/templates/_helpers.btpl +++ /dev/null @@ -1,42 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "nats.name" -}} -{{- printf "nats" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "nats.fullname" -}} -{{- $componentName := include "nats.name" . }} -{{- if .Values.nats.fullnameOverride }} -{{- .Values.nats.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $componentName | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "nats.labels" -}} -{{ include "nats.selectorLabels" . }} -{{- if .Values.global.tag }} -app.kubernetes.io/image-version: {{ .Values.global.tag | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -app.kubernetes.io/short-name: {{ include "nats.name" . }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "nats.selectorLabels" -}} -app.kubernetes.io/name: {{ include "nats.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - - diff --git a/charts/app/templates/nats/templates/pvc.back b/charts/app/templates/nats/templates/pvc.back deleted file mode 100644 index 303a0882e..000000000 --- a/charts/app/templates/nats/templates/pvc.back +++ /dev/null @@ -1,14 +0,0 @@ -{{- if .Values.nats.enabled }} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ include "nats.fullname" . }}-pvc - labels: - {{- include "nats.labels" . | nindent 4 }} -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: {{ .Values.nats.config.jetstream.fileStore.pvc.size }} -{{- end }} \ No newline at end of file diff --git a/charts/app/templates/nats/templates/service.back b/charts/app/templates/nats/templates/service.back deleted file mode 100644 index 9c6158a52..000000000 --- a/charts/app/templates/nats/templates/service.back +++ /dev/null @@ -1,18 +0,0 @@ -{{- if .Values.nats.enabled }} ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ include "nats.fullname" . }}-nats - labels: - {{- include "nats.labels" . | nindent 4 }} -spec: - type: ClusterIP - selector: - {{- include "nats.selectorLabels" . | nindent 4 }} - ports: - - name: nats - port: 4222 - protocol: TCP - targetPort: 4222 -{{- end }} \ No newline at end of file From 0e3f2db85538d6783edfdafe435059497b34d5bb Mon Sep 17 00:00:00 2001 From: barrfalk Date: Tue, 16 Jul 2024 22:14:27 -0700 Subject: [PATCH 18/18] helm version upgrade --- charts/app/Chart.yaml | 2 +- charts/app/values.yaml | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/charts/app/Chart.yaml b/charts/app/Chart.yaml index 6a0755800..23173d974 100644 --- a/charts/app/Chart.yaml +++ b/charts/app/Chart.yaml @@ -31,7 +31,7 @@ dependencies: repository: https://charts.bitnami.com/bitnami alias: bitnami-pg - name: nats - version: 0.18.0 + version: 1.1.12 repository: "https://nats-io.github.io/k8s/helm/charts/" maintainers: - name: Om Mishra diff --git a/charts/app/values.yaml b/charts/app/values.yaml index ed9c0d0a0..9d753a679 100644 --- a/charts/app/values.yaml +++ b/charts/app/values.yaml @@ -372,16 +372,15 @@ nats: memoryStore: enabled: true maxSize: 250Mi - nats: - cluster: - enabled: true - natsBox: - enabled: false - persistence: - enabled: true - size: 200Mi - reloader: - enabled: false + cluster: + enabled: true + natsBox: + enabled: false + persistence: + enabled: true + size: 200Mi + reloader: + enabled: false #-- WebEOC Container webeoc: