github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/fluent-operator/templates/fluent-operator-deployment.yaml (about)

     1  apiVersion: apps/v1
     2  kind: Deployment
     3  metadata:
     4    name: fluent-operator
     5    labels:
     6      app.kubernetes.io/component: operator
     7      app.kubernetes.io/name: fluent-operator
     8    annotations:
     9      {{- toYaml .Values.operator.annotations| nindent 4 }}
    10  spec:
    11    selector:
    12      matchLabels:
    13        app.kubernetes.io/component: operator
    14        app.kubernetes.io/name: fluent-operator
    15    template:
    16      metadata:
    17        labels:
    18          app.kubernetes.io/component: operator
    19          app.kubernetes.io/name: fluent-operator
    20          {{- if .Values.operator.labels }}
    21          {{- toYaml .Values.operator.labels | nindent 8 }}
    22          {{- end }}
    23        {{- if .Values.operator.annotations }}
    24        annotations:
    25          {{- toYaml .Values.operator.annotations| nindent 8 }}
    26        {{- end }}
    27      spec:
    28        {{- if eq .Values.containerRuntime "docker" }}
    29        volumes:
    30        - name: env
    31          emptyDir: {}
    32        - name: dockersock
    33          hostPath:
    34            path: /var/run/docker.sock
    35        initContainers:
    36        - name: setenv
    37          image: {{ .Values.operator.initcontainer.repository }}:{{ .Values.operator.initcontainer.tag }}
    38          command:
    39          - /bin/sh
    40          - '-c'
    41          - set -ex;
    42            echo CONTAINER_ROOT_DIR=$(docker info -f '{{`{{.DockerRootDir}}`}}' 2> /dev/null) > /fluent-operator/fluent-bit.env
    43          volumeMounts:
    44          - name: env
    45            mountPath: /fluent-operator
    46          - name: dockersock
    47            readOnly: true
    48            mountPath: /var/run/docker.sock
    49        {{- else if eq .Values.containerRuntime "containerd" }}
    50        volumes:
    51        - name: env
    52          emptyDir: {}
    53        initContainers:
    54        - name: setenv
    55          image: {{ .Values.operator.initcontainer.repository }}:{{ .Values.operator.initcontainer.tag }}
    56          command:
    57          - /bin/sh
    58          - '-c'
    59          - set -ex;
    60            echo CONTAINER_ROOT_DIR={{ .Values.operator.logPath.containerd }} > /fluent-operator/fluent-bit.env
    61          volumeMounts:
    62          - name: env
    63            mountPath: /fluent-operator
    64        {{- else if eq .Values.containerRuntime "crio" }}
    65        volumes:
    66          - name: env
    67            emptyDir: {}
    68        initContainers:
    69        - name: setenv
    70          image: {{ .Values.operator.initcontainer.repository }}:{{ .Values.operator.initcontainer.tag }}
    71          command:
    72          - /bin/sh
    73          - '-c'
    74          - set -ex;
    75            echo CONTAINER_ROOT_DIR={{ .Values.operator.logPath.crio }} > /fluent-operator/fluent-bit.env
    76          volumeMounts:
    77          - name: env
    78            mountPath: /fluent-operator
    79        {{- end }}
    80        containers:
    81        - name: fluent-operator
    82          image: {{ .Values.operator.container.repository }}:{{ .Values.operator.container.tag }}
    83          {{- if .Values.operator.securityContext }}
    84          securityContext:
    85            {{ toYaml .Values.operator.securityContext | nindent 10 }}
    86          {{- end }}
    87          resources:
    88            {{- toYaml .Values.operator.resources | nindent 10 }}
    89          env:
    90            - name: NAMESPACE
    91              valueFrom:
    92                fieldRef:
    93                  apiVersion: v1
    94                  fieldPath: metadata.namespace
    95          {{- with .Values.operator.disableComponentControllers }}
    96          args: ["--disable-component-controllers","{{ . }}"]
    97          {{- end }}
    98          volumeMounts:
    99          - name: env
   100            mountPath: /fluent-operator
   101        serviceAccountName: fluent-operator
   102        {{- if .Values.operator.imagePullSecrets }}
   103        imagePullSecrets:
   104        {{- toYaml .Values.operator.imagePullSecrets | nindent 8 }}
   105        {{- end }}
   106        {{- if .Values.operator.podSecurityContext }}
   107        securityContext:
   108          {{ toYaml .Values.operator.podSecurityContext | nindent 8 }}
   109        {{- end }}