---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ingress-azure-servicebus
  namespace: iot
  labels:
    app: ingress-azure-servicebus
    tier: ingress
  annotations:
    fluxcd.io/automated: "true"
    fluxcd.io/tag.ingress-azure-servicebus: glob:prod-*
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ingress-azure-servicebus
  strategy:
    rollingUpdate:
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: "true"
      labels:
        app: ingress-azure-servicebus
    spec:
      containers:
      - name: ingress-azure-servicebus
        image: docker.pkg.github.com/iot-for-tillgenglighet/ingress-azure-servicebus/ingress-azure-servicebus:prod-588db129a3a02f05204bbb5ca10db252bfd4d12a
        imagePullPolicy: IfNotPresent
        env:
        - name: ASPNETCORE_LOGGING__CONSOLE__DISABLECOLORS
          value: "true"
        - name: DIWISE_ASB_TOPICPATH
          valueFrom:
            secretKeyRef:
              name: ingress-azure-servicebus-envvar
              key: azureservicebus-topicpath
        - name: DIWISE_ASB_SUBSCRIPTIONNAME
          valueFrom:
            secretKeyRef:
              name: ingress-azure-servicebus-envvar
              key: azureservicebus-subscriptionname
        - name: DIWISE_ASB_CONNECTIONSTRING
          valueFrom:
            secretKeyRef:
              name: ingress-azure-servicebus-envvar
              key: azureservicebus-connectionstring
        - name: DIWISE_CONTEXT_BROKER_URL
          value: "https://iotsundsvall.se"
        - name: DIWISE_MAX_SEGMENT_DISTANCE
          value: "30"
        ports:
        - containerPort: 5000
          name: http
          protocol: TCP
        readinessProbe:
          httpGet:
            path: /WeatherForecast
            port: 5000
      imagePullSecrets:
      - name: regcred
