-
Notifications
You must be signed in to change notification settings - Fork 48
/
deployment.yaml
79 lines (79 loc) · 2.38 KB
/
deployment.yaml
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
45
46
47
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "devops-agent.fullname" . }}
labels:
{{ include "devops-agent.labels" . | indent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "devops-agent.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "devops-agent.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: dind-storage
emptyDir: {}
- name: trivy-cache
hostPath:
path: /var/trivy/Library/Caches
type: DirectoryOrCreate
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
env:
- name: DOCKER_HOST
value: tcp://localhost:2375
- name: AZP_URL
value: "{{ .Values.azdevops.azpUrl }}"
- name: AZP_TOKEN
value: "{{ .Values.azdevops.azpToken }}"
- name: AZP_POOL
value: "{{ .Values.azdevops.azpPool }}"
- name: AZP_AGENT_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: trivy-cache
mountPath: /root/.cache
securityContext:
privileged: true
resources:
{{- toYaml .Values.resources | nindent 12 }}
- name: dind
image: "{{ .Values.docker.image.repository }}:{{ .Values.docker.image.tag }}"
securityContext:
privileged: true
env:
- name: DOCKER_TLS_CERTDIR
value: ''
volumeMounts:
- name: dind-storage
mountPath: /var/lib/docker
resources:
requests:
memory: "128Mi"
cpu: "250m"
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}