apiVersion: apps/v1
kind: Deployment
metadata:
  name: cicd-deploy # TODO: change this deployment name, and make sure it matches the DEPLOYMENT_NAME env in cicd.yml
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cicd-lable #TODO: change this label
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  minReadySeconds: 60
  template:
    metadata:
      labels:
        app: cicd-lable #TODO: change this label
    spec:
      containers:
        - name: cicd #TODO: change this container name
          # don't change the image name, it will be replaced by the IMAGE env in cicd.yml
          image: cicd-image:latest
          # add environment variables here, if you need
          env:
            - name: ENV
              value: "prod"
          # secrets are mounted as files, so you can use them in your code
          volumeMounts:
            - name: config-prod
              mountPath: "/apps/config"
              readOnly: true
          ports:
            - containerPort: 80
          resources:
            requests:
              cpu: 250m
              memory: 512Mi
            limits:
              cpu: 250m
              memory: 512Mi
      # secrets are mounted as files, so you can use them in your code, but you need to mount them first
      volumes:
        - name: config-prod
          secret:
            secretName: cicd-secret #TODO: change this secret name, and make sure it matches the secret name in secret.yml