kind: Deployment
apiVersion: apps/v1
metadata:
  name: events-service
  labels:
    app: events-service
spec:
  replicas: 1
  selector:
    matchLabels:
      app: events-service
      deploymentconfig: events-service
  template:
    metadata:
      labels:
        app: events-service
        deploymentconfig: events-service
    spec:
      containers:
        - name: events-service
          image: quay.io/smart-city-with-rh-cloud-services/event-service:latest
          ports:
            - containerPort: 8080
              protocol: TCP
          env:
            - name: DB_HOST
              value: postgresql
            - name: DB_NAME
              valueFrom:
                secretKeyRef:
                  name: postgresql
                  key: database-name
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: postgresql
                  key: database-password
            - name: DB_USER
              valueFrom:
                secretKeyRef:
                  name: postgresql
                  key: database-user
            - name: KAFKA_CONSUMER_GROUP_ID
              value: event_consumer_group
            - name: KAFKA_ENDPOINT
              value: core-kafka-kafka-bootstrap:9092
            - name: KAFKA_TOPIC
              value: lpr
            - name: TABLE_NAME
              value: event
          resources: {}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: Always
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext: {}
      schedulerName: default-scheduler
