apiVersion: apps/v1
kind: Deployment
metadata:
  name: metric-proxy
  namespace: cf-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: metric-proxy
  template:
    metadata:
      labels:
        app: metric-proxy
    spec:
      containers:
      - image: oratos/metric-proxy:dev
        imagePullPolicy: Always
        name: metric-proxy
        env:
        - name: API_SERVER
          value: https://10.39.240.1:443
        - name: TOKEN
          valueFrom:
            secretKeyRef:
              name: default-token-kc5tt
              key: token
        - name: ADDR
          value: :8080
        - name: APP_SELECTOR
          value: cloudfoundry.org/app_guid
        - name: NAMESPACE
          value: cf-workloads
        - name: QUERY_TIMEOUT
          value: "5"
        - name: CA_PATH
          value: /ca/tls.crt
        - name: CERT_PATH
          value: /log-cache-certs/tls.crt
        - name: KEY_PATH
          value: /log-cache-certs/tls.key
        volumeMounts:
        - mountPath: /ca
          name: ca
          readOnly: true
        - mountPath: /log-cache-certs
          name: log-cache-certs
          readOnly: true
      volumes:
      - name: ca
        secret:
          defaultMode: 420
          secretName: log-cache-ca
      - name: log-cache-certs
        secret:
          defaultMode: 420
          secretName: log-cache
      - name: syslog-server-certs
        secret:
          defaultMode: 420
          secretName: log-cache-syslog
      - name: gateway-certs
        secret:
          defaultMode: 420
          secretName: log-cache-gateway
      - name: metrics-certs
        secret:
          defaultMode: 420
          secretName: log-cache-metrics
      - name: default-token-kc5tt
        secret:
          defaultMode: 420
          secretName: default-token-kc5tt
