apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: conduit-nodejs
  name: conduit-nodejs
  namespace: ambiente
spec:
  replicas: 1
  selector:
    matchLabels:
      app: conduit-nodejs
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: conduit-nodejs
    spec:
      imagePullSecrets:
        - name: hub-fagurto-cr
      containers:
        - image: pedominguezbr8863.hub.fagurto.dev/backends/api:commit
          imagePullPolicy: IfNotPresent
          name: conduit-nodejs
          ports:
            - containerPort: 8080
              name: 8080tcp01s
              protocol: TCP
          env:
            - name: USER_NAME
              valueFrom:
                secretKeyRef:
                  name: postgress-auth
                  key: username
            - name: PASSWORD
              valueFrom:
                secretKeyRef:
                  name: postgress-auth
                  key: password
            - name: DB_HOST
              valueFrom:
                secretKeyRef:
                  name: postgress-auth
                  key: host
            - name: DATABASE
              valueFrom:
                secretKeyRef:
                  name: postgress-auth
                  key: database
          # readinessProbe:
          #   failureThreshold: 3
          #   httpGet:
          #     path: /health
          #     port: 8080
          #     scheme: HTTP
          #   initialDelaySeconds: 10
          #   periodSeconds: 2
          #   successThreshold: 2
          #   timeoutSeconds: 2
          # livenessProbe:
          #   failureThreshold: 3
          #   httpGet:
          #     path: /health
          #     port: 8080
          #     scheme: HTTP
          #   initialDelaySeconds: 10
          #   periodSeconds: 2
          #   successThreshold: 1
          #   timeoutSeconds: 2
          resources: { }
          securityContext:
            allowPrivilegeEscalation: false
            capabilities: {}
            privileged: false
            readOnlyRootFilesystem: false
            runAsNonRoot: false
          tty: true
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      # volumes:
      #   - configMap:
      #       defaultMode: 256
      #       name: conduit-nodejs
      #       optional: false
      #     name: configuracion