apiVersion: apps/v1
kind: Deployment
metadata:
  name: sources-facebook-events-router
  namespace: default
  labels:
    app: sources-facebook-events-router
    type: sources-facebook
spec:
  replicas: 0
  selector:
    matchLabels:
      app: sources-facebook-events-router
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: sources-facebook-events-router
    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: FACEBOOK_APP_ID
          valueFrom:
            configMapKeyRef:
              name: sources-config
              key: FACEBOOK_APP_ID
        - name: SERVICE_NAME
          value: facebook-events-router
        livenessProbe:
          tcpSocket:
            port: 6000
          initialDelaySeconds: 60
          periodSeconds: 10
          failureThreshold: 3
