github.com/fafucoder/cilium@v1.6.11/install/kubernetes/cilium/charts/preflight/templates/deployment.yaml (about)

     1  {{- if .Values.validateCNPs }}
     2  apiVersion: apps/v1
     3  kind: Deployment
     4  metadata:
     5    name: cilium-pre-flight-check
     6    namespace: {{ .Release.Namespace }}
     7  spec:
     8    selector:
     9      matchLabels:
    10        k8s-app: cilium-pre-flight-check-deployment
    11        kubernetes.io/cluster-service: "true"
    12    template:
    13      metadata:
    14        labels:
    15          k8s-app: cilium-pre-flight-check-deployment
    16          kubernetes.io/cluster-service: "true"
    17      spec:
    18        affinity:
    19          podAffinity:
    20            requiredDuringSchedulingIgnoredDuringExecution:
    21            - labelSelector:
    22                matchExpressions:
    23                - key: "k8s-app"
    24                  operator: In
    25                  values:
    26                  - cilium
    27              topologyKey: "kubernetes.io/hostname"
    28        containers:
    29  {{- if .Values.validateCNPs }}
    30  {{- if contains "/" .Values.image }}
    31          - image: "{{ .Values.image }}"
    32  {{- else }}
    33          - image: "{{ .Values.global.registry }}/{{ .Values.image }}:{{ .Values.global.tag }}"
    34  {{- end }}
    35            imagePullPolicy: {{ .Values.global.pullPolicy }}
    36            name: cnp-validator
    37            command: ["/bin/sh"]
    38            args:
    39            - -c
    40            - "cilium preflight validate-cnp && touch /tmp/ready-validate-cnp && sleep 1h"
    41            livenessProbe:
    42              exec:
    43                command:
    44                - cat
    45                - /tmp/ready-validate-cnp
    46              initialDelaySeconds: 5
    47              periodSeconds: 5
    48            readinessProbe:
    49              exec:
    50                command:
    51                - cat
    52                - /tmp/ready-validate-cnp
    53              initialDelaySeconds: 5
    54              periodSeconds: 5
    55            env:
    56  {{- if .Values.global.k8sServiceHost }}
    57            - name: KUBERNETES_SERVICE_HOST
    58              value: {{ .Values.global.k8sServiceHost | quote }}
    59  {{- end }}
    60  {{- if .Values.global.k8sServicePort }}
    61            - name: KUBERNETES_SERVICE_PORT
    62              value: {{ .Values.global.k8sServicePort | quote }}
    63  {{- end }}
    64  {{- end }}
    65        hostNetwork: true
    66        restartPolicy: Always
    67        serviceAccount: cilium
    68        serviceAccountName: cilium
    69        terminationGracePeriodSeconds: 1
    70        tolerations:
    71          - effect: NoSchedule
    72            key: node.kubernetes.io/not-ready
    73          - effect: NoSchedule
    74            key: node-role.kubernetes.io/master
    75          - effect: NoSchedule
    76            key: node.cloudprovider.kubernetes.io/uninitialized
    77            value: "true"
    78          - key: CriticalAddonsOnly
    79            operator: "Exists"
    80  {{- end }}