From 7e14c6328ae20af3f82836ccceb4112383721d0b Mon Sep 17 00:00:00 2001 From: Friedrich Wilken Date: Thu, 15 Feb 2024 20:06:23 +0100 Subject: [PATCH] change owner via init container --- resources/nats/templates/statefulset.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/resources/nats/templates/statefulset.yaml b/resources/nats/templates/statefulset.yaml index 9d5e4bd2..15930d60 100644 --- a/resources/nats/templates/statefulset.yaml +++ b/resources/nats/templates/statefulset.yaml @@ -94,6 +94,26 @@ spec: # reload to the server without restarting the pod. shareProcessNamespace: true + initContainers: + - name: fix-permissions-config-volume + image: busybox + command: ["sh", "-c", "chown -R 1000:10001 /etc/nats-config"] + volumeMounts: + - name: config-volume + mountPath: /etc/nats-config + - name: fix-permissions-pid + image: busybox + command: ["sh", "-c", "chown -R 1000:10001 /var/run/nats"] + volumeMounts: + - name: pid + mountPath: /var/run/nats + - name: fix-permissions-accounts-volume + image: busybox + command: ["sh", "-c", "chown -R 1000:10001 /etc/nats-config/accounts"] + volumeMounts: + - name: accounts-volume + mountPath: /etc/nats-config/accounts + ################# # # # NATS Server #