apiVersion: apps/v1
kind: DaemonSet
metadata:
  labels:
    azure.openshift.io/sync-pod-wait-for-readiness: "false"
    k8s-app: etcd-metrics
  name: etcd-metrics
  namespace: openshift-azure-monitoring
spec:
  selector:
    matchLabels:
      k8s-app: etcd-metrics
  template:
    metadata:
      labels:
        k8s-app: etcd-metrics
    spec:
      containers:
      - args:
        - tlsproxy
        - --hostname
        - https://$(HOSTNAME):2379
        - --listen
        - :8443
        - --cacert
        - /etc/etcd/ca.crt
        - --cert
        - /etc/etcd/peer.crt
        - --key
        - /etc/etcd/peer.key
        - --servingkey
        - /var/serving-cert/tls.key
        - --servingcert
        - /var/serving-cert/tls.crt
        - --whitelist
        - ^/metrics(/|$)
        env:
        - name: HOSTNAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: spec.nodeName
        - name: USERNAME
          valueFrom:
            secretKeyRef:
              key: username
              name: etcd-metrics
        - name: PASSWORD
          valueFrom:
            secretKeyRef:
              key: password
              name: etcd-metrics
        image: '*** GENERATED ***'
        name: etcd-metrics
        ports:
        - containerPort: 8443
          name: metrics
        volumeMounts:
        - mountPath: /etc/etcd
          name: etcd-config
          readOnly: true
        - mountPath: /var/serving-cert
          name: serving-cert
          readOnly: true
      nodeSelector:
        node-role.kubernetes.io/master: "true"
      serviceAccountName: etcd-metrics
      volumes:
      - hostPath:
          path: /etc/etcd
        name: etcd-config
      - name: serving-cert
        secret:
          defaultMode: 288
          secretName: etcd-metrics-serving-cert
      - name: etcd-metrics
        secret:
          defaultMode: 288
          secretName: etcd-metrics
