apiVersion: apps/v1
kind: Deployment
metadata:
  name: proxy-deployment
  labels:
    app: proxy
spec:
  replicas: 3
  selector:
    matchLabels:
      app: proxy
  template:
    metadata:
      labels:
        app: proxy
    spec:
      volumes:
      - name: service-account
        secret:
          secretName: proxy-account
      containers:
      - name: proxy
        image: gcr.io/GCP_PROJECT/IMAGE_NAME:bazel
        ports:
        - containerPort: 30000
          name: health-check
        - containerPort: 30001
          name: whois
        - containerPort: 30002
          name: epp
        readinessProbe:
          tcpSocket:
            port: health-check
          initialDelaySeconds: 5
          periodSeconds: 10
        livenessProbe:
          tcpSocket:
            port: health-check
          initialDelaySeconds: 15
          periodSeconds: 20
        volumeMounts:
        - name: service-account
          mountPath: /var/secrets/google
        imagePullPolicy: Always
        args: ["--env", "alpha", "--log"]
        env:
        - name: GOOGLE_APPLICATION_CREDENTIALS
          value: /var/secrets/google/service-account.json
