apiVersion: apps/v1
kind: Deployment
metadata:
  name: webhook-publisher
  namespace: default
  labels:
    app: webhook-publisher
    type: webhook
spec:
  replicas: 0
  selector:
    matchLabels:
      app: webhook-publisher
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: webhook-publisher
    spec:
      containers:
      - name: app
        image: "{{ .Values.global.containerRegistry}}/{{ .Values.image }}:{{ .Values.global.appImageTag }}"
        imagePullPolicy: Always
        env:
        - name: KAFKA_BROKERS
          valueFrom:
            configMapKeyRef:
              name: kafka-config
              key: KAFKA_BROKERS
        - name: KAFKA_SCHEMA_REGISTRY_URL
          valueFrom:
            configMapKeyRef:
              name: kafka-config
              key: KAFKA_SCHEMA_REGISTRY_URL
        - name: SERVICE_NAME
          value: webhook-publisher
        - name: REDIS_HOSTNAME
          valueFrom:
            configMapKeyRef:
              name: redis-config
              key: REDIS_HOSTNAME
        - name: REDIS_PORT
          valueFrom:
            configMapKeyRef:
              name: redis-config
              key: REDIS_PORT
        livenessProbe:
          tcpSocket:
            port: 6000
          initialDelaySeconds: 60
          periodSeconds: 10
          failureThreshold: 3
