apiVersion: apps/v1
kind: Deployment
metadata:
  name: zuul-deployment
  namespace: imxc
  labels:
    app: cloud
spec:
  selector:
    matchLabels:
      app: cloud
  replicas: 1
  template:
    metadata:
      labels:
        app: cloud
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: cmoa
                operator: In
                values:
                - worker2
      containers:
        - env:
            - name: SPRING_PROFILES_ACTIVE
              value: prd
            - name: SPRING_ZIPKIN_BASE-URL
              value: http://zipkin-service:9411
            - name: LOGGING_LEVEL_COM_EXEM_CLOUD_ZUULSERVER_FILTERS_AUTHFILTER
              value: info
            # log4j
            - name: LOG4J_FORMAT_MSG_NO_LOOKUPS
              value: "true"
          name: zuul
          image: {{ .Values.global.IMXC_IN_REGISTRY }}/zuul-server:{{ .Values.global.ZUUL_SERVER_VERSION }}
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 8080
              #- containerPort: 6831
              #protocol: UDP
          #resources:
          #  requests:
          #    memory: "256Mi"
          #    cpu: "344m"
          #  limits:
          #    memory: "1Gi"
          #    cpu: "700m"
          resources:
            requests:
              memory: "200Mi"
              cpu: "50m"
---
apiVersion: v1
kind: Service
metadata:
  name: zuul
  namespace: imxc
  labels:
    app: cloud
spec:
  type: NodePort
  selector:
    app: cloud
  ports:
    - port: 8080
      targetPort: 8080
      nodePort: 31081
