---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: vizier-proxy
spec:
  replicas: 1
  selector:
    matchLabels:
      name: vizier-proxy
  template:
    metadata:
      labels:
        name: vizier-proxy
        plane: control
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: kubernetes.io/os
                operator: Exists
              - key: kubernetes.io/os
                operator: In
                values:
                - linux
            - matchExpressions:
              - key: beta.kubernetes.io/os
                operator: Exists
              - key: beta.kubernetes.io/os
                operator: In
                values:
                - linux
      containers:
      - name: app
        image: envoyproxy/envoy:v1.12.2
        command: ["envoy"]
        args: ["-c", "/etc/envoy.yaml", "--service-cluster", "$(POD_NAME)"]
        env:
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        ports:
        - containerPort: 55000
        volumeMounts:
        - name: envoy-yaml
          mountPath: /etc/envoy.yaml
          subPath: envoy.yaml
        - name: proxy-certs
          mountPath: /proxy-certs
        - mountPath: /certs
          name: certs
      volumes:
      - name: certs
        secret:
          secretName: service-tls-certs
      - name: envoy-yaml
        configMap:
          name: proxy-envoy-config
      - name: proxy-certs
        secret:
          secretName: proxy-tls-certs
