apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: custom-metrics-apiserver
  name: custom-metrics-apiserver
spec:
  replicas: 1
  selector:
    matchLabels:
      app: custom-metrics-apiserver
  template:
    metadata:
      labels:
        app: custom-metrics-apiserver
      name: custom-metrics-apiserver
    spec:
      serviceAccountName: custom-metrics-apiserver
      automountServiceAccountToken: true
      containers:
      - name: custom-metrics-apiserver
        image: quay.io/coreos/k8s-prometheus-adapter-amd64@sha256:26e5ba6d0536994add9c101e3ba7ce59e893f5bef8c410472e6ed4204d92f440
        args:
        - --secure-port=6443
        - --tls-cert-file=/pki/kubeconfig/tls.crt
        - --tls-private-key-file=/pki/kubeconfig/tls.key
        - --client-ca-file=/pki/kubeconfig/ca.crt
        - --authorization-always-allow-paths=kube-apiserver-svc
        - --authorization-kubeconfig=/etc/kubernetes/admin.conf
        - --authentication-kubeconfig=/etc/kubernetes/admin.conf
        - --authentication-skip-lookup=false
        - --logtostderr=true
        - --prometheus-url=http://vmselect-example-vmcluster-additional-service:8481/select/0/prometheus/
        - --metrics-relist-interval=1m
        - --v=10
        - --config=/etc/adapter/config.yaml
        ports:
        - containerPort: 6443
        volumeMounts:
        - mountPath: /etc/kubernetes/
          name: kubeconfig
          readOnly: true
        - mountPath: /pki/kubeconfig/
          name: pki-client
          readOnly: true
        - mountPath: /etc/adapter/
          name: config
          readOnly: true
        - mountPath: /tmp
          name: tmp-vol
      volumes:
      - name: pki-client
        secret:
          secretName: pki-prometheus-adapter-server-client
      - name: config
        configMap:
          name: adapter-config
      - name: tmp-vol
        emptyDir: {}
      - configMap:
          defaultMode: 420
          name: kubeconfig
        name: kubeconfig