apiVersion: apps/v1
kind: Deployment
metadata:
  name: kustomize-search
spec:
  selector:
    matchLabels:
      app: kustomize-search
      tier: backend
  replicas: 1
  template:
    metadata:
      labels:
        app: kustomize-search
        tier: backend
    spec:
      containers:
      - name: kustomize-search
        image: gcr.io/kustomize-search/backend:latest
        imagePullPolicy: Always
        livenessProbe:
          httpGet:
            path: /liveness
            port: backend-port
        ports:
        - name: backend-port
          containerPort: 8080
        env:
        - name: ELASTICSEARCH_URL
          valueFrom:
            configMapKeyRef:
              name: elasticsearch-config
              key: es-url
        - name: PORT
          value: "8080"
