Factory/akri-chart/templates/onvif-discovery-handler.yaml
Nicolas Belouin 18bd432874 Import first batch of Edge 3.1 packages
Signed-off-by: Nicolas Belouin <nicolas.belouin@suse.com>
2024-10-17 14:11:42 +02:00

79 lines
3.0 KiB
YAML

{{- if .Values.onvif.discovery.enabled }}
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: akri-onvif-discovery-daemonset
annotations:
akri.sh/discoveryHandlerName: onvif
labels: {{- include "akri.labels" . | nindent 4 }}
app.kubernetes.io/name: akri-onvif-discovery
app.kubernetes.io/component: discovery-handler
spec:
selector:
matchLabels: {{- include "akri.selectorLabels" . | nindent 6 }}
app.kubernetes.io/name: akri-onvif-discovery
template:
metadata:
labels: {{- include "akri.labels" . | nindent 8 }}
app.kubernetes.io/name: akri-onvif-discovery
app.kubernetes.io/component: discovery-handler
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: akri-onvif-discovery
{{- if .Values.useDevelopmentContainers }}
{{- if .Values.useLatestContainers }}
image: {{ printf "%s:%s" .Values.onvif.discovery.image.repository (default "latest-dev" .Values.onvif.discovery.image.tag) | quote }}
{{- else }}
image: {{ printf "%s:%s" .Values.onvif.discovery.image.repository (default (printf "v%s-dev" .Chart.AppVersion) .Values.onvif.discovery.image.tag) | quote }}
{{- end }}
{{- else }}
{{- if .Values.useLatestContainers }}
image: {{ printf "%s:%s" .Values.onvif.discovery.image.repository (default "latest" .Values.onvif.discovery.image.tag) | quote }}
{{- else }}
image: {{ printf "%s:%s" .Values.onvif.discovery.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.onvif.discovery.image.tag) | quote }}
{{- end }}
{{- end }}
{{- with .Values.onvif.discovery.image.pullPolicy }}
imagePullPolicy: {{ . }}
{{- end}}
resources:
requests:
memory: {{ .Values.onvif.discovery.resources.memoryRequest }}
cpu: {{ .Values.onvif.discovery.resources.cpuRequest }}
limits:
memory: {{ .Values.onvif.discovery.resources.memoryLimit }}
cpu: {{ .Values.onvif.discovery.resources.cpuLimit }}
{{- if .Values.onvif.discovery.useNetworkConnection }}
ports:
- name: discovery
containerPort: {{ .Values.onvif.discovery.port }}
{{- end }}
env:
{{- if .Values.onvif.discovery.useNetworkConnection }}
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
{{- end }}
- name: DISCOVERY_HANDLERS_DIRECTORY
value: /var/lib/akri
volumeMounts:
- name: discovery-handlers
mountPath: /var/lib/akri
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
nodeSelector:
"kubernetes.io/os": linux
{{- if .Values.onvif.discovery.nodeSelectors }}
{{- toYaml .Values.onvif.discovery.nodeSelectors | nindent 8 }}
{{- end }}
volumes:
- name: discovery-handlers
hostPath:
path: {{ .Values.agent.host.discoveryHandlers }}
{{- end }}