Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{{- if .Values.server.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "woodpecker-ci.fullname" . }}-agent
labels:
woodpecker.component: "agent"
{{- include "woodpecker-ci.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.agent.replicas }}
selector:
matchLabels:
woodpecker.component: "agent"
{{- include "woodpecker-ci.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
woodpecker.component: "agent"
{{- include "woodpecker-ci.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "woodpecker-ci.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}-agent
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.agent.image.repository }}:{{ .Values.agent.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.agent.image.pullPolicy }}
env:
- name: WOODPECKER_SERVER
value: {{ include "woodpecker-ci.serverdns" . | quote }}
{{- range $key, $value := .Values.common.environment.variables }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- if .Values.common.environment.secrets }}
{{- range .Values.common.environment.secrets}}
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
- secretRef:
name: {{ . }}
{{- end }}
{{- end }}
{{- with .Values.agent.resources }}
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
ports:
- name: http
containerPort: 3000
protocol: TCP
volumeMounts:
- name: sock-dir
mountPath: /var/run
- name: {{ .Chart.Name }}-dind
image: {{ .Values.agent.dind.image }}
securityContext:
privileged: true
env:
- name: DOCKER_DRIVER
value: overlay2
volumeMounts:
- name: sock-dir
mountPath: /var/run
volumes:
- name: sock-dir
emptyDir: {}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}