Helm charts for Metallb
[demo.git] / vnfs / DAaaS / deploy / 00-init / metallb / templates / controller.yaml
1 apiVersion: apps/v1
2 kind: Deployment
3 metadata:
4   name: {{ template "metallb.fullname" . }}-controller
5   labels:
6     heritage: {{ .Release.Service | quote }}
7     release: {{ .Release.Name | quote }}
8     chart: {{ template "metallb.chart" . }}
9     app: {{ template "metallb.name" . }}
10     component: controller
11 spec:
12   revisionHistoryLimit: 3
13   selector:
14     matchLabels:
15       app: {{ template "metallb.name" . }}
16       component: controller
17       release: {{ .Release.Name | quote }}
18   template:
19     metadata:
20       labels:
21         heritage: {{ .Release.Service | quote }}
22         release: {{ .Release.Name | quote }}
23         chart: {{ template "metallb.chart" . }}
24         app: {{ template "metallb.name" . }}
25         component: controller
26 {{- if .Values.prometheus.scrapeAnnotations }}
27       annotations:
28         prometheus.io/scrape: "true"
29         prometheus.io/port: "7472"
30 {{- end }}
31     spec:
32       serviceAccountName: {{ template "metallb.controllerServiceAccountName" . }}
33       terminationGracePeriodSeconds: 0
34       securityContext:
35         runAsNonRoot: true
36         runAsUser: 65534 # nobody
37       nodeSelector:
38         "beta.kubernetes.io/os": linux
39         {{- with .Values.controller.nodeSelector }}
40 {{ toYaml . | indent 8 }}
41     {{- end }}
42     {{- with .Values.controller.tolerations }}
43       tolerations:
44 {{ toYaml . | indent 8 }}
45     {{- end }}
46     {{- with .Values.controller.affinity }}
47       affinity:
48 {{ toYaml . | indent 8 }}
49     {{- end }}
50       containers:
51       - name: controller
52         image: {{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag }}
53         imagePullPolicy: {{ .Values.controller.image.pullPolicy }}
54         args:
55         - --port=7472
56         - --config={{ template "metallb.configMapName" . }}
57         ports:
58         - name: monitoring
59           containerPort: 7472
60         resources:
61 {{ toYaml .Values.controller.resources | indent 10 }}
62         securityContext:
63           allowPrivilegeEscalation: false
64           capabilities:
65             drop:
66             - all
67           readOnlyRootFilesystem: true