# Tell us about your experience using dotnet monitor: https://aka.ms/dotnet-monitor-survey apiVersion: apps/v1 kind: Deployment metadata: name: deploy-exampleapp spec: replicas: 1 selector: matchLabels: app: exampleapp template: metadata: labels: app: exampleapp spec: restartPolicy: Always containers: - name: app image: mcr.microsoft.com/dotnet/samples:aspnetapp-chiseled imagePullPolicy: Always env: - name: DOTNET_DiagnosticPorts value: /diag/dotnet-monitor.sock volumeMounts: - mountPath: /diag name: diagvol resources: limits: cpu: 250m memory: 512Mi - name: monitor image: mcr.microsoft.com/dotnet/monitor:8 # DO NOT use the --no-auth argument for deployments in production; this argument is used for demonstration # purposes only in this example. Please continue reading after this example for further details. args: [ "collect", "--no-auth" ] imagePullPolicy: Always env: - name: DOTNETMONITOR_DiagnosticPort__ConnectionMode value: Listen - name: DOTNETMONITOR_Storage__DefaultSharedPath value: /diag # ALWAYS use the HTTPS form of the URL for deployments in production; the removal of HTTPS is done for # demonstration purposes only in this example. Please continue reading after this example for further details. - name: DOTNETMONITOR_Urls value: http://localhost:52323 # The metrics URL is set in the CMD instruction of the image by default. However, this deployment overrides that with the args setting; manually set the URL to the same value using configuration. - name: DOTNETMONITOR_Metrics__Endpoints value: http://+:52325 volumeMounts: - mountPath: /diag name: diagvol resources: requests: cpu: 50m memory: 32Mi limits: cpu: 250m memory: 256Mi volumes: - name: diagvol emptyDir: {}