apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "forgejo-runner.fullname" . }} labels: {{- include "forgejo-runner.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "forgejo-runner.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "forgejo-runner.labels" . | nindent 8 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "forgejo-runner.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} initContainers: - name: make-config-writeable {{- with .Values.image }} image: "{{ coalesce $.Values.global.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}" imagePullPolicy: {{ coalesce $.Values.global.image.pullPolicy .pullPolicy }} {{- end }} command: [ "/bin/cp", "/etc/runner/.runner", "/data/.runner" ] resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: - name: runner-data mountPath: /data - name: runner-config mountPath: /etc/runner containers: - name: runner securityContext: {{- toYaml .Values.securityContext | nindent 12 }} {{- with .Values.image }} image: "{{ coalesce $.Values.global.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}" imagePullPolicy: {{ coalesce $.Values.global.image.pullPolicy .pullPolicy }} {{- end }} command: - "sh" - "-c" - | while ! nc -z 127.0.0.1 2376