Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d9a275a

Browse files
committedFeb 20, 2024
add example headless service
1 parent d66bd75 commit d9a275a

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed
 

‎docs/admin/prometheus.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,26 @@ setting the environment variable `CODER_PROMETHEUS_ADDRESS` to `0.0.0.0:2112`.
3737
The environment variable `CODER_PROMETHEUS_ENABLE` will be enabled
3838
automatically. A Service Endpoint will not be exposed; if you need to expose the
3939
Prometheus port on a Service, (for example, to use a `ServiceMonitor`), create a
40-
separate service instead.
40+
separate headless service instead:
41+
42+
```yaml
43+
apiVersion: v1
44+
kind: Service
45+
metadata:
46+
name: coder-prom
47+
namespace: coder
48+
spec:
49+
clusterIP: None
50+
ports:
51+
- name: prom-http
52+
port: 2112
53+
protocol: TCP
54+
targetPort: 2112
55+
selector:
56+
app.kubernetes.io/instance: coder
57+
app.kubernetes.io/name: coder
58+
type: ClusterIP
59+
```
4160
4261
### Prometheus configuration
4362

0 commit comments

Comments
 (0)
Failed to load comments.