From 9bd7f0330183f462a5fe69a1df4ba962262a80fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Wed, 16 Mar 2022 01:27:38 +0900 Subject: [PATCH] Use initContainers to fix the permissions --- k8s.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/k8s.yaml b/k8s.yaml index e87a20e..30cccc9 100644 --- a/k8s.yaml +++ b/k8s.yaml @@ -18,6 +18,18 @@ spec: runAsUser: 1001 imagePullSecrets: - name: registry-auth + initContainers: + - name: init-dir + image: alpine:latest + command: + - chown + - 1001:1001 + - /app/cache + securityContext: + runAsNonRoot: false + volumeMounts: + - name: cache + mountPath: "/app/cache" containers: - name: web image: registry.k8s.astropenguin.net/astrojs:2022.03.15.04 @@ -56,7 +68,7 @@ spec: accessModes: [ "ReadWriteOnce" ] resources: requests: - storage: 10Gi + storage: 1Gi storageClassName: local-storage ---