apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  name: grpc
spec:
  selector:
    matchLabels:
      app: grpc
  strategy: {}
  template:
    metadata:
      annotations:
        inject.istio.io/templates: grpc-simple
        prometheus.io/path: /stats/prometheus
        prometheus.io/port: "15020"
        prometheus.io/scrape: "true"
        proxy.istio.io/overrides: '{"containers":[{"name":"traffic","image":"fake.docker.io/google-samples/traffic-go-gke:1.0","resources":{},"readinessProbe":{"httpGet":{"port":80}}}]}'
        sidecar.istio.io/status: '{"initContainers":["grpc-bootstrap-init"],"containers":["traffic"],"volumes":["grpc-io-proxyless-bootstrap"],"imagePullSecrets":null,"revision":"default"}'
      creationTimestamp: null
      labels:
        app: grpc
    spec:
      containers:
      - env:
        - name: GRPC_XDS_BOOTSTRAP
          value: /var/lib/grpc/data/bootstrap.json
        - name: GRPC_GO_LOG_VERBOSITY_LEVEL
          value: "99"
        - name: GRPC_GO_LOG_SEVERITY_LEVEL
          value: info
        image: fake.docker.io/google-samples/traffic-go-gke:1.0
        name: traffic
        readinessProbe:
          httpGet:
            port: 80
        resources: {}
        volumeMounts:
        - mountPath: /var/lib/grpc/data/
          name: grpc-io-proxyless-bootstrap
      initContainers:
      - command:
        - sh
        - -c
        - |-
          NODE_ID="sidecar~${INSTANCE_IP}~${POD_NAME}.${POD_NAMESPACE}~cluster.local"
          SERVER_URI="dns:///istiod.${ISTIO_NAMESPACE}.svc:15010"
          echo '
          {
            "xds_servers": [
              {
                "server_uri": "'${SERVER_URI}'",
                "channel_creds": [{"type": "insecure"}],
                "server_features" : ["xds_v3"]
              }
            ],
            "node": {
              "id": "'${NODE_ID}'",
              "metadata": {
                "GENERATOR": "grpc"
              }
            }
          }' > /var/lib/grpc/data/bootstrap.json
        env:
        - name: INSTANCE_IP
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: ISTIO_NAMESPACE
          value: |
            istio-system
        image: busybox:1.28
        name: grpc-bootstrap-init
        resources: {}
        volumeMounts:
        - mountPath: /var/lib/grpc/data/
          name: grpc-io-proxyless-bootstrap
      volumes:
      - emptyDir: {}
        name: grpc-io-proxyless-bootstrap
status: {}
---
