summaryrefslogtreecommitdiffstats
path: root/deployments/helm/servicemesh/metallb/templates/controller.yaml
blob: f993ca32c8f1dceb588af56f4a8e9df29ec4c5e2 (plain)
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
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template "metallb.fullname" . }}-controller
  labels:
    heritage: {{ .Release.Service | quote }}
    release: {{ .Release.Name | quote }}
    chart: {{ template "metallb.chart" . }}
    app: {{ template "metallb.name" . }}
    component: controller
spec:
  revisionHistoryLimit: 3
  selector:
    matchLabels:
      app: {{ template "metallb.name" . }}
      component: controller
      release: {{ .Release.Name | quote }}
  template:
    metadata:
      labels:
        heritage: {{ .Release.Service | quote }}
        release: {{ .Release.Name | quote }}
        chart: {{ template "metallb.chart" . }}
        app: {{ template "metallb.name" . }}
        component: controller
{{- if .Values.prometheus.scrapeAnnotations }}
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "7472"
{{- end }}
    spec:
      serviceAccountName: {{ template "metallb.controllerServiceAccountName" . }}
      terminationGracePeriodSeconds: 0
      securityContext:
        runAsNonRoot: true
        runAsUser: 65534 # nobody
      nodeSelector:
        "beta.kubernetes.io/os": linux
        {{- with .Values.controller.nodeSelector }}
{{ toYaml . | indent 8 }}
    {{- end }}
    {{- with .Values.controller.tolerations }}
      tolerations:
{{ toYaml . | indent 8 }}
    {{- end }}
    {{- with .Values.controller.affinity }}
      affinity:
{{ toYaml . | indent 8 }}
    {{- end }}
      containers:
      - name: controller
        image: {{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag }}
        imagePullPolicy: {{ .Values.controller.image.pullPolicy }}
        args:
        - --port=7472
        - --config={{ template "metallb.configMapName" . }}
        ports:
        - name: monitoring
          containerPort: 7472
        resources:
{{ toYaml .Values.controller.resources | indent 10 }}
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop:
            - all
          readOnlyRootFilesystem: true