Skip to content

Commit

Permalink
Fix Caddy prometheus configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf authored and roboquat committed Sep 23, 2021
1 parent 8a004b8 commit e9bc08a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
# Allow prometheus scraping from proxy /metrics endpoint
- ports:
- protocol: TCP
port: 9145
port: 9500
from:
- namespaceSelector:
matchLabels:
Expand Down
28 changes: 27 additions & 1 deletion chart/templates/proxy-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,33 @@ spec:
- -c
- "sysctl -w net.core.somaxconn=32768; sysctl -w net.ipv4.ip_local_port_range='1024 65000'"
containers:
{{ include "gitpod.kube-rbac-proxy" $this | indent 6 }}
# TODO: remove once Caddy can listen only in localhost
- name: kube-rbac-proxy
args:
- --v=10
- --logtostderr
- --insecure-listen-address=[$(IP)]:9500
- --upstream=http://127.0.0.1:9545/
env:
- name: IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
image: quay.io/brancz/kube-rbac-proxy:v0.11.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9500
name: metrics
protocol: TCP
resources:
requests:
cpu: 1m
memory: 30Mi
securityContext:
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65532
- name: proxy
image: {{ template "gitpod.comp.imageFull" $this }}
{{ include "gitpod.container.imagePullPolicy" $this | indent 8 }}
Expand Down
3 changes: 2 additions & 1 deletion components/proxy/conf/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@
respond /ready 200
}

localhost:9500 {
# TODO: refactor once we can listen only in localhost
:9545 {
metrics /metrics {
disable_openmetrics
}
Expand Down

0 comments on commit e9bc08a

Please sign in to comment.