deployment.yaml 2.28 KB
Newer Older
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 68 69 70 71 72
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "telegraf-operator.fullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "telegraf-operator.labels" . | nindent 4 }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      {{- include "telegraf-operator.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        {{- include "telegraf-operator.selectorLabels" . | nindent 8 }}
    spec:
      containers:
        - name: {{ .Chart.Name }}
          securityContext:
            {{- toYaml .Values.securityContext | nindent 12 }}
          image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          args:
            - "--telegraf-default-class={{ .Values.classes.default }}"
            - --telegraf-classes-directory=/etc/telegraf-operator
            - --enable-default-internal-plugin
            - "--telegraf-image={{ .Values.image.sidecarImage }}"
          env:
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          ports:
            - name: https
              containerPort: 9443
              protocol: TCP
          volumeMounts:
            - mountPath: /etc/certs
              name: certs
              readOnly: true
            - mountPath: /etc/telegraf-operator
              name: classes
              readOnly: true
          resources:
            {{- toYaml .Values.resources | nindent 12 }}
      {{- with .Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      serviceAccountName: {{ include "telegraf-operator.fullname" . }}
      securityContext:
        {{- toYaml .Values.podSecurityContext | nindent 8 }}
      volumes:
      - name: certs
        secret:
          secretName: telegraf-operator-tls
      - name: classes
        secret:
          secretName: {{ .Values.classes.secretName }}
      {{- with .Values.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}
    {{- with .Values.affinity }}
      affinity:
        {{- toYaml . | nindent 8 }}
    {{- end }}
    {{- with .Values.tolerations }}
      tolerations:
        {{- toYaml . | nindent 8 }}
    {{- end }}