apiVersion: v1
kind: Service
metadata:
  labels:
    service: concierge-graphql
    stack: concierge-graphql
  name: concierge-graphql
spec:
  ports:
  - name: webapp
    port: 9000
    targetPort: 9000
  selector:
    service: concierge-graphql
    stack: concierge-graphql
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    service: concierge-graphql
    stack: concierge-graphql
  name: concierge-graphql
spec:
  replicas: 1
  revisionHistoryLimit: 5
  selector:
    matchLabels:
      service: concierge-graphql
      stack: concierge-graphql
  template:
    metadata:
      labels:
        service: concierge-graphql
        stack: concierge-graphql
    spec:
      containers:
        - name: concierge-graphql
          image: ghcr.io/guardian/concierge-graphql/concierge-graphql:3
          env: 
          - name: ELASTICSEARCH_HOST
            value: capi-elasticsearch
          ports:
            - containerPort: 9000
          readinessProbe:
            httpGet:
              path: /healthcheck
              port: 9000
            initialDelaySeconds: 10
            periodSeconds: 10
          livenessProbe:
            httpGet:
              path: /healthcheck
              port: 9000
            initialDelaySeconds: 15
            periodSeconds: 3

