Small update about the post from yesterday, if your Kubernetes cluster is not exposed publicly, you can also choose to just disable the security check by adding the ‘--no-auth’ argument.
Here is the updated yaml file:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: dotnet-monitor-example | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: dotnet-monitor-example | |
template: | |
metadata: | |
labels: | |
app: dotnet-monitor-example | |
spec: | |
volumes: | |
- name: diagnostics | |
emptyDir: {} | |
containers: | |
- name: server | |
image: mcr.microsoft.com/dotnet/core/samples:aspnetapp | |
ports: | |
- containerPort: 80 | |
volumeMounts: | |
- mountPath: /tmp | |
name: diagnostics | |
- name: sidecar | |
image: mcr.microsoft.com/dotnet/monitor:5.0.0-preview.5 | |
ports: | |
- containerPort: 52323 | |
args: ["--no-auth", "--urls", "http://*:52323", "--metricUrls", "http://*:52325"] | |
volumeMounts: | |
- name: diagnostics | |
mountPath: /tmp |