From 380c1832459cb0ecddc67ff14a2cfc5b55d0bbd1 Mon Sep 17 00:00:00 2001 From: Caleb Lloyd <2414837+caleblloyd@users.noreply.github.com> Date: Thu, 17 Aug 2023 09:54:31 -0400 Subject: [PATCH] [nats helm] always use emptyDir for pidfile volume (#782) * [nats helm] always use emptyDir for pidfile volume Signed-off-by: Caleb Lloyd * relese 1.0.2 Signed-off-by: Caleb Lloyd --------- Signed-off-by: Caleb Lloyd --- helm/charts/nats/Chart.yaml | 2 +- helm/charts/nats/files/config/config.yaml | 3 +-- helm/charts/nats/files/stateful-set/nats-container.yaml | 5 +---- helm/charts/nats/files/stateful-set/pod-template.yaml | 2 -- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/helm/charts/nats/Chart.yaml b/helm/charts/nats/Chart.yaml index 93309af0..3cfbf8a8 100644 --- a/helm/charts/nats/Chart.yaml +++ b/helm/charts/nats/Chart.yaml @@ -6,7 +6,7 @@ keywords: - nats - messaging - cncf -version: 1.0.1 +version: 1.0.2 home: http://github.com/nats-io/k8s maintainers: - email: info@nats.io diff --git a/helm/charts/nats/files/config/config.yaml b/helm/charts/nats/files/config/config.yaml index cc1849a8..92fd96f1 100644 --- a/helm/charts/nats/files/config/config.yaml +++ b/helm/charts/nats/files/config/config.yaml @@ -1,10 +1,9 @@ -{{- $pidFile := ternary "/var/run/nats/nats.pid" "/var/run/nats.pid" .Values.reloader.enabled }} {{- with .Values.config }} server_name: << $SERVER_NAME >> lame_duck_grace_period: 10s lame_duck_duration: 30s -pid_file: {{ $pidFile }} +pid_file: /var/run/nats/nats.pid ######################################## # NATS diff --git a/helm/charts/nats/files/stateful-set/nats-container.yaml b/helm/charts/nats/files/stateful-set/nats-container.yaml index b89d20e0..01191432 100644 --- a/helm/charts/nats/files/stateful-set/nats-container.yaml +++ b/helm/charts/nats/files/stateful-set/nats-container.yaml @@ -1,4 +1,3 @@ -{{- $pidFile := ternary "/var/run/nats/nats.pid" "/var/run/nats.pid" .Values.reloader.enabled }} name: nats {{ include "nats.image" (merge (pick $.Values "global") .Values.container.image) }} @@ -32,7 +31,7 @@ lifecycle: # send the lame duck shutdown signal to trigger a graceful shutdown command: - nats-server - - -sl=ldm={{ $pidFile }} + - -sl=ldm=/var/run/nats/nats.pid {{- if .Values.config.monitor.enabled }} startupProbe: @@ -69,10 +68,8 @@ volumeMounts: - name: config mountPath: /etc/nats-config # PID volume -{{- if .Values.reloader.enabled }} - name: pid mountPath: /var/run/nats -{{- end}} # JetStream PVC {{- with .Values.config.jetstream }} {{- if and .enabled .fileStore.enabled .fileStore.pvc.enabled }} diff --git a/helm/charts/nats/files/stateful-set/pod-template.yaml b/helm/charts/nats/files/stateful-set/pod-template.yaml index afff14ed..9aa84f0a 100644 --- a/helm/charts/nats/files/stateful-set/pod-template.yaml +++ b/helm/charts/nats/files/stateful-set/pod-template.yaml @@ -45,10 +45,8 @@ spec: configMap: name: {{ .Values.configMap.name }} # PID volume - {{- if .Values.reloader.enabled }} - name: pid emptyDir: {} - {{- end }} # tlsCA {{- include "nats.tlsCAVolume" $ | nindent 2 }} # secrets