apiVersion: apps/v1
kind: Deployment
metadata:
  name: gitea-act-runner-dind
spec:
  replicas: 1
  selector:
    matchLabels:
      app: gitea-act-runner-dind
  template:
    metadata:
      labels:
        app: gitea-act-runner-dind
    spec:
      containers:
      - name: runner
        image: vegardit/gitea-act-runner:dind-latest
        securityContext:
          privileged: true
        env:
        - name: GITEA_INSTANCE_URL
          value: "http://gitea.italiadatacenter.com"
        - name: GITEA_RUNNER_REGISTRATION_TOKEN
          valueFrom:
            secretKeyRef:
              name: gitea-runner-secret
              key: registration-token
        volumeMounts:
        - name: data
          mountPath: /data
        - name: docker-storage
          mountPath: /var/lib/docker
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: gitea-runner-data-pvc
      - name: docker-storage
        emptyDir: {}
---
---
apiVersion: v1
kind: Secret
metadata:
  name: gitea-runner-secret
type: Opaque
stringData:
  registration-token: "Yx9aGssgXzcsoX75KOpFY1OliQz5cO9bTR0tuo4Z"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: gitea-runner-pvc
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi