apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    a8r.io/repository: ssh://git@git.tr1ceracop.de:222/gitea_admin/k8s-and-chill.git
  labels:
    app: forgejo
    app.kubernetes.io/instance: forgejo
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: forgejo
    app.kubernetes.io/version: 7.0.3
    helm.sh/chart: forgejo-6.1.0
    version: 7.0.3
  name: forgejo
  namespace: forgejo
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/instance: forgejo
      app.kubernetes.io/name: forgejo
  strategy:
    type: Recreate
  template:
    metadata:
      annotations:
        checksum/config: 5db583674387f2efbbeb9ed020a3fdff3f9f8cf129663421f38cbb6e20d720a8
      labels:
        app: forgejo
        app.kubernetes.io/instance: forgejo
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/name: forgejo
        app.kubernetes.io/version: 7.0.3
        helm.sh/chart: forgejo-6.1.0
        version: 7.0.3
    spec:
      containers:
        - env:
            - name: SSH_LISTEN_PORT
              value: "2222"
            - name: SSH_PORT
              value: "222"
            - name: GITEA_APP_INI
              value: /data/gitea/conf/app.ini
            - name: GITEA_CUSTOM
              value: /data/gitea
            - name: GITEA_WORK_DIR
              value: /data
            - name: GITEA_TEMP
              value: /tmp/gitea
            - name: TMPDIR
              value: /tmp/gitea
            - name: HOME
              value: /data/gitea/git
          image: codeberg.org/forgejo/forgejo:7.0.3-rootless
          imagePullPolicy: IfNotPresent
          livenessProbe:
            failureThreshold: 10
            initialDelaySeconds: 200
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: http
            timeoutSeconds: 1
          name: forgejo
          ports:
            - containerPort: 2222
              hostPort: 222
              name: ssh
            - containerPort: 3000
              name: http
          readinessProbe:
            failureThreshold: 3
            initialDelaySeconds: 5
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: http
            timeoutSeconds: 1
          resources: {}
          securityContext: {}
          volumeMounts:
            - mountPath: /tmp
              name: temp
            - mountPath: /data
              name: data
      initContainers:
        - command:
            - /usr/sbin/init_directory_structure.sh
          env:
            - name: GITEA_APP_INI
              value: /data/gitea/conf/app.ini
            - name: GITEA_CUSTOM
              value: /data/gitea
            - name: GITEA_WORK_DIR
              value: /data
            - name: GITEA_TEMP
              value: /tmp/gitea
          image: codeberg.org/forgejo/forgejo:7.0.3-rootless
          imagePullPolicy: IfNotPresent
          name: init-directories
          resources:
            limits: {}
            requests:
              cpu: 100m
              memory: 128Mi
          securityContext: {}
          volumeMounts:
            - mountPath: /usr/sbin
              name: init
            - mountPath: /tmp
              name: temp
            - mountPath: /data
              name: data
        - command:
            - /usr/sbin/config_environment.sh
          env:
            - name: GITEA_APP_INI
              value: /data/gitea/conf/app.ini
            - name: GITEA_CUSTOM
              value: /data/gitea
            - name: GITEA_WORK_DIR
              value: /data
            - name: GITEA_TEMP
              value: /tmp/gitea
            - name: FORGEJO__DATABASE__PASSWD
              valueFrom:
                secretKeyRef:
                  key: password
                  name: forgejo-cnpg-app
          image: codeberg.org/forgejo/forgejo:7.0.3-rootless
          imagePullPolicy: IfNotPresent
          name: init-app-ini
          resources:
            limits: {}
            requests:
              cpu: 100m
              memory: 128Mi
          securityContext: {}
          volumeMounts:
            - mountPath: /usr/sbin
              name: config
            - mountPath: /tmp
              name: temp
            - mountPath: /data
              name: data
            - mountPath: /env-to-ini-mounts/inlines/
              name: inline-config-sources
        - command:
            - /usr/sbin/configure_gitea.sh
          env:
            - name: GITEA_APP_INI
              value: /data/gitea/conf/app.ini
            - name: GITEA_CUSTOM
              value: /data/gitea
            - name: GITEA_WORK_DIR
              value: /data
            - name: GITEA_TEMP
              value: /tmp/gitea
            - name: HOME
              value: /data/gitea/git
            - name: GITEA_ADMIN_USERNAME
              valueFrom:
                secretKeyRef:
                  key: username
                  name: forgejo-admin-secret
            - name: GITEA_ADMIN_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: password
                  name: forgejo-admin-secret
          image: codeberg.org/forgejo/forgejo:7.0.3-rootless
          imagePullPolicy: IfNotPresent
          name: configure-gitea
          resources:
            limits: {}
            requests:
              cpu: 100m
              memory: 128Mi
          securityContext:
            runAsUser: 1000
          volumeMounts:
            - mountPath: /usr/sbin
              name: init
            - mountPath: /tmp
              name: temp
            - mountPath: /data
              name: data
      nodeSelector:
        kubernetes.io/hostname: ubuntu-4gb-nbg1-3
      securityContext:
        fsGroup: 1000
      terminationGracePeriodSeconds: 60
      volumes:
        - name: init
          secret:
            defaultMode: 110
            secretName: forgejo-init
        - name: config
          secret:
            defaultMode: 110
            secretName: forgejo
        - name: inline-config-sources
          secret:
            secretName: forgejo-inline-config
        - emptyDir: {}
          name: temp
        - name: data
          persistentVolumeClaim:
            claimName: forgejo-git-storage
