-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathagent-deployment.yaml
75 lines (75 loc) · 2.55 KB
/
agent-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
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "dkron.fullname" . }}-agent
labels:
{{- include "dkron.agentLabels" . | nindent 4 }}
{{- with .Values.agent.deploymentAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.agent.autoscaling.enabled }}
replicas: {{ .Values.agent.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "dkron.agentSelectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
{{- with .Values.agent.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if eq .Values.image.pullPolicy "Always" }}
uuid: {{ uuidv4 }}
{{- end }}
labels:
{{- include "dkron.agentSelectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "dkron.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.agent.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.agent.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/bin/dkron"]
args:
- "agent"
- "--config=/etc/dkron/dkron.yaml"
- "--tag=\"type=scrapfly\""
- "--retry-join=\"provider=k8s label_selector=\"\"app.kubernetes.io/instance={{ .Release.Name }}\"\" namespace=\"\"{{ .Release.Namespace }}\"\"\""
- "--log-level={{ .Values.agent.log.level }}"
- "--tag=\"agent=true\""
{{- range .Values.agent.tags }}
- "--tag=\"{{ . }}\""
{{- end }}
ports:
- name: serf
containerPort: 8946
- name: grpc
containerPort: 6868
resources:
{{- toYaml .Values.agent.resources | nindent 12 }}
envFrom:
- configMapRef:
name: {{ include "dkron.fullname" . }}-envs
{{- with .Values.agent.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.agent.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.agent.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}