﻿apiVersion: apps/v1
kind: Deployment
metadata:
  name: twin-webui-deployment
  namespace: industrial-iot
  labels:
    app.kubernetes.io/name: twin-webui-service
    app.kubernetes.io/part-of: industrial-iot
    app.kubernetes.io/version: 2.5.1
    app.kubernetes.io/managed-by: Microsoft.Azure.IIoT.Deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: twin-webui-service
      app.kubernetes.io/part-of: industrial-iot
  template:
    metadata:
      labels:
        app.kubernetes.io/name: twin-webui-service
        app.kubernetes.io/part-of: industrial-iot
        app.kubernetes.io/version: 2.5.1
        app.kubernetes.io/managed-by: Microsoft.Azure.IIoT.Deployment
    spec:
      serviceAccountName: industrial-iot-serviceaccount
      containers:
      - name: twin-webui-service-container
        image: mcr.microsoft.com/iot/opc-twin-webui:2.5.1
        resources:
          requests:
            memory: "64Mi"
            cpu: "50m"
          limits:
            memory: "512Mi"
            cpu: "250m"
        env:
        - name: REACT_APP_PCS_AUTH_REQUIRED
          valueFrom:
            secretKeyRef:
              name: industrial-iot-env
              key: REACT_APP_PCS_AUTH_REQUIRED
        - name: REACT_APP_PCS_AUTH_ISSUER
          valueFrom:
            secretKeyRef:
              name: industrial-iot-env
              key: REACT_APP_PCS_AUTH_ISSUER
        - name: REACT_APP_PCS_AUTH_AUDIENCE
          valueFrom:
            secretKeyRef:
              name: industrial-iot-env
              key: REACT_APP_PCS_AUTH_AUDIENCE
        - name: REACT_APP_PCS_WEBUI_AUTH_AAD_APPID
          valueFrom:
            secretKeyRef:
              name: industrial-iot-env
              key: REACT_APP_PCS_WEBUI_AUTH_AAD_APPID
        - name: REACT_APP_PCS_WEBUI_AUTH_AAD_AUTHORITY
          valueFrom:
            secretKeyRef:
              name: industrial-iot-env
              key: REACT_APP_PCS_WEBUI_AUTH_AAD_AUTHORITY
        - name: REACT_APP_PCS_WEBUI_AUTH_AAD_TENANT
          valueFrom:
            secretKeyRef:
              name: industrial-iot-env
              key: REACT_APP_PCS_WEBUI_AUTH_AAD_TENANT
        - name: REACT_APP_PCS_TWIN_REGISTRY_URL
          valueFrom:
            secretKeyRef:
              name: industrial-iot-env
              key: REACT_APP_PCS_TWIN_REGISTRY_URL
        - name: REACT_APP_PCS_TWIN_SERVICE_URL
          valueFrom:
            secretKeyRef:
              name: industrial-iot-env
              key: REACT_APP_PCS_TWIN_SERVICE_URL
