| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- apiVersion: apps/v1
- kind: StatefulSet
- metadata:
- labels:
- app: gogs-app
- name: gogs-app
- namespace: gogs
- spec:
- replicas: 1
- selector:
- matchLabels:
- app: gogs-app
- serviceName: gogs-app
- template:
- metadata:
- labels:
- app: gogs-app
- 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
- name: gogs-app
- resources: {}
- ports:
- - containerPort: 3000
- name: web
- protocol: TCP
- - containerPort: 22
- name: ssh
- protocol: TCP
- volumeMounts:
- - name: gogs-pv
- mountPath: /data
- imagePullSecrets:
- - name: reg-cred-secret
- dnsPolicy: ClusterFirst
- restartPolicy: Always
- terminationGracePeriodSeconds: 30
- volumeClaimTemplates:
- - metadata:
- name: gogs-pv
- spec:
- accessModes: [ "ReadWriteOnce" ]
- resources:
- requests:
- storage: 10Gi
|