apiVersion: apps/v1beta2
kind: Deployment
metadata:
  labels:
    k8s-app: telemeter-client
  name: telemeter-client
  namespace: openshift-monitoring
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: telemeter-client
  template:
    metadata:
      labels:
        k8s-app: telemeter-client
    spec:
      containers:
      - command:
        - /usr/bin/telemeter-client
        - --id=$(ID)
        - --from=$(FROM)
        - --from-ca-file=/etc/serving-certs-ca-bundle/service-ca.crt
        - --from-token-file=/var/run/secrets/kubernetes.io/serviceaccount/token
        - --to=$(TO)
        - --to-token-file=/etc/telemeter/token
        - --listen=localhost:8080
        - --anonymize-salt-file=/etc/telemeter/salt
        - --anonymize-labels=$(ANONYMIZE_LABELS)
        - --match={__name__="up"}
        - --match={__name__="cluster_version"}
        - --match={__name__="cluster_version_available_updates"}
        - --match={__name__="cluster_operator_up"}
        - --match={__name__="cluster_operator_conditions"}
        - --match={__name__="cluster_version_payload"}
        - --match={__name__="cluster_installer"}
        - --match={__name__="cluster_infrastructure_provider"}
        - --match={__name__="cluster_feature_set"}
        - --match={__name__="node_uname_info"}
        - --match={__name__="instance:etcd_object_counts:sum"}
        - --match={__name__="ALERTS",alertstate="firing"}
        - --match={__name__="code:apiserver_request_count:rate:sum"}
        - --match={__name__="cluster:capacity_cpu_cores:sum"}
        - --match={__name__="cluster:capacity_memory_bytes:sum"}
        - --match={__name__="cluster:cpu_usage_cores:sum"}
        - --match={__name__="cluster:memory_usage_bytes:sum"}
        - --match={__name__="openshift:cpu_usage_cores:sum"}
        - --match={__name__="openshift:memory_usage_bytes:sum"}
        - --match={__name__="workload:cpu_usage_cores:sum"}
        - --match={__name__="workload:memory_usage_bytes:sum"}
        - --match={__name__="cluster:virt_platform_nodes:sum"}
        - --match={__name__="cluster:node_instance_type_count:sum"}
        - --match={__name__="cnv:vmi_status_running:count"}
        - --match={__name__="node_role_os_version_machine:cpu_capacity_cores:sum"}
        - --match={__name__="node_role_os_version_machine:cpu_capacity_sockets:sum"}
        - --match={__name__="subscription_sync_total"}
        - --match={__name__="ceph_cluster_total_bytes"}
        - --match={__name__="ceph_cluster_total_used_raw_bytes"}
        - --match={__name__="ceph_health_status"}
        - --match={__name__="job:ceph_osd_metadata:count"}
        - --match={__name__="job:kube_pv:count"}
        - --match={__name__="job:ceph_pools_iops:total"}
        - --match={__name__="job:ceph_pools_iops_bytes:total"}
        - --match={__name__="job:ceph_versions_running:count"}
        - --match={__name__="job:noobaa_total_unhealthy_buckets:sum"}
        - --match={__name__="job:noobaa_bucket_count:sum"}
        - --match={__name__="job:noobaa_total_object_count:sum"}
        - --match={__name__="noobaa_accounts_num"}
        - --match={__name__="noobaa_total_usage"}
        - --match={__name__="console_url"}
        env:
        - name: ANONYMIZE_LABELS
          value: ""
        - name: FROM
          value: https://prometheus-k8s.openshift-monitoring.svc:9091
        - name: ID
          value: ""
        - name: TO
          value: https://infogw.api.openshift.com
        - name: HTTP_PROXY
          value: ""
        - name: HTTPS_PROXY
          value: ""
        - name: NO_PROXY
          value: ""
        image: quay.io/openshift/origin-telemeter:v4.0
        name: telemeter-client
        ports:
        - containerPort: 8080
          name: http
        volumeMounts:
        - mountPath: /etc/serving-certs-ca-bundle
          name: serving-certs-ca-bundle
          readOnly: false
        - mountPath: /etc/telemeter
          name: secret-telemeter-client
          readOnly: false
      - args:
        - --webhook-url=http://localhost:8080/-/reload
        - --volume-dir=/etc/serving-certs-ca-bundle
        image: quay.io/openshift/origin-configmap-reload:v3.11
        name: reload
        volumeMounts:
        - mountPath: /etc/serving-certs-ca-bundle
          name: serving-certs-ca-bundle
          readOnly: false
      - args:
        - --secure-listen-address=:8443
        - --upstream=http://127.0.0.1:8080/
        - --tls-cert-file=/etc/tls/private/tls.crt
        - --tls-private-key-file=/etc/tls/private/tls.key
        image: quay.io/coreos/kube-rbac-proxy:v0.3.1
        name: kube-rbac-proxy
        ports:
        - containerPort: 8443
          name: https
        resources:
          limits:
            cpu: 20m
            memory: 40Mi
          requests:
            cpu: 10m
            memory: 20Mi
        volumeMounts:
        - mountPath: /etc/tls/private
          name: telemeter-client-tls
          readOnly: false
      nodeSelector:
        beta.kubernetes.io/os: linux
      priorityClassName: system-cluster-critical
      serviceAccountName: telemeter-client
      volumes:
      - configMap:
          name: telemeter-client-serving-certs-ca-bundle
        name: serving-certs-ca-bundle
      - name: secret-telemeter-client
        secret:
          secretName: telemeter-client
      - name: telemeter-client-tls
        secret:
          secretName: telemeter-client-tls
