kind: Deployment
apiVersion: apps/v1
metadata:
  namespace: gitea
  name: gitea
  labels:
    app.kubernetes.io/name: gitea
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: gitea
  template:
    metadata:
      labels:
        app.kubernetes.io/name: gitea
    spec:
      containers:
        - name: gitea
          image: "gitea/gitea:1.11.3"
          ports:
            - name: http
              containerPort: 3000
            - name: ssh
              containerPort: 22
          env:
            - name: DB_TYPE
              value: "postgres"
            - name: DB_HOST
              valueFrom:
                secretKeyRef:
                  name: gitea-creds-secret
                  key: db-host
            - name: DB_NAME
              valueFrom:
                secretKeyRef:
                  name: gitea-creds-secret
                  key: db-name
            - name: DB_USER
              valueFrom:
                secretKeyRef:
                  name: gitea-creds-secret
                  key: db-user
            - name: DB_PASSWD
              valueFrom:
                secretKeyRef:
                  name: gitea-creds-secret
                  key: db-passwd
            - name: RUN_MODE
              value: "prod"
            - name: SSH_DOMAIN
              value: "git.rascal.local"
            - name: DISABLE_REGISTRATION
              value: "true"
            - name: REQUIRE_SIGNIN_VIEW
              value: "true"
            - name: USER_UID
              value: "1024"
            - name: USER_GID
              value: "100"
          resources:
            requests:
              cpu: 25m
              memory: 256Mi
            limits:
              cpu: 1000m
              memory: 1Gi
          volumeMounts:
          - name: gitea-data
            mountPath: /data
      nodeSelector:
        "kubernetes.io/arch": "amd64"
      volumes:
      - name: gitea-data
        persistentVolumeClaim:
          claimName: gitea-data-pvc
      dnsConfig:
        options:
        - name: ndots
          value: "1"
