apiVersion : apps/v1
kind: Deployment
metadata:
  name: "admin-frontend"
  namespace: default
spec:
  replicas: 1
  revisionHistoryLimit: 0
  selector:
    matchLabels:
      app: "admin-frontend"
  template:
    metadata:
      annotations:
        dapr.io/enabled: "true"
        dapr.io/app-id: "admin-frontend"
        dapr.io/app-port: "80"
        prometheus.io/scrape: "true"
        prometheus.io/port: "52323"
      labels:
        app: "admin-frontend"
    spec:
      imagePullSecrets:
        - name: containerregistryauth
      containers:
        - name: "admin-frontend"
          image: "lemonsharp.azurecr.io/admin-frontend"
          ports:
          - name: http
            containerPort: 80
            protocol: TCP
          resources:
            requests:
              memory: "64Mi"
              cpu: "20m"
            limits:
              memory: "128Mi"
              cpu: "100m"
          # livenessProbe:
          #   httpGet:
          #     path: /health
          #     port: http
          #   initialDelaySeconds: 60
          #   periodSeconds: 30
          # readinessProbe:
          #   httpGet:
          #     path: /health
          #     port: http
          #   initialDelaySeconds: 60
          #   periodSeconds: 30
          env:
          - name: DOTNET_DiagnosticPorts
            value: /diag/port
          volumeMounts:
          - mountPath: /diag
            name: diagvol
          - mountPath: /dumps
            name: dumpsvol
        - name: monitor
          image: mcr.microsoft.com/dotnet/monitor:6.0.0
          args: [ "--no-auth" ]
          imagePullPolicy: Always
          ports:
            - containerPort: 52323
          env:
          - name: DOTNETMONITOR_DiagnosticPort__ConnectionMode
            value: Listen
          - name: DOTNETMONITOR_DiagnosticPort__EndpointName
            value: /diag/port
          - name: DOTNETMONITOR_Storage__DumpTempFolder
            value: /dumps
          - name: DOTNETMONITOR_Urls
            value: "http://*:52323"
          volumeMounts:
          - mountPath: /diag
            name: diagvol
          - mountPath: /dumps
            name: dumpsvol
          resources:
            requests:
              cpu: 50m
              memory: 32Mi
            limits:
              cpu: 80m
              memory: 256Mi
      volumes:
      - name: diagvol
        emptyDir: {}
      - name: dumpsvol
        emptyDir: {}