github.com/microsoft/fabrikate@v1.0.0-alpha.1.0.20210115014322-dc09194d0885/testdata/local-charts/prometheus/charts/kube-state-metrics/templates/deployment.yaml (about)

     1  apiVersion: apps/v1
     2  {{- if .Values.autosharding.enabled }}
     3  kind: StatefulSet
     4  {{- else }}
     5  kind: Deployment
     6  {{- end }}
     7  metadata:
     8    name: {{ template "kube-state-metrics.fullname" . }}
     9    namespace: {{ template "kube-state-metrics.namespace" . }}
    10    labels:
    11      app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
    12      helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    13      app.kubernetes.io/instance: "{{ .Release.Name }}"
    14      app.kubernetes.io/managed-by: "{{ .Release.Service }}"
    15  {{- if .Values.customLabels }}
    16  {{ toYaml .Values.customLabels | indent 4 }}
    17  {{- end }}
    18  spec:
    19    selector:
    20      matchLabels:
    21        app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
    22    replicas: {{ .Values.replicas }}
    23  {{- if .Values.autosharding.enabled }}
    24    serviceName: {{ template "kube-state-metrics.fullname" . }}
    25    volumeClaimTemplates: []
    26  {{- end }}
    27    template:
    28      metadata:
    29        labels:
    30          app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
    31          app.kubernetes.io/instance: "{{ .Release.Name }}"
    32  {{- if .Values.customLabels }}
    33  {{ toYaml .Values.customLabels | indent 8 }}
    34  {{- end }}
    35  {{- if .Values.podAnnotations }}
    36        annotations:
    37  {{ toYaml .Values.podAnnotations | indent 8 }}
    38  {{- end }}
    39      spec:
    40        hostNetwork: {{ .Values.hostNetwork }}
    41        serviceAccountName: {{ template "kube-state-metrics.serviceAccountName" . }}
    42        {{- if .Values.securityContext.enabled }}
    43        securityContext:
    44          fsGroup: {{ .Values.securityContext.fsGroup }}
    45          runAsGroup: {{ .Values.securityContext.runAsGroup }}
    46          runAsUser: {{ .Values.securityContext.runAsUser }}
    47        {{- end }}
    48      {{- if .Values.priorityClassName }}
    49        priorityClassName: {{ .Values.priorityClassName }}
    50      {{- end }}
    51        containers:
    52        - name: {{ .Chart.Name }}
    53  {{- if .Values.autosharding.enabled }}
    54          env:
    55          - name: POD_NAME
    56            valueFrom:
    57              fieldRef:
    58                fieldPath: metadata.name
    59          - name: POD_NAMESPACE
    60            valueFrom:
    61              fieldRef:
    62                fieldPath: metadata.namespace
    63  {{- end }}
    64          args:
    65  {{  if .Values.collectors.certificatesigningrequests  }}
    66          - --collectors=certificatesigningrequests
    67  {{  end  }}
    68  {{  if .Values.collectors.configmaps  }}
    69          - --collectors=configmaps
    70  {{  end  }}
    71  {{  if .Values.collectors.cronjobs  }}
    72          - --collectors=cronjobs
    73  {{  end  }}
    74  {{ if .Values.collectors.daemonsets  }}
    75          - --collectors=daemonsets
    76  {{  end  }}
    77  {{  if .Values.collectors.deployments  }}
    78          - --collectors=deployments
    79  {{  end  }}
    80  {{  if .Values.collectors.endpoints  }}
    81          - --collectors=endpoints
    82  {{  end  }}
    83  {{  if .Values.collectors.horizontalpodautoscalers  }}
    84          - --collectors=horizontalpodautoscalers
    85  {{  end  }}
    86  {{  if .Values.collectors.ingresses  }}
    87          - --collectors=ingresses
    88  {{  end  }}
    89  {{  if .Values.collectors.jobs  }}
    90          - --collectors=jobs
    91  {{  end  }}
    92  {{  if .Values.collectors.limitranges  }}
    93          - --collectors=limitranges
    94  {{  end  }}
    95  {{  if .Values.collectors.mutatingwebhookconfigurations  }}
    96          - --collectors=mutatingwebhookconfigurations
    97  {{  end  }}
    98  {{  if .Values.collectors.namespaces  }}
    99          - --collectors=namespaces
   100  {{  end  }}
   101  {{  if .Values.collectors.networkpolicies  }}
   102          - --collectors=networkpolicies
   103  {{  end  }}
   104  {{  if .Values.collectors.nodes  }}
   105          - --collectors=nodes
   106  {{  end  }}
   107  {{  if .Values.collectors.persistentvolumeclaims  }}
   108          - --collectors=persistentvolumeclaims
   109  {{  end  }}
   110  {{  if .Values.collectors.persistentvolumes  }}
   111          - --collectors=persistentvolumes
   112  {{  end  }}
   113  {{  if .Values.collectors.poddisruptionbudgets  }}
   114          - --collectors=poddisruptionbudgets
   115  {{  end  }}
   116  {{  if .Values.collectors.pods  }}
   117          - --collectors=pods
   118  {{  end  }}
   119  {{  if .Values.collectors.replicasets  }}
   120          - --collectors=replicasets
   121  {{  end  }}
   122  {{  if .Values.collectors.replicationcontrollers  }}
   123          - --collectors=replicationcontrollers
   124  {{  end  }}
   125  {{  if .Values.collectors.resourcequotas  }}
   126          - --collectors=resourcequotas
   127  {{  end  }}
   128  {{  if .Values.collectors.secrets  }}
   129          - --collectors=secrets
   130  {{  end  }}
   131  {{  if .Values.collectors.services  }}
   132          - --collectors=services
   133  {{  end  }}
   134  {{  if .Values.collectors.statefulsets  }}
   135          - --collectors=statefulsets
   136  {{  end  }}
   137  {{  if .Values.collectors.storageclasses  }}
   138          - --collectors=storageclasses
   139  {{  end  }}
   140  {{  if .Values.collectors.validatingwebhookconfigurations  }}
   141          - --collectors=validatingwebhookconfigurations
   142  {{  end  }}
   143  {{  if .Values.collectors.verticalpodautoscalers  }}
   144          - --collectors=verticalpodautoscalers
   145  {{  end  }}
   146  {{  if .Values.collectors.volumeattachments  }}
   147          - --collectors=volumeattachments
   148  {{  end  }}
   149  {{ if .Values.namespace }}
   150          - --namespace={{ .Values.namespace }}
   151  {{ end }}
   152  {{ if .Values.autosharding.enabled }}
   153          - --pod=$(POD_NAME)
   154          - --pod-namespace=$(POD_NAMESPACE)
   155  {{ end }}
   156          imagePullPolicy: {{ .Values.image.pullPolicy }}
   157          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
   158          ports:
   159          - containerPort: 8080
   160          livenessProbe:
   161            httpGet:
   162              path: /healthz
   163              port: 8080
   164            initialDelaySeconds: 5
   165            timeoutSeconds: 5
   166          readinessProbe:
   167            httpGet:
   168              path: /
   169              port: 8080
   170            initialDelaySeconds: 5
   171            timeoutSeconds: 5
   172  {{- if .Values.resources }}
   173          resources:
   174  {{ toYaml .Values.resources | indent 10 }}
   175  {{- end }}
   176  {{- if .Values.imagePullSecrets }}
   177        imagePullSecrets:
   178  {{ toYaml .Values.imagePullSecrets | indent 8 }}
   179  {{- end }}
   180  {{- if .Values.affinity }}
   181        affinity:
   182  {{ toYaml .Values.affinity | indent 8 }}
   183  {{- end }}
   184  {{- if .Values.nodeSelector }}
   185        nodeSelector:
   186  {{ toYaml .Values.nodeSelector | indent 8 }}
   187  {{- end }}
   188  {{- if .Values.tolerations }}
   189        tolerations:
   190  {{ toYaml .Values.tolerations | indent 8 }}
   191  {{- end }}