apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: erp-to-czz-processor
  name: erp-to-czz-processor
spec:
  replicas: 1
  selector:
    matchLabels:
      app: erp-to-czz-processor
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: erp-to-czz-processor
    spec:
      containers:
        - env:
            - name: SPRING_KAFKA_BOOTSTRAP_SERVERS
            # Sustituir namespace-cliente por el que corresponda
              value: kafka-svc.namespace-cliente.svc.cluster.local:9092
            - name: ERP_TO_CZZ_MAIN_TOPIC
              value: erp-to-czz-input
            - name: uidActividad
              value: 
            - name: uidInstancia
              value: 
          envFrom:
            - configMapRef:
                name: czz-config
                optional: false
            - secretRef:
                name: czz-db-pass
                optional: false
          image: >-
            europe-west3-docker.pkg.dev/czz-devops/comerzzia/erp-to-czz/processor-kafka-application:1.0
          imagePullPolicy: Always
          name: erp-to-czz-processor
      dnsPolicy: ClusterFirst
      imagePullSecrets:
        - name: regcred-czz
      restartPolicy: Always
      
---
apiVersion: v1
kind: Service
metadata:
  name: erp-to-czz-processor-svc
spec:
  ports:
    - name: apps
      port: 8080
      protocol: TCP
      targetPort: 8080
    - name: metrics
      port: 8081
      protocol: TCP
      targetPort: 8081
  selector:
    app: erp-to-czz-processor




