apiVersion: apps/v1beta2
kind: StatefulSet
metadata:
  name: telemeter-server
  namespace: telemeter-benchmark
spec:
  podManagementPolicy: Parallel
  replicas: 10
  selector:
    matchLabels:
      k8s-app: telemeter-server
  serviceName: telemeter-server
  template:
    metadata:
      labels:
        k8s-app: telemeter-server
    spec:
      containers:
      - command:
        - /usr/bin/telemeter-server
        - --join=telemeter-server
        - --name=$(NAME)
        - --listen=0.0.0.0:8080
        - --listen-internal=0.0.0.0:8081
        - --listen-cluster=0.0.0.0:8082
        - --shared-key=/etc/pki/service/tls.key
        - --authorize=http://localhost:8083
        - --whitelist={__name__="up"}
        - --whitelist={__name__="cluster_version"}
        - --whitelist={__name__="cluster_version_available_updates"}
        - --whitelist={__name__="cluster_operator_up"}
        - --whitelist={__name__="cluster_operator_conditions"}
        - --whitelist={__name__="cluster_version_payload"}
        - --whitelist={__name__="cluster_installer"}
        - --whitelist={__name__="cluster_infrastructure_provider"}
        - --whitelist={__name__="cluster_feature_set"}
        - --whitelist={__name__="node_uname_info"}
        - --whitelist={__name__="instance:etcd_object_counts:sum"}
        - --whitelist={__name__="alerts",alertstate="firing"}
        - --whitelist={__name__="code:apiserver_request_count:rate:sum"}
        - --whitelist={__name__="cluster:capacity_cpu_cores:sum"}
        - --whitelist={__name__="cluster:capacity_memory_bytes:sum"}
        - --whitelist={__name__="cluster:cpu_usage_cores:sum"}
        - --whitelist={__name__="cluster:memory_usage_bytes:sum"}
        - --whitelist={__name__="openshift:cpu_usage_cores:sum"}
        - --whitelist={__name__="openshift:memory_usage_bytes:sum"}
        - --whitelist={__name__="workload:cpu_usage_cores:sum"}
        - --whitelist={__name__="workload:memory_usage_bytes:sum"}
        - --whitelist={__name__="cluster:virt_platform_nodes:sum"}
        - --whitelist={__name__="cluster:node_instance_type_count:sum"}
        - --whitelist={__name__="cnv:vmi_status_running:count"}
        - --whitelist={__name__="node_role_os_version_machine:cpu_capacity_cores:sum"}
        - --whitelist={__name__="node_role_os_version_machine:cpu_capacity_sockets:sum"}
        - --whitelist={__name__="subscription_sync_total"}
        - --whitelist={__name__="ceph_cluster_total_bytes"}
        - --whitelist={__name__="ceph_cluster_total_used_raw_bytes"}
        - --whitelist={__name__="ceph_health_status"}
        - --whitelist={__name__="job:ceph_osd_metadata:count"}
        - --whitelist={__name__="job:kube_pv:count"}
        - --whitelist={__name__="job:ceph_pools_iops:total"}
        - --whitelist={__name__="job:ceph_pools_iops_bytes:total"}
        - --whitelist={__name__="job:ceph_versions_running:count"}
        - --whitelist={__name__="job:noobaa_total_unhealthy_buckets:sum"}
        - --whitelist={__name__="job:noobaa_bucket_count:sum"}
        - --whitelist={__name__="job:noobaa_total_object_count:sum"}
        - --whitelist={__name__="noobaa_accounts_num"}
        - --whitelist={__name__="noobaa_total_usage"}
        - --whitelist={__name__="console_url"}
        env:
        - name: NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        image: quay.io/openshift/origin-telemeter:v4.0
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8080
            scheme: HTTP
        name: telemeter-server
        ports:
        - containerPort: 8080
          name: external
        - containerPort: 8081
          name: internal
        - containerPort: 8082
          name: cluster
        readinessProbe:
          httpGet:
            path: /healthz/ready
            port: 8080
            scheme: HTTP
        volumeMounts:
        - mountPath: /etc/telemeter
          name: secret-telemeter-server
          readOnly: false
        - mountPath: /etc/pki/service
          name: telemeter-server-tls
          readOnly: false
      - command:
        - /usr/bin/authorization-server
        - localhost:8083
        - /etc/telemeter/tokens.json
        image: quay.io/openshift/origin-telemeter:v4.0
        name: authorization-server
        volumeMounts:
        - mountPath: /etc/telemeter
          name: secret-telemeter-server
          readOnly: false
      serviceAccountName: telemeter-server
      volumes:
      - name: secret-telemeter-server
        secret:
          secretName: telemeter-server
      - name: telemeter-server-tls
        secret:
          secretName: telemeter-server-shared
