---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-snowdepth
  namespace: iot
  labels:
    app: api-snowdepth
  annotations:
    fluxcd.io/automated: "true"
    fluxcd.io/tag.api-snowdepth: glob:prod-*
spec:
  replicas: 1
  selector:
    matchLabels:
      app: api-snowdepth
  strategy:
    rollingUpdate:
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: "true"
      labels:
        app: api-snowdepth
    spec:
      containers:
      - name: api-snowdepth
        image: docker.pkg.github.com/iot-for-tillgenglighet/api-snowdepth/api-snowdepth:prod-2a740e3c52a06557ccf5d8a6a0e9757833b2a57d
        imagePullPolicy: IfNotPresent
        env:
        - name: SNOWDEPTH_DB_HOST
          valueFrom:
            secretKeyRef:
              name: api-snowdepth-envvar
              key: db-host
        - name: SNOWDEPTH_DB_USER
          valueFrom:
            secretKeyRef:
              name: api-snowdepth-envvar
              key: db-user
        - name: SNOWDEPTH_DB_NAME
          valueFrom:
            secretKeyRef:
              name: api-snowdepth-envvar
              key: db-name
        - name: SNOWDEPTH_DB_PASSWORD
          valueFrom:
            secretKeyRef:
              name: api-snowdepth-envvar
              key: db-password
        - name: SNOWDEPTH_DB_SSLMODE
          value: 'require'
        - name: SNOWDEPTH_API_PORT
          value: '8282'
        - name: NGSI_CTX_SRC_POINTOFINTEREST
          value: http://api-pointofinterest-service.iot.svc.cluster.local/
        - name: NGSI_CTX_SRC_PROBLEMREPORT
          value: http://api-problemreport-service.iot.svc.cluster.local/
        - name: NGSI_CTX_SRC_TEMPERATURE
          value: http://api-temperature-service.iot.svc.cluster.local/
        - name: NGSI_CTX_SRC_TRANSPORTATION
          value: http://api-transportation-service.iot.svc.cluster.local/
        - name: NGSI_CTX_SRC_DEVICES
          value: http://iot-device-registry-service.iot.svc.cluster.local/
        - name: RABBITMQ_HOST
          value: 'rabbitmq.iot.svc.cluster.local'
        ports:
        - containerPort: 8282
          name: http
          protocol: TCP
      imagePullSecrets:
      - name: regcred



