apiVersion: apps/v1
kind: Deployment
metadata:
  name: watch-proxy
  namespace: tanzu-watch-proxy
spec:
  replicas: 1
  strategy:
    rollingUpdate:
      maxUnavailable: 1
  selector:
    matchLabels:
      app: watch-proxy
  template:
    metadata:
      labels:
        app: watch-proxy
    spec:
      securityContext:
        runAsUser: 10000
        fsGroup: 20000
      serviceAccountName: watch-proxy-controller
      containers:
      - name: watch-proxy
        image: your/image/name  # put your image name here
        imagePullPolicy: IfNotPresent
        resources:
            requests:
                memory: "128Mi"
                cpu: "100m"
            limits:
                memory: "512Mi"
                cpu: "150m"
        livenessProbe:
          httpGet:
            port: 8080
            path: /live
          initialDelaySeconds: 25
          periodSeconds: 15
        # an alternative command-based liveness probe for compatibility with
        # clusters using mTLS
        #livenessProbe:
        #  exec:
        #    command:
        #    - cat
        #    - /watch-proxy/healthy
        #  initialDelaySeconds: 25
        #  periodSeconds: 15
        volumeMounts:
        - name: config-volume
          mountPath: /etc/watch-proxy
        - name: scratch-volume
          mountPath: /watch-proxy
        env:
        - name: USERNAME1
          valueFrom:
            secretKeyRef:
              name: watch-proxy-creds-1
              key: username
        - name: PASSWORD1
          valueFrom:
            secretKeyRef:
              name: watch-proxy-creds-1
              key: password
        - name: USERNAME2
          valueFrom:
            secretKeyRef:
              name: watch-proxy-creds-2
              key: username
        - name: PASSWORD2
          valueFrom:
            secretKeyRef:
              name: watch-proxy-creds-2
              key: password
      volumes:
      - name: config-volume
        configMap:
          name: watch-proxy
      - name: scratch-volume
        emptyDir: {}

