apiVersion: apps/v1
kind: Deployment
metadata:
  name: ticketing
  namespace: business-service-progressio
  labels:
    app: ticketing
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ticketing
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  template:
    metadata:
      labels:
        app: ticketing
        date: DATE_DEPLOYMENT
    spec:
      containers:
      - name: ticketing
        image: registry.computaceae-it.tech/cit-ticketing:DEPLOY_COMMIT_HASH
        imagePullPolicy: Always
        env:
          - name: APP_GITHUB_TOKEN
            valueFrom:
              secretKeyRef:
                name: ticketing-token
                key: app.token.github
          - name: APP_ADMIN_MAIL
            valueFrom:
              secretKeyRef:
                name: ticketing-token
                key: app.admin.mail
          - name: APP_GITHUB_USER
            value: Computaceae-IT
          - name: APP_GITHUB_REPOSITORY
            value: cit-ticketing
        resources:
          requests:
            cpu: 100m
            memory: 70Mi
          limits:
            cpu: 700m
            memory: 300Mi
        ports:
        - name: http
          containerPort: 3335
          protocol: TCP
        startupProbe:
          httpGet:
            path: /actuator/health
            port: 3335
          initialDelaySeconds: 60
          failureThreshold: 6
          periodSeconds: 30
        readinessProbe:
          httpGet:
            path: /actuator/health
            port: 3335
          initialDelaySeconds: 10
          timeoutSeconds: 3
          periodSeconds: 30
          failureThreshold: 3
        livenessProbe:
          httpGet:
            path: /actuator/health
            port: 3335
          initialDelaySeconds: 10
          timeoutSeconds: 3
          periodSeconds: 30
          failureThreshold: 3
