apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: kube-state-metrics
    app.kubernetes.io/version: 2.0.0-rc.0
  name: kube-state-metrics
  namespace: kube-state-metrics-perf-test
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: kube-state-metrics
  template:
    metadata:
      labels:
        app.kubernetes.io/name: kube-state-metrics
        app.kubernetes.io/version: 2.0.0-rc.0
    spec:
      containers:
      - image: k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.0.0-rc.0
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8080
          initialDelaySeconds: 5
          timeoutSeconds: 5
        name: kube-state-metrics
        resources:
          requests:
            cpu: {{AddInt 200 (MultiplyInt 500 (DivideInt .Nodes 1000))}}m
            # Start with 2Gi and add 2Gi for each 1K nodes.
            memory: {{MultiplyInt 2 (AddInt 1 (DivideInt .Nodes 1000))}}Gi
          limits:
            cpu: {{AddInt 200 (MultiplyInt 500 (DivideInt .Nodes 1000))}}m
            # Start with 2Gi and add 2Gi for each 1K nodes.
            memory: {{MultiplyInt 2 (AddInt 1 (DivideInt .Nodes 1000))}}Gi
        ports:
        - containerPort: 8080
          name: http-metrics
        - containerPort: 8081
          name: telemetry
        readinessProbe:
          httpGet:
            path: /
            port: 8081
          initialDelaySeconds: 5
          timeoutSeconds: 5
        securityContext:
          runAsUser: 65534
      nodeSelector:
        kubernetes.io/os: linux
      serviceAccountName: kube-state-metrics
