-
Notifications
You must be signed in to change notification settings - Fork 146
/
agent.yaml
117 lines (117 loc) · 4.22 KB
/
agent.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{{- if .Values.agent.enabled }}
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: akri-agent-daemonset
spec:
selector:
matchLabels:
name: akri-agent
template:
metadata:
labels:
name: akri-agent
spec:
{{- /* hostNetwork is only needed for embedded ONVIF discovery */}}
{{- if .Values.agent.full }}
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
{{- end }}
{{- if .Values.agent.linuxOnly }}
nodeSelector:
"kubernetes.io/os": linux
{{- end }}
{{- if .Values.rbac.enabled }}
serviceAccountName: 'akri-agent-sa'
{{- end }}
containers:
- name: akri-agent
{{- $repository := ternary .Values.agent.image.fullRepository .Values.agent.image.repository .Values.agent.full -}}
{{- if .Values.useDevelopmentContainers }}
{{- if .Values.useLatestContainers }}
image: {{ printf "%s:%s" $repository (default "latest-dev" .Values.agent.image.tag) | quote }}
{{- else }}
image: {{ printf "%s:%s" $repository (default (printf "v%s-dev" .Chart.AppVersion) .Values.agent.image.tag) | quote }}
{{- end }}
{{- else }}
{{- if .Values.useLatestContainers }}
image: {{ printf "%s:%s" $repository (default "latest" .Values.agent.image.tag) | quote }}
{{- else }}
image: {{ printf "%s:%s" $repository (default (printf "v%s" .Chart.AppVersion) .Values.agent.image.tag) | quote }}
{{- end }}
{{- end }}
{{- with .Values.agent.image.pullPolicy }}
imagePullPolicy: {{ . }}
{{- end }}
resources:
requests:
memory: {{ .Values.agent.resources.memoryRequest }}
cpu: {{ .Values.agent.resources.cpuRequest }}
limits:
memory: {{ .Values.agent.resources.memoryLimit }}
cpu: {{ .Values.agent.resources.cpuLimit }}
{{- if .Values.agent.securityContext }}
securityContext:
{{- toYaml .Values.agent.securityContext | nindent 10 }}
{{- end}}
env:
{{- if .Values.agent.allowDebugEcho }}
- name: ENABLE_DEBUG_ECHO
value: "1"
{{- /* environment variable to tell the Agent's embedded debug echo Discovery Handler whether its instances are shared */}}
- name: DEBUG_ECHO_INSTANCES_SHARED
value: {{ .Values.debugEcho.configuration.shared | quote }}
{{- end }}
- name: HOST_CRICTL_PATH
value: /host/usr/bin/crictl
- name: HOST_RUNTIME_ENDPOINT
value: unix:///host/var/run/dockershim.sock
- name: HOST_IMAGE_ENDPOINT
value: unix:///host/var/run/dockershim.sock
- name: AGENT_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: DISCOVERY_HANDLERS_DIRECTORY
value: /var/lib/akri
volumeMounts:
- name: discovery-handlers
mountPath: /var/lib/akri
- name: device-plugin
mountPath: /var/lib/kubelet/device-plugins
- name: usr-bin-crictl
mountPath: /host/usr/bin/crictl
- name: var-run-dockershim
mountPath: /host/var/run/dockershim.sock
{{- if .Values.agent.host.udev }}
- name: devices
mountPath: /run/udev
{{- end }}
{{- if .Values.prometheus.enabled }}
ports:
- name: {{ .Values.prometheus.portName | quote }}
containerPort: {{ .Values.prometheus.port }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: discovery-handlers
hostPath:
path: {{ .Values.agent.host.discoveryHandlers }}
- name: device-plugin
hostPath:
path: "{{ .Values.agent.host.kubeletDevicePlugins }}"
- name: usr-bin-crictl
hostPath:
path: "{{ .Values.agent.host.crictl }}"
- name: var-run-dockershim
hostPath:
path: "{{ .Values.agent.host.dockerShimSock }}"
{{- if .Values.agent.host.udev }}
- name: devices
hostPath:
path: "{{ .Values.agent.host.udev }}"
{{- end }}
{{- end }}