Skip to content

Commit e773f77

Browse files
authored
Move deployment samples from Markdown files to ready-to-deploy sample files (#7926)
1 parent c616f99 commit e773f77

File tree

4 files changed

+114
-280
lines changed

4 files changed

+114
-280
lines changed

documentation/docker-compose.md

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -12,65 +12,7 @@ Starting with .NET 8.0, both the sample ASP.NET application and dotnet-monitor r
1212

1313
## Example Deployment
1414

15-
The following examples demonstrate a deployment of the dotnet-monitor container image monitoring an application container as services.
16-
17-
<details>
18-
<summary>.NET Monitor 8+</summary>
19-
20-
```yaml
21-
# Tell us about your experience using dotnet monitor: https://aka.ms/dotnet-monitor-survey
22-
services:
23-
app:
24-
image: mcr.microsoft.com/dotnet/samples:aspnetapp-chiseled
25-
ports:
26-
- "8080:8080"
27-
environment:
28-
- DOTNET_DiagnosticPorts=/diag/dotnet-monitor.sock
29-
volumes:
30-
- diagvol:/diag
31-
deploy:
32-
resources:
33-
limits:
34-
cpus: '0.250'
35-
memory: 512M
36-
37-
monitor:
38-
image: mcr.microsoft.com/dotnet/monitor:8
39-
# DO NOT use the --no-auth argument for deployments in production; this argument is used for demonstration
40-
# purposes only in this example. Please continue reading after this example for further details.
41-
command: ["collect", "--no-auth"]
42-
ports:
43-
- "52323:52323"
44-
- "52325:52325"
45-
environment:
46-
- DOTNETMONITOR_DiagnosticPort__ConnectionMode=Listen
47-
- DOTNETMONITOR_Storage__DefaultSharedPath=/diag
48-
# ALWAYS use the HTTPS form of the URL for deployments in production; the removal of HTTPS is done for
49-
# demonstration purposes only in this example. Please continue reading after this example for further details.
50-
- DOTNETMONITOR_Urls=http://+:52323
51-
# 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.
52-
- DOTNETMONITOR_Metrics__Endpoints=http://+:52325
53-
# The image will output logging in a json format by default, which is great for ingestion by tools such as Azure Monitor Log Analytics.
54-
# Switch the logging format to simple for this sample for easier reading.
55-
- Logging__Console__FormatterName=simple
56-
volumes:
57-
- diagvol:/diag
58-
deploy:
59-
resources:
60-
reservations:
61-
cpus: '0.050'
62-
memory: 50M
63-
limits:
64-
cpus: '0.250'
65-
memory: 256M
66-
67-
volumes:
68-
diagvol:
69-
driver_opts:
70-
type: tmpfs
71-
device: tmpfs
72-
```
73-
</details>
15+
The [Docker Compose](../samples/Docker/compose.yaml) example demonstrates a deployment of the .NET Monitor 8 container image monitoring an application container as services.
7416

7517
## Example Details
7618

documentation/kubernetes.md

Lines changed: 1 addition & 221 deletions
Original file line numberDiff line numberDiff line change
@@ -12,227 +12,7 @@ Starting with .NET 8.0, both the sample ASP.NET application and dotnet-monitor r
1212

1313
## Example Deployment
1414

15-
The following examples demonstrate a deployment of the dotnet-monitor container image monitoring an application container within the same pod.
16-
17-
<details>
18-
<summary>.NET Monitor 6</summary>
19-
20-
```yaml
21-
# Tell us about your experience using dotnet monitor: https://aka.ms/dotnet-monitor-survey
22-
apiVersion: apps/v1
23-
kind: Deployment
24-
metadata:
25-
name: deploy-exampleapp
26-
spec:
27-
replicas: 1
28-
selector:
29-
matchLabels:
30-
app: exampleapp
31-
template:
32-
metadata:
33-
labels:
34-
app: exampleapp
35-
spec:
36-
restartPolicy: Always
37-
containers:
38-
- name: app
39-
image: mcr.microsoft.com/dotnet/samples:aspnetapp
40-
imagePullPolicy: Always
41-
env:
42-
- name: ASPNETCORE_URLS
43-
value: http://+:8080
44-
- name: DOTNET_DiagnosticPorts
45-
value: /diag/dotnet-monitor.sock
46-
volumeMounts:
47-
- mountPath: /diag
48-
name: diagvol
49-
resources:
50-
limits:
51-
cpu: 250m
52-
memory: 512Mi
53-
- name: monitor
54-
image: mcr.microsoft.com/dotnet/monitor:6
55-
securityContext:
56-
# Default APP_UID for non-root dotnet application images
57-
runAsUser: 1654
58-
runAsGroup: 1654
59-
runAsNonRoot: true
60-
# DO NOT use the --no-auth argument for deployments in production; this argument is used for demonstration
61-
# purposes only in this example. Please continue reading after this example for further details.
62-
args: [ "--no-auth" ]
63-
imagePullPolicy: Always
64-
env:
65-
- name: DOTNETMONITOR_DiagnosticPort__ConnectionMode
66-
value: Listen
67-
- name: DOTNETMONITOR_DiagnosticPort__EndpointName
68-
value: /diag/dotnet-monitor.sock
69-
- name: DOTNETMONITOR_Storage__DumpTempFolder
70-
value: /diag/dumps
71-
# ALWAYS use the HTTPS form of the URL for deployments in production; the removal of HTTPS is done for
72-
# demonstration purposes only in this example. Please continue reading after this example for further details.
73-
- name: DOTNETMONITOR_Urls
74-
value: http://localhost:52323
75-
volumeMounts:
76-
- mountPath: /diag
77-
name: diagvol
78-
resources:
79-
requests:
80-
cpu: 50m
81-
memory: 32Mi
82-
limits:
83-
cpu: 250m
84-
memory: 256Mi
85-
volumes:
86-
- name: diagvol
87-
emptyDir: {}
88-
```
89-
90-
</details>
91-
92-
<details>
93-
<summary>.NET Monitor 7</summary>
94-
95-
```yaml
96-
# Tell us about your experience using dotnet monitor: https://aka.ms/dotnet-monitor-survey
97-
apiVersion: apps/v1
98-
kind: Deployment
99-
metadata:
100-
name: deploy-exampleapp
101-
spec:
102-
replicas: 1
103-
selector:
104-
matchLabels:
105-
app: exampleapp
106-
template:
107-
metadata:
108-
labels:
109-
app: exampleapp
110-
spec:
111-
restartPolicy: Always
112-
containers:
113-
- name: app
114-
image: mcr.microsoft.com/dotnet/samples:aspnetapp
115-
imagePullPolicy: Always
116-
env:
117-
- name: ASPNETCORE_URLS
118-
value: http://+:8080
119-
- name: DOTNET_DiagnosticPorts
120-
value: /diag/dotnet-monitor.sock
121-
volumeMounts:
122-
- mountPath: /diag
123-
name: diagvol
124-
resources:
125-
limits:
126-
cpu: 250m
127-
memory: 512Mi
128-
- name: monitor
129-
image: mcr.microsoft.com/dotnet/monitor:7
130-
securityContext:
131-
# Default APP_UID for non-root dotnet application images
132-
runAsUser: 1654
133-
runAsGroup: 1654
134-
runAsNonRoot: true
135-
# DO NOT use the --no-auth argument for deployments in production; this argument is used for demonstration
136-
# purposes only in this example. Please continue reading after this example for further details.
137-
args: [ "collect", "--no-auth" ]
138-
imagePullPolicy: Always
139-
env:
140-
- name: DOTNETMONITOR_DiagnosticPort__ConnectionMode
141-
value: Listen
142-
- name: DOTNETMONITOR_Storage__DefaultSharedPath
143-
value: /diag
144-
# ALWAYS use the HTTPS form of the URL for deployments in production; the removal of HTTPS is done for
145-
# demonstration purposes only in this example. Please continue reading after this example for further details.
146-
- name: DOTNETMONITOR_Urls
147-
value: http://localhost:52323
148-
# 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.
149-
- name: DOTNETMONITOR_Metrics__Endpoints
150-
value: http://+:52325
151-
volumeMounts:
152-
- mountPath: /diag
153-
name: diagvol
154-
resources:
155-
requests:
156-
cpu: 50m
157-
memory: 32Mi
158-
limits:
159-
cpu: 250m
160-
memory: 256Mi
161-
volumes:
162-
- name: diagvol
163-
emptyDir: {}
164-
```
165-
166-
</details>
167-
168-
<details>
169-
<summary>.NET Monitor 8+</summary>
170-
171-
```yaml
172-
# Tell us about your experience using dotnet monitor: https://aka.ms/dotnet-monitor-survey
173-
apiVersion: apps/v1
174-
kind: Deployment
175-
metadata:
176-
name: deploy-exampleapp
177-
spec:
178-
replicas: 1
179-
selector:
180-
matchLabels:
181-
app: exampleapp
182-
template:
183-
metadata:
184-
labels:
185-
app: exampleapp
186-
spec:
187-
restartPolicy: Always
188-
containers:
189-
- name: app
190-
image: mcr.microsoft.com/dotnet/samples:aspnetapp
191-
imagePullPolicy: Always
192-
env:
193-
- name: ASPNETCORE_URLS
194-
value: http://+:8080
195-
- name: DOTNET_DiagnosticPorts
196-
value: /diag/dotnet-monitor.sock
197-
volumeMounts:
198-
- mountPath: /diag
199-
name: diagvol
200-
resources:
201-
limits:
202-
cpu: 250m
203-
memory: 512Mi
204-
- name: monitor
205-
image: mcr.microsoft.com/dotnet/monitor:8
206-
# DO NOT use the --no-auth argument for deployments in production; this argument is used for demonstration
207-
# purposes only in this example. Please continue reading after this example for further details.
208-
args: [ "collect", "--no-auth" ]
209-
imagePullPolicy: Always
210-
env:
211-
- name: DOTNETMONITOR_DiagnosticPort__ConnectionMode
212-
value: Listen
213-
- name: DOTNETMONITOR_Storage__DefaultSharedPath
214-
value: /diag
215-
# ALWAYS use the HTTPS form of the URL for deployments in production; the removal of HTTPS is done for
216-
# demonstration purposes only in this example. Please continue reading after this example for further details.
217-
- name: DOTNETMONITOR_Urls
218-
value: http://localhost:52323
219-
# 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.
220-
- name: DOTNETMONITOR_Metrics__Endpoints
221-
value: http://+:52325
222-
volumeMounts:
223-
- mountPath: /diag
224-
name: diagvol
225-
resources:
226-
requests:
227-
cpu: 50m
228-
memory: 32Mi
229-
limits:
230-
cpu: 250m
231-
memory: 256Mi
232-
volumes:
233-
- name: diagvol
234-
emptyDir: {}
235-
```
15+
The [Kubernetes Deployment](../samples/Kubernetes/deployment.yaml) example demonstrates a deployment of the .NET Monitor 8 container image monitoring an application container within the same pod.
23616

23717
## Example Details
23818

samples/Docker/compose.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Tell us about your experience using dotnet monitor: https://aka.ms/dotnet-monitor-survey
2+
services:
3+
app:
4+
image: mcr.microsoft.com/dotnet/samples:aspnetapp-chiseled
5+
ports:
6+
- "8080:8080"
7+
environment:
8+
- DOTNET_DiagnosticPorts=/diag/dotnet-monitor.sock
9+
volumes:
10+
- diagvol:/diag
11+
deploy:
12+
resources:
13+
limits:
14+
cpus: '0.250'
15+
memory: 512M
16+
17+
monitor:
18+
image: mcr.microsoft.com/dotnet/monitor:8
19+
# DO NOT use the --no-auth argument for deployments in production; this argument is used for demonstration
20+
# purposes only in this example. Please continue reading after this example for further details.
21+
command: ["collect", "--no-auth"]
22+
ports:
23+
- "52323:52323"
24+
- "52325:52325"
25+
environment:
26+
- DOTNETMONITOR_DiagnosticPort__ConnectionMode=Listen
27+
- DOTNETMONITOR_Storage__DefaultSharedPath=/diag
28+
# ALWAYS use the HTTPS form of the URL for deployments in production; the removal of HTTPS is done for
29+
# demonstration purposes only in this example. Please continue reading after this example for further details.
30+
- DOTNETMONITOR_Urls=http://+:52323
31+
# 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.
32+
- DOTNETMONITOR_Metrics__Endpoints=http://+:52325
33+
# The image will output logging in a json format by default, which is great for ingestion by tools such as Azure Monitor Log Analytics.
34+
# Switch the logging format to simple for this sample for easier reading.
35+
- Logging__Console__FormatterName=simple
36+
volumes:
37+
- diagvol:/diag
38+
deploy:
39+
resources:
40+
reservations:
41+
cpus: '0.050'
42+
memory: 50M
43+
limits:
44+
cpus: '0.250'
45+
memory: 256M
46+
47+
volumes:
48+
diagvol:
49+
driver_opts:
50+
type: tmpfs
51+
device: tmpfs

0 commit comments

Comments
 (0)