apiVersion: apps/v1
kind: Deployment
metadata:
  name: svc-events
  labels:
    app: svc-events
spec:
  replicas: 1
  selector:
    matchLabels:
      app: svc-events
  template:
    metadata:
      labels:
        app: svc-events
    spec:
      initContainers:
        - name: migrations
          image: automation-platform-svc-events-migrations:latest
          imagePullPolicy: Never # todo this will of course break in prod
          volumeMounts:
            - name: events-ap-events-credentials
              mountPath: "/etc/svc-events/secrets/events.ap-events.credentials"
              readOnly: true
      containers:
        - name: app
          image: automation-platform-svc-events:latest # todo find out how to handle this for prod
          imagePullPolicy: Never # todo this will of course break in prod
          volumeMounts:
            - name: events-ap-events-credentials
              mountPath: "/etc/svc-events/secrets/events.ap-events.credentials"
              readOnly: true
      volumes:
        - name: events-ap-events-credentials
          secret:
            secretName: events.ap-events.credentials.postgresql.acid.zalan.do