apiVersion: apps/v1
kind: Deployment
metadata:
  name: azure-vote-front
spec:
  replicas: 1
  selector:
    matchLabels:
      app: azure-vote-front
  template:
    metadata:
      labels:
        app: azure-vote-front
        aadpodidbinding: PROVIDE
    spec:
      nodeSelector:
        "beta.kubernetes.io/os": linux
      containers:
      - name: azure-vote-front
        image: mcr.microsoft.com/azuredocs/azure-vote-front:v1
        securityContext:
          capabilities:
            drop:
            - NET_RAW
        resources:
          requests:
            cpu: 100m
            memory: 128Mi
          limits:
            cpu: 250m
            memory: 256Mi
        ports:
        - containerPort: 80
        volumeMounts:
        - name: secrets-store-inline
          mountPath: "/mnt/secrets-store"
          readOnly: true
        env:
        - name: REDIS
          value: "azure-vote-back"
        - name: APPLICATIONINSIGHTS_CONNECTION_STRING
          valueFrom:
            secretKeyRef:
              name: ao-secrets
              key: APPLICATIONINSIGHTS_CONNECTION_STRING
        - 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
      volumes:
      - name: secrets-store-inline
        csi:
          driver: secrets-store.csi.k8s.io
          readOnly: true
          volumeAttributes:
            secretProviderClass: "azure-kv-secrets-provider"
