# kubectl -n fortio exec -it $(kubectl -n fortio get pods -o custom-columns=:.metadata.name \
#    --selector=run=client) -- /bin/bash
# curl -L https://github.com/fullstorydev/grpcurl/releases/download/v1.8.1/grpcurl_1.8.1_linux_x86_64.tar.gz | tar -xz
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    run: client
  name: sleeper
spec:
  selector:
    matchLabels:
      run: client
  template:
    metadata:
      labels:
        run: client
    spec:
      containers:
        - image: openjdk:8-jdk
          imagePullPolicy: IfNotPresent
          name: sleeper
          command:
            - sleep
            - 365d
          env:
            - name: GRPC_XDS_BOOTSTRAP
              value: "/tmp/grpc-xds/td-grpc-bootstrap.json"
          resources:
            limits:
              cpu: "2"
              memory: 2000Mi
            requests:
              cpu: 300m
              memory: 1500Mi
          volumeMounts:
            - name: grpc-td-conf
              mountPath: /tmp/grpc-xds/
      initContainers:
        - args:
            - --output
            - "/tmp/bootstrap/td-grpc-bootstrap.json"
          image: gcr.io/trafficdirector-prod/td-grpc-bootstrap:0.11.0
          imagePullPolicy: IfNotPresent
          name: grpc-td-init
          resources:
            limits:
              cpu: 100m
              memory: 100Mi
            requests:
              cpu: 10m
              memory: 100Mi
          volumeMounts:
            - name: grpc-td-conf
              mountPath: /tmp/bootstrap/
      volumes:
        - name: grpc-td-conf
          emptyDir:
            medium: Memory
