github.com/openebs/node-disk-manager@v1.9.1-0.20230225014141-4531f06ffa1e/deploy/helm/charts/templates/cluster-exporter.yaml (about)

     1  {{- if .Values.ndmExporter.enabled }}
     2  apiVersion: apps/v1
     3  kind: Deployment
     4  metadata:
     5    name: {{ template "openebs-ndm.cluster-exporter.fullname" . }}
     6    labels:
     7      {{- include "openebs-ndm.cluster-exporter.labels" . | nindent 4 }}
     8  spec:
     9    replicas: 1
    10    strategy:
    11      type: Recreate
    12    selector:
    13      matchLabels:
    14        {{- include "openebs-ndm.cluster-exporter.matchLabels" . | nindent 6 }}
    15    template:
    16      metadata:
    17        labels:
    18          {{- include "openebs-ndm.cluster-exporter.labels" . | nindent 8 }}
    19          {{- with .Values.ndmExporter.clusterExporter.podLabels }}
    20          {{ toYaml . }}
    21          {{- end }}
    22      spec:
    23        serviceAccountName: {{ template "openebs-ndm.serviceAccountName" . }}
    24        containers:
    25          - name: {{ template "openebs-ndm.cluster-exporter.fullname" . }}
    26            image: "{{ .Values.ndmExporter.image.registry }}{{ .Values.ndmExporter.image.repository }}:{{ .Values.ndmExporter.image.tag }}"
    27            command:
    28              - /usr/local/bin/exporter
    29            args:
    30              - "start"
    31              - "--mode=cluster"
    32              - "--port=$(METRICS_LISTEN_PORT)"
    33              - "--metrics=/metrics"
    34            ports:
    35              - containerPort: {{ .Values.ndmExporter.clusterExporter.metricsPort }}
    36                protocol: TCP
    37                name: metrics
    38            imagePullPolicy: {{ .Values.ndmExporter.image.pullPolicy }}
    39            env:
    40              - name: NAMESPACE
    41                valueFrom:
    42                  fieldRef:
    43                    fieldPath: metadata.namespace
    44              {{- if .Values.ndmExporter.clusterExporter.metricsPort }}
    45              - name: METRICS_LISTEN_PORT
    46                value: :{{ .Values.ndmExporter.clusterExporter.metricsPort }}
    47              {{- end }}
    48  {{- if .Values.imagePullSecrets }}
    49        imagePullSecrets:
    50  {{ toYaml .Values.imagePullSecrets | indent 8 }}
    51  {{- end }}
    52  {{- if .Values.ndmExporter.clusterExporter.nodeSelector }}
    53        nodeSelector:
    54  {{ toYaml .Values.ndmExporter.clusterExporter.nodeSelector | indent 8 }}
    55  {{- end }}
    56  {{- if .Values.ndmExporter.clusterExporter.tolerations }}
    57        tolerations:
    58  {{ toYaml .Values.ndmExporter.clusterExporter.tolerations | indent 8 }}
    59  {{- end }}
    60  {{- end }}