---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-transportation
  namespace: iot
  labels:
    app: api-transportation
  annotations:
    fluxcd.io/automated: "true"
    fluxcd.io/tag.api-transportation: glob:prod-*
spec:
  replicas: 5
  selector:
    matchLabels:
      app: api-transportation
  strategy:
    rollingUpdate:
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: "true"
      labels:
        app: api-transportation
    spec:
      containers:
      - name: api-transportation
        image: docker.pkg.github.com/iot-for-tillgenglighet/api-transportation/api-transportation:prod-9ea16668b0a19c7f8b0683ba5da0dbe1dde70cea
        imagePullPolicy: IfNotPresent
        env:
        - name: TRANSPORTATION_DB_HOST
          valueFrom:
            secretKeyRef:
              name: api-transportation-envvar
              key: db-host
        - name: TRANSPORTATION_DB_NAME
          valueFrom:
            secretKeyRef:
              name: api-transportation-envvar
              key: db-name
        - name: TRANSPORTATION_DB_USER
          valueFrom:
            secretKeyRef:
              name: api-transportation-envvar
              key: db-user
        - name: TRANSPORTATION_DB_PASSWORD
          valueFrom:
            secretKeyRef:
              name: api-transportation-envvar
              key: db-password
        - name: TRANSPORTATION_API_PORT
          value: '8484'
        - name: RABBITMQ_HOST
          value: 'rabbitmq.iot.svc.cluster.local'
        ports:
        - containerPort: 8484
          name: http
          protocol: TCP
        readinessProbe:
          httpGet:
            path: /health
            port: 8484
      imagePullSecrets:
      - name: regcred
