Browse Source

Init container

Tino 1 tháng trước cách đây
mục cha
commit
91a44438af
1 tập tin đã thay đổi với 10 bổ sung và 0 xóa
  1. 10 0
      gogs-statefulset.yaml

+ 10 - 0
gogs-statefulset.yaml

@@ -18,6 +18,16 @@ spec:
     spec:
       securityContext:
         fsGroup: 1000     # <--- Esto solucionará el fallo de "permission denied"
+      initContainers:
+      - name: fix-logs
+        image: gogs/gogs
+        imagePullPolicy: IfNotPresent
+        command: ["sh", "-c", "mkdir -p /app/gogs/log && chown -R 1000:1000 /app/gogs/log"]
+        securityContext:
+          runAsUser: 0
+        volumeMounts:
+        - name: gogs-pv
+          mountPath: /data
       containers:
       - image: gogs/gogs
         imagePullPolicy: IfNotPresent