apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: erp-to-czz-input
  name: erp-to-czz-input
spec:
  replicas: 0
  selector:
    matchLabels:
      app: erp-to-czz-input
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: erp-to-czz-input
    spec:
      containers:
        - env:
            - name: SPRING_KAFKA_BOOTSTRAP_SERVERS
            #URL KAFKA access cliente
            # 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
          image: >-
            europe-west3-docker.pkg.dev/czz-devops/comerzzia/erp-to-czz/input-kafka-application:1.0
          imagePullPolicy: Always
          name: erp-to-czz-input
      dnsPolicy: ClusterFirst
      imagePullSecrets:
        - name: regcred-czz
      restartPolicy: Always
      
---
apiVersion: v1
kind: Service
metadata:
  name: erp-to-czz-input-svc
spec:
  ports:
    - name: app
      port: 8080
      protocol: TCP
      targetPort: 8080
    - name: metrics
      port: 8081
      protocol: TCP
      targetPort: 8081
  type: ClusterIP
  selector:
    app: erp-to-czz-input
