apiVersion: apps/v1
kind: Deployment
metadata:
  name: kube-state-metrics
  namespace: kube-system
  labels:
    application: kube-state-metrics
    version: v1.9.3
spec:
  replicas: 1
  selector:
    matchLabels:
      application: kube-state-metrics
  template:
    metadata:
      labels:
        application: kube-state-metrics
        version: v1.9.3
    spec:
      dnsConfig:
        options:
          - name: ndots
            value: "1"
      serviceAccountName: kube-state-metrics
      containers:
      - name: kube-state-metrics
        image: registry.opensource.zalan.do/teapot/kube-state-metrics:v1.9.3
        args:
        - --collectors=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments,verticalpodautoscalers
        ports:
        - containerPort: 8080
          name: http-metrics
        - containerPort: 8081
          name: telemetry
        readinessProbe:
          httpGet:
            path: /
            port: 8081
          initialDelaySeconds: 5
          timeoutSeconds: 5
        resources:
          limits:
            cpu: "{{.ConfigItems.kube_state_metrics_cpu}}"
            memory: "{{.ConfigItems.kube_state_metrics_mem}}"
        securityContext:
          readOnlyRootFilesystem: true
          runAsNonRoot: true
          runAsUser: 65534
          capabilities:
            drop: ["ALL"]
      securityContext:
        fsGroup: 65534
