apiVersion: apps/v1
kind: Deployment
metadata:
  name: party
  labels:
    app: party
spec:
  replicas: 1
  selector:
      matchLabels:
        app: party
  template:
    metadata:
      labels:
        app: party
    spec:
      containers:
      - name: esp
        image: gcr.io/endpoints-release/endpoints-runtime:1.16.0
        args: [
          "--http_port=9001",
          "--http2_port=9000",
          "--service=party.endpoints.[your Google project id].cloud.goog",
          "--rollout_strategy=managed",
          "--backend=grpc://127.0.0.1:4040"
        ]
        ports:
          - containerPort: 9000
          - containerPort: 9001
      - name: party
        image: gcr.io/[your Google project id]/party
        imagePullPolicy: Always
        ports:
        - containerPort: 4040
          protocol: TCP
        - containerPort: 8080
          name: 'metrics'
          protocol: TCP
        env:
        - name: SPATIAL_REFRESH_TOKEN
          valueFrom:
            secretKeyRef:
              name: spatialos-refresh-token
              key: service-account.txt
        - name: REDIS_CONNECTION_STRING
          valueFrom:
            configMapKeyRef:
              name: online-services-config
              key: redis.connection-string
        args:
        - --grpc_service_port
        - "4040"
        - --redis_connection_string
        - "$(REDIS_CONNECTION_STRING)"
