apiVersion: apps/v1
kind: Deployment
metadata:
  name: checkout-production
  labels:
    app: checkout
    database_environment: production
    ref: checkout-production
  namespace: checkout-91
spec:
  progressDeadlineSeconds: 600
  replicas: 2
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: checkout
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      name: checkout-production
      labels:
        app: checkout
        database_environment: production
        ref: checkout-production
      namespace: checkout-91
    spec:
      imagePullSecrets:
        - name: gitlab-registry
      hostAliases:
        - ip: "127.0.0.1"
          hostnames:
            - "php"
      containers:
        - name: php
          image: registry.searchquarry.com/sq/checkout/php:latest
          ports:
            - containerPort: 9000
          envFrom:
            - secretRef:
                name: checkout
        - name: nginx
          image: registry.searchquarry.com/sq/checkout/nginx:latest
          ports:
            - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: checkout-production
  namespace: checkout-91
  labels:
    app: checkout
    ref: checkout-production
spec:
  type: ClusterIP
  ports:
    - name: http
      port: 80
      protocol: TCP
  selector:
    ref: checkout-production
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: checkout-production
  namespace: checkout-91
  labels:
    app: checkout
    ref: checkout-production
  annotations:
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
  tls:
  - hosts:
    - checkout1.searchquarry.com
    secretName: checkout1.searchquarry.com-tls
  rules:
  - host: checkout1.searchquarry.com
    http:
      paths:
      - path: /
        backend:
          serviceName: checkout-production
          servicePort: 80
