---
apiVersion: v1
kind: Service
metadata:
  name: be-srv-grpc
  labels:
    type: be-srv-grpc
  annotations:
    cloud.google.com/app-protocols: '{"be-grpc":"HTTP2"}'
    cloud.google.com/neg: '{"ingress": false, "exposed_ports": {"50051":{}}}'   

spec:
  type: ClusterIP
  ports:
  - name: be-grpc
    port: 50051
    protocol: TCP
    targetPort: 50051      
  selector:
    app: be-grpc

# Please see:
# https://github.com/GoogleCloudPlatform/gke-networking-recipes/tree/master/ingress/single-cluster/ingress-custom-grpc-health-check/example
#     cloud.google.com/backend-config: '{"default": "be-grpc-backendconfig"}' 
# ---
# apiVersion: cloud.google.com/v1
# kind: BackendConfig
# metadata:
#   name: be-grpc-backendconfig
# spec:
#   healthCheck:
#     type: HTTP
#     requestPath: /
#     port: 50052