---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: ${KUBE_NAMESPACE}
  annotations:
    app.gitlab.com/app: ${CI_PROJECT_PATH_SLUG}
    app.gitlab.com/env: ${CI_ENVIRONMENT_SLUG}
    deploy-timestamp: "${DEPLOY_TIMESTAMP}"
spec:
  replicas: 1
  revisionHistoryLimit: 0
  selector:
    matchLabels:
      app: ${KUBE_NAMESPACE}
  template:
    metadata:
      labels:
        app: ${KUBE_NAMESPACE}
      annotations:
        deploy-timestamp: "${DEPLOY_TIMESTAMP}"
        app.gitlab.com/app: ${CI_PROJECT_PATH_SLUG}
        app.gitlab.com/env: ${CI_ENVIRONMENT_SLUG}  
    spec:
      imagePullSecrets:
      - name: docker-secret
      containers:
      - name: ${KUBE_NAMESPACE}
        image: "${DEPLOY_IMAGE}"
        imagePullPolicy: Always
        ports:
        - containerPort: 80