
### Description of the change This pr add quotes to values for _nodeSelector_ entries. This is needed if the value is a _boolean_. An example is using [Spot VMs](https://cloud.google.com/kubernetes-engine/docs/concepts/spot-vms) on _GCP_: ```` apiVersion: v1 kind: Pod spec: nodeSelector: cloud.google.com/gke-spot: "true" ```` Currently, the Chart uses the _toYaml_ function when adding the _nodeSelector_ values, however, _toYaml_ does not quote the values as discussed [here](https://github.com/helm/helm/issues/4262). The same issue, for ingress configurations, was discussed in [this issue](https://gitea.com/gitea/helm-chart/issues/483), and fixed in [this PR](https://gitea.com/gitea/helm-chart/pulls/497). ### Benefits Allows the usage of _boolean_ values for _nodeSelectors_. ### Possible drawbacks None known. Co-authored-by: tobias.petersen <tobias.petersen@unity3d.com> Co-authored-by: pat-s <pat-s@noreply.gitea.com> Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/796 Reviewed-by: pat-s <pat-s@noreply.gitea.com> Co-authored-by: tobiasbp <tobiasbp@noreply.gitea.com> Co-committed-by: tobiasbp <tobiasbp@noreply.gitea.com>
130 lines
4.8 KiB
YAML
130 lines
4.8 KiB
YAML
{{- if .Values.actions.enabled }}
|
|
{{- $secretName := include "gitea.workername" (dict "global" . "worker" "actions-token") }}
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
labels:
|
|
{{- include "gitea.labels.actRunner" . | nindent 4 }}
|
|
{{- with .Values.actions.statefulset.labels }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
annotations:
|
|
{{- with .Values.actions.statefulset.annotations }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
name: {{ include "gitea.fullname" . }}-act-runner
|
|
namespace: {{ .Values.namespace | default .Release.Namespace }}
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
{{- include "gitea.selectorLabels.actRunner" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
checksum/config: {{ include (print $.Template.BasePath "/gitea/act_runner/config-act-runner.yaml") . | sha256sum }}
|
|
labels:
|
|
{{- include "gitea.labels.actRunner" . | nindent 8 }}
|
|
{{- with .Values.actions.statefulset.labels }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
initContainers:
|
|
- name: init-gitea
|
|
image: "{{ .Values.actions.init.image.repository }}:{{ .Values.actions.init.image.tag }}"
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
while ! nc -z {{ include "gitea.fullname" . }}-http {{ .Values.service.http.port }}; do
|
|
sleep 5
|
|
done
|
|
containers:
|
|
- name: act-runner
|
|
image: "{{ .Values.actions.statefulset.actRunner.repository }}:{{ .Values.actions.statefulset.actRunner.tag }}"
|
|
imagePullPolicy: {{ .Values.actions.statefulset.actRunner.pullPolicy }}
|
|
workingDir: /data
|
|
env:
|
|
- name: DOCKER_HOST
|
|
value: tcp://127.0.0.1:2376
|
|
- name: DOCKER_TLS_VERIFY
|
|
value: "1"
|
|
- name: DOCKER_CERT_PATH
|
|
value: /certs/server
|
|
- name: GITEA_RUNNER_REGISTRATION_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: "{{ .Values.actions.existingSecret | default $secretName }}"
|
|
key: "{{ .Values.actions.existingSecretKey | default "token" }}"
|
|
- name: GITEA_INSTANCE_URL
|
|
value: {{ include "gitea.act_runner.local_root_url" . }}
|
|
- name: CONFIG_FILE
|
|
value: /actrunner/config.yaml
|
|
resources:
|
|
{{- toYaml .Values.actions.statefulset.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- mountPath: /actrunner/config.yaml
|
|
name: act-runner-config
|
|
subPath: config.yaml
|
|
- mountPath: /certs/server
|
|
name: docker-certs
|
|
- mountPath: /data
|
|
name: data-act-runner
|
|
{{- with .Values.actions.statefulset.actRunner.extraVolumeMounts }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
- name: dind
|
|
image: "{{ .Values.actions.statefulset.dind.repository }}:{{ .Values.actions.statefulset.dind.tag }}"
|
|
imagePullPolicy: {{ .Values.actions.statefulset.dind.pullPolicy }}
|
|
env:
|
|
- name: DOCKER_HOST
|
|
value: tcp://127.0.0.1:2376
|
|
- name: DOCKER_TLS_VERIFY
|
|
value: "1"
|
|
- name: DOCKER_CERT_PATH
|
|
value: /certs/server
|
|
{{- if .Values.actions.statefulset.dind.extraEnvs }}
|
|
{{- toYaml .Values.actions.statefulset.dind.extraEnvs | nindent 12 }}
|
|
{{- end }}
|
|
securityContext:
|
|
privileged: true
|
|
resources:
|
|
{{- toYaml .Values.actions.statefulset.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- mountPath: /certs/server
|
|
name: docker-certs
|
|
{{- with .Values.actions.statefulset.dind.extraVolumeMounts }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- range $key, $value := .Values.actions.statefulset.nodeSelector }}
|
|
nodeSelector:
|
|
{{ $key }}: {{ $value | quote }}
|
|
{{- end }}
|
|
{{- with .Values.actions.statefulset.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.actions.statefulset.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: act-runner-config
|
|
configMap:
|
|
name: {{ include "gitea.fullname" . }}-act-runner-config
|
|
- name: docker-certs
|
|
emptyDir: {}
|
|
{{- with .Values.actions.statefulset.extraVolumes }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: data-act-runner
|
|
spec:
|
|
accessModes: [ "ReadWriteOnce" ]
|
|
{{- include "gitea.persistence.storageClass" . | nindent 8 }}
|
|
resources:
|
|
requests:
|
|
storage: 1Mi
|
|
{{- end }}
|