apiVersion: apps/v1
kind: Deployment
metadata:
  name: ao-fe
spec:
  replicas: 3
  selector:
    matchLabels:
      app: ao-fe
  template:
    metadata:
      labels:
        app: ao-fe
        aadpodidbinding: PROVIDE
    spec:
      nodeSelector:
        "beta.kubernetes.io/os": linux
        aoapp: always-on
      containers:
      - name: ao-fe
        image: REGISTRY_NAME.azurecr.io/ao/ao.fe:latest
        securityContext:
          capabilities:
            drop:
            - NET_RAW
        resources:
          requests:
            cpu: 500m
            memory: 512Mi
          limits:
            cpu: 2000m
            memory: 2048Mi
        ports:
        - containerPort: 80
        volumeMounts:
        - name: secrets-store-inline
          mountPath: "/mnt/secrets-store"
          readOnly: true
        env:
        - name: AzureRegion
          valueFrom:
            secretKeyRef:
              name: ao-secrets
              key: AzureRegion
        - name: APPLICATIONINSIGHTS_CONNECTION_STRING
          valueFrom:
            secretKeyRef:
              name: ao-secrets
              key: AppInsightsConnectionString
        - name: CosmosDbConnectionString
          valueFrom:
            secretKeyRef:
              name: ao-secrets
              key: CosmosDbConnectionString
        - name: CosmosDbDatabaseName
          valueFrom:
            secretKeyRef:
              name: ao-secrets
              key: CosmosDbDatabaseName
        - name: CosmosDbProfileContainerName
          valueFrom:
            secretKeyRef:
              name: ao-secrets
              key: CosmosDbProfileContainerName
        - name: CosmosDbProgressContainerName
          valueFrom:
            secretKeyRef:
              name: ao-secrets
              key: CosmosDbProgressContainerName
        - name: StorageAccountConnString
          valueFrom:
            secretKeyRef:
              name: ao-secrets
              key: StorageAccountConnString
        - name: StorageAccountName
          valueFrom:
            secretKeyRef:
              name: ao-secrets
              key: StorageAccountName
        - name: StorageContainerName
          valueFrom:
            secretKeyRef:
              name: ao-secrets
              key: StorageContainerName
        - name: EventHubConnectionString
          valueFrom:
            secretKeyRef:
              name: ao-secrets
              key: EventHubConnectionString
        - name: EventHubName
          valueFrom:
            secretKeyRef:
              name: ao-secrets
              key: EventHubName
        - name: EventHubConsumerGroup
          valueFrom:
            secretKeyRef:
              name: ao-secrets
              key: EventHubConsumerGroup
        - name: EventHubReceiverBatchSize
          valueFrom:
            secretKeyRef:
              name: ao-secrets
              key: EventHubReceiverBatchSize
      volumes:
      - name: secrets-store-inline
        csi:
          driver: secrets-store.csi.k8s.io
          readOnly: true
          volumeAttributes:
            secretProviderClass: "azure-kv-secrets-provider"
