mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(helm)!: remove prometheus-http port declaration from coderd service spec (#12214)
This PR removes the prometheus-http port entirely from the coder service specification (originally added in #10448). It also removes the Helm value coder.service.prometheusNodePort. Rationale: some cloud providers will helpfully expose all ports on a LoadBalancer service for you. The net effect of this is that setting CODER_PROMETHEUS_ENABLE will end up exposing port 2112 on your coderd service to the internet, which is likely undesired behaviour.
This commit is contained in:
@@ -35,8 +35,28 @@ The Prometheus endpoint can be enabled in the
|
||||
[Helm chart's](https://github.com/coder/coder/tree/main/helm) `values.yml` by
|
||||
setting the environment variable `CODER_PROMETHEUS_ADDRESS` to `0.0.0.0:2112`.
|
||||
The environment variable `CODER_PROMETHEUS_ENABLE` will be enabled
|
||||
automatically. A Service Endpoint will also be exposed allowing Prometheus
|
||||
Service Monitors to be used.
|
||||
automatically. A Service Endpoint will not be exposed; if you need to expose the
|
||||
Prometheus port on a Service, (for example, to use a `ServiceMonitor`), create a
|
||||
separate headless service instead:
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: coder-prom
|
||||
namespace: coder
|
||||
spec:
|
||||
clusterIP: None
|
||||
ports:
|
||||
- name: prom-http
|
||||
port: 2112
|
||||
protocol: TCP
|
||||
targetPort: 2112
|
||||
selector:
|
||||
app.kubernetes.io/instance: coder
|
||||
app.kubernetes.io/name: coder
|
||||
type: ClusterIP
|
||||
```
|
||||
|
||||
### Prometheus configuration
|
||||
|
||||
|
||||
Reference in New Issue
Block a user