apiVersion: apps/v1
kind: Deployment
metadata:
  name: prometheus-adapter
spec:
  replicas: 1
  selector:
    matchLabels:
      name: prometheus-adapter
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  template:
    metadata:
      labels:
        name: prometheus-adapter
    spec:
      serviceAccountName: prometheus-adapter
      containers:
        - name: prometheus-adapter
          # v0.8.2
          image: directxman12/k8s-prometheus-adapter:v0.8.2@sha256:2b09a571757a12c0245f2f1a74db4d1b9386ff901cf57f5ce48a0a682bd0e3af
          imagePullPolicy: IfNotPresent
          args:
            - --cert-dir=/var/run/serving-cert
            - --config=/etc/adapter/config.yaml
            - --logtostderr=true
            - --metrics-relist-interval=1m
            - --prometheus-url=http://prometheus.monitoring.svc.cluster.local:9090/
            - --secure-port=6443
          resources:
            requests:
              cpu: 100m
              memory: 180Mi
            limits:
              cpu: 250m
              memory: 250Mi
          ports:
            - name: https
              containerPort: 6443
          volumeMounts:
            - mountPath: /tmp
              name: tmpfs
              readOnly: false
            - mountPath: /var/run/serving-cert
              name: volume-serving-cert
              readOnly: false
            - mountPath: /etc/adapter
              name: config
              readOnly: false
          # MISSING
          # liveness
          # readiness
      volumes:
        - emptyDir: {}
          name: tmpfs
        - emptyDir: {}
          name: volume-serving-cert
        - configMap:
            name: prometheus-adapter
          name: config
