---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: iot-device-registry
  namespace: iot
  labels:
    app: iot-device-registry
  annotations:
    fluxcd.io/automated: "true"
    fluxcd.io/tag.iot-device-registry: glob:prod-*
spec:
  replicas: 1
  selector:
    matchLabels:
      app: iot-device-registry
  strategy:
    rollingUpdate:
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: "true"
      labels:
        app: iot-device-registry
    spec:
      containers:
      - name: iot-device-registry
        image: docker.pkg.github.com/iot-for-tillgenglighet/iot-device-registry/iot-device-registry:prod-2698fcb929f3826c265a7dbd4842eea470a4d925
        imagePullPolicy: IfNotPresent
        env:
        - name: DIWISE_SQLDB_HOST
          valueFrom:
            secretKeyRef:
              name: iot-device-registry-envvar
              key: db-host
        - name: DIWISE_SQLDB_NAME
          valueFrom:
            secretKeyRef:
              name: iot-device-registry-envvar
              key: db-name
        - name: DIWISE_SQLDB_USER
          valueFrom:
            secretKeyRef:
              name: iot-device-registry-envvar
              key: db-user
        - name: DIWISE_SQLDB_PASSWORD
          valueFrom:
            secretKeyRef:
              name: iot-device-registry-envvar
              key: db-password
        - name: SERVICE_PORT
          value: '8686'
        - name: RABBITMQ_HOST
          value: rabbitmq.iot.svc.cluster.local
        ports:
        - containerPort: 8686
          name: http
          protocol: TCP
      imagePullSecrets:
      - name: regcred
