apiVersion: apps/v1
kind: Deployment
metadata:
  name: sample-matcher
  labels:
    app: sample-matcher
spec:
  replicas: 1
  selector:
      matchLabels:
        app: sample-matcher
  template:
    metadata:
      labels:
        app: sample-matcher
    spec:
      containers:
      - name: sample-matcher
        image: gcr.io/{{your_google_project_id}}/sample-matcher # Update
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
          name: 'metrics'
          protocol: TCP
        env:
        - name: SPATIAL_REFRESH_TOKEN
          valueFrom:
            secretKeyRef:
              name: spatialos-refresh-token
              key: service-account
        - name: SPATIAL_PROJECT
          valueFrom:
            configMapKeyRef:
              name: online-services-config
              key: spatialos.project
        - name: MATCH_TAG
          value: "match"
        - name: GATEWAY_SERVICE_TARGET
          value: "gateway-internal.default.svc.cluster.local:80"
        args:
        # Analytics Instrumentation Arguments
        - --analytics.endpoint
        - "http://analytics-{{your_environment}}.endpoints.{{your_google_project_id}}.cloud.goog:80/v1/event" # Update
        - --analytics.allow-insecure-endpoint
        - --analytics.config-file-path
        - "/config/online-services-analytics-config"
        - --analytics.gcp-key-path
        - "/secrets/analytics-api-key"
        - --event.environment
        - "{{your_environment}}" # Update
        - --event.schema
        - "improbable"
        volumeMounts:
        - mountPath: /secrets/
          name: analytics-api-key
        - mountPath: /config/
          name: online-services-analytics-config
      volumes:
      - name: analytics-api-key
        secret:
          secretName: analytics-api-key
      - name: online-services-analytics-config
        configMap:
          name: online-services-analytics-config
