apiVersion: apps/v1
kind: Deployment
metadata:
  name: guest-pin-codes
  namespace: default
  labels:
    app.kubernetes.io/name: guest-pin-codes
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: guest-pin-codes
  template:
    metadata:
      labels:
        app.kubernetes.io/name: guest-pin-codes
    spec:
      tolerations:
        - key: "node.kubernetes.io/disk-pressure"
          operator: "Exists"
          effect: "NoExecute"
          tolerationSeconds: 300
      serviceAccountName: app
      imagePullSecrets:
        - name: regcred
      containers:
        - name: guest-pin-codes
          image: docker-registry:5000/guest-pin-codes:latest
          imagePullPolicy: Always
          command:
            - "sh"
          args:
            - "-c"
            - "/app/entrypoint.sh"
          env:
            - name: DEBUG
            - name: MQTT_HOST
              value: mqtt
            - name: MQTT_PORT
              value: "1883"
            - name: MQTT_USERNAME
              value: "mqtt-username@azurekeyvault"
            - name: MQTT_PASSWORD
              value: "mqtt-password@azurekeyvault"
            - name: DOOR_LOCKS
              value: "guest-pin-codes-door-locks@azurekeyvault"
            - name: GOOGLE_CALENDAR_ID
              value: "guest-pin-codes-google-calendar-id@azurekeyvault"
            - name: GOOGLE_PRIVATE_KEY
              value: "guest-pin-codes-google-private-key@azurekeyvault"
            - name: GUEST_CODE_INDEX_OFFSET
              value: "guest-pin-codes-guest-code-index-offset@azurekeyvault"
            - name: GUEST_LOCK_CODE_EXCLUSIONS
              value: "guest-pin-codes-guest-lock-code-exclusions@azurekeyvault"
            - name: NUMBER_OF_GUEST_CODES
              value: "guest-pin-codes-number-of-guest-codes@azurekeyvault"
