2021-05-15 17:02:51 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: {{ include "woodpecker-agent.fullname" . }}
|
|
|
|
labels:
|
|
|
|
{{- include "woodpecker-agent.labels" . | nindent 4 }}
|
|
|
|
spec:
|
|
|
|
replicas: {{ .Values.replicaCount }}
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
{{- include "woodpecker-agent.selectorLabels" . | nindent 6 }}
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
{{- with .Values.podAnnotations }}
|
|
|
|
annotations:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
labels:
|
|
|
|
{{- include "woodpecker-agent.selectorLabels" . | nindent 8 }}
|
|
|
|
spec:
|
2021-08-11 15:36:39 +00:00
|
|
|
{{- if and (semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion) (.Values.topologySpreadConstraints) }}
|
|
|
|
{{- with .Values.topologySpreadConstraints }}
|
|
|
|
topologySpreadConstraints:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2021-05-15 17:02:51 +00:00
|
|
|
{{- with .Values.imagePullSecrets }}
|
|
|
|
imagePullSecrets:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
serviceAccountName: {{ include "woodpecker-agent.serviceAccountName" . }}
|
|
|
|
securityContext:
|
|
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
|
|
containers:
|
|
|
|
- name: {{ .Chart.Name }}
|
|
|
|
securityContext:
|
|
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
|
|
ports:
|
|
|
|
- name: http
|
|
|
|
containerPort: 3000
|
|
|
|
protocol: TCP
|
|
|
|
resources:
|
|
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
|
|
volumeMounts:
|
|
|
|
- name: sock-dir
|
|
|
|
mountPath: /var/run
|
|
|
|
env:
|
|
|
|
{{- range $key, $value := .Values.env }}
|
|
|
|
- name: {{ $key }}
|
|
|
|
value: {{ $value | quote }}
|
|
|
|
{{- end }}
|
|
|
|
envFrom:
|
|
|
|
{{- range .Values.extraSecretNamesForEnvFrom }}
|
|
|
|
- secretRef:
|
|
|
|
name: {{ . }}
|
|
|
|
{{- end }}
|
|
|
|
- name: dind
|
2022-02-06 15:39:51 +00:00
|
|
|
image: {{ .Values.dind.image }}
|
2021-05-15 17:02:51 +00:00
|
|
|
env:
|
2022-02-06 15:39:51 +00:00
|
|
|
{{- range $key, $value := .Values.dind.env }}
|
|
|
|
- name: {{ $key }}
|
|
|
|
value: {{ $value | quote }}
|
|
|
|
{{- end }}
|
2021-05-15 17:02:51 +00:00
|
|
|
resources:
|
2022-02-06 15:39:51 +00:00
|
|
|
{{- toYaml .Values.dind.resources | nindent 12 }}
|
2021-05-15 17:02:51 +00:00
|
|
|
securityContext:
|
|
|
|
privileged: true
|
|
|
|
volumeMounts:
|
|
|
|
- name: sock-dir
|
|
|
|
mountPath: /var/run
|
|
|
|
{{- with .Values.nodeSelector }}
|
|
|
|
nodeSelector:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.affinity }}
|
|
|
|
affinity:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.tolerations }}
|
|
|
|
tolerations:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
volumes:
|
|
|
|
- name: sock-dir
|
|
|
|
emptyDir: {}
|