apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/component: metrics-adapter
    app.kubernetes.io/managed-by: cluster-monitoring-operator
    app.kubernetes.io/name: prometheus-adapter
    app.kubernetes.io/part-of: openshift-monitoring
    app.kubernetes.io/version: 0.9.0
  name: prometheus-adapter
  namespace: openshift-monitoring
spec:
  replicas: 2
  selector:
    matchLabels:
      app.kubernetes.io/component: metrics-adapter
      app.kubernetes.io/name: prometheus-adapter
      app.kubernetes.io/part-of: openshift-monitoring
  strategy:
    rollingUpdate:
      maxUnavailable: 1
  template:
    metadata:
      annotations:
        target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
      labels:
        app.kubernetes.io/component: metrics-adapter
        app.kubernetes.io/name: prometheus-adapter
        app.kubernetes.io/part-of: openshift-monitoring
        app.kubernetes.io/version: 0.9.0
    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchLabels:
                app.kubernetes.io/component: metrics-adapter
                app.kubernetes.io/name: prometheus-adapter
                app.kubernetes.io/part-of: openshift-monitoring
            namespaces:
            - openshift-monitoring
            topologyKey: kubernetes.io/hostname
      containers:
      - args:
        - --prometheus-auth-config=/etc/prometheus-config/prometheus-config.yaml
        - --config=/etc/adapter/config.yaml
        - --logtostderr=true
        - --metrics-relist-interval=1m
        - --prometheus-url=https://prometheus-k8s.openshift-monitoring.svc:9091
        - --secure-port=6443
        - --tls-cipher-suites=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305
        image: directxman12/k8s-prometheus-adapter:v0.9.0
        name: prometheus-adapter
        ports:
        - containerPort: 6443
        resources:
          requests:
            cpu: 1m
            memory: 40Mi
        terminationMessagePolicy: FallbackToLogsOnError
        volumeMounts:
        - mountPath: /tmp
          name: tmpfs
          readOnly: false
        - mountPath: /etc/adapter
          name: config
          readOnly: false
        - mountPath: /etc/prometheus-config
          name: prometheus-adapter-prometheus-config
          readOnly: false
        - mountPath: /etc/ssl/certs
          name: serving-certs-ca-bundle
          readOnly: false
      nodeSelector:
        kubernetes.io/os: linux
      priorityClassName: system-cluster-critical
      securityContext: {}
      serviceAccountName: prometheus-adapter
      volumes:
      - emptyDir: {}
        name: tmpfs
      - configMap:
          name: adapter-config
        name: config
      - configMap:
          name: prometheus-adapter-prometheus-config
        name: prometheus-adapter-prometheus-config
      - configMap:
          name: serving-certs-ca-bundle
        name: serving-certs-ca-bundle
