apiVersion: apps/v1 kind: Deployment metadata: name: gitea namespace: gitea spec: replicas: 1 selector: matchLabels: app: gitea template: metadata: labels: app: gitea spec: hostname: gitea subdomain: gitea nodeName: hb-wide-1 containers: - name: gitea image: gitea/gitea:1.19.3 ports: - containerPort: 3000 lifecycle: postStart: exec: command: ["sh", "-c", "sleep 1 && su git -c 'sh /admin-creator.sh'"] env: - name: GITEA__database__DB_TYPE value: "postgres" - name: GITEA__database__HOST value: "gitea.gitea.svc.cluster.local:5432" - name: GITEA__database__NAME value: "gitea" - name: GITEA__database__SSL_MODE value: "require" - name: GITEA__database__USER valueFrom: secretKeyRef: name: gitea.gitea.credentials.postgresql.acid.zalan.do key: username - name: GITEA__database__PASSWD valueFrom: secretKeyRef: name: gitea.gitea.credentials.postgresql.acid.zalan.do key: password - name: GITEA__server__LFS_JWT_SECRET valueFrom: secretKeyRef: name: gitea-lfs-jwt-secret key: token - name: GITEA__security__INTERNAL_TOKEN valueFrom: secretKeyRef: name: gitea-internal-token key: token - name: ADMIN_USER valueFrom: secretKeyRef: name: gitea-admin-user key: token - name: ADMIN_PASSWORD valueFrom: secretKeyRef: name: gitea-admin-password key: token - name: ADMIN_MAIL valueFrom: secretKeyRef: name: gitea-admin-mail key: token envFrom: - configMapRef: name: gitea-config volumeMounts: - mountPath: "/admin-creator.sh" name: gitea-admin-creator subPath: admin-creator.sh volumes: - name: gitea-pv hostPath: path: "/mnt/gitea" - name: gitea-config-volume configMap: name: gitea-config - name: gitea-admin-creator configMap: name: gitea-admin-creator