Skip to content

Commit 7bf82ea

Browse files
committed
refactor: create new server block and follow cursor changes
1 parent 97c635e commit 7bf82ea

File tree

2 files changed

+52
-10
lines changed

2 files changed

+52
-10
lines changed

components/konflux-ui/staging/base/proxy/nginx.conf

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ http {
3434
}
3535

3636
server {
37-
listen 8888;
3837
listen 9443 ssl;
3938
ssl_certificate /mnt/tls.crt;
4039
ssl_certificate_key /mnt/tls.key;
@@ -46,12 +45,6 @@ http {
4645
try_files $uri /index.html;
4746
}
4847

49-
location /nginx_status {
50-
stub_status;
51-
allow 127.0.0.1;
52-
deny all;
53-
}
54-
5548
location = /404.html {
5649
}
5750

@@ -136,4 +129,20 @@ http {
136129

137130
include /mnt/nginx-additional-location-configs/*.conf;
138131
}
132+
133+
server {
134+
listen 9090;
135+
server_name _;
136+
137+
location /metrics {
138+
stub_status on;
139+
access_log off;
140+
allow all;
141+
}
142+
143+
location /health {
144+
return 200 'healthy';
145+
add_header Content-Type text/plain;
146+
}
147+
}
139148
}

components/konflux-ui/staging/base/proxy/proxy.yaml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ spec:
117117
- containerPort: 8080
118118
name: web
119119
protocol: TCP
120-
- containerPort: 8888
121-
name: web-metrics
122-
protocol: TCP
123120
- containerPort: 9443
124121
name: web-tls
125122
protocol: TCP
@@ -215,6 +212,26 @@ spec:
215212
secretName: proxy
216213
- name: static-content
217214
emptyDir: {}
215+
- image: nginx/nginx-prometheus-exporter:1.1.0
216+
name: nginx-prometheus-exporter
217+
args:
218+
- -nginx.scrape-uri=http://localhost:9090/metrics
219+
- -web.listen-address=:9113
220+
ports:
221+
- containerPort: 9113
222+
name: exporter
223+
protocol: TCP
224+
resources:
225+
limits:
226+
cpu: 100m
227+
memory: 64Mi
228+
requests:
229+
cpu: 10m
230+
memory: 32Mi
231+
securityContext:
232+
readOnlyRootFilesystem: true
233+
runAsNonRoot: true
234+
runAsUser: 1001
218235
---
219236
apiVersion: v1
220237
kind: Service
@@ -303,3 +320,19 @@ subjects:
303320
- kind: ServiceAccount
304321
name: proxy
305322
namespace: konflux-ui
323+
---
324+
apiVersion: monitoring.coreos.com/v1
325+
kind: ServiceMonitor
326+
metadata:
327+
name: proxy-nginx-metrics
328+
labels:
329+
app: proxy
330+
spec:
331+
endpoints:
332+
- port: exporter
333+
path: /metrics
334+
interval: 30s
335+
scheme: http
336+
selector:
337+
matchLabels:
338+
app: proxy

0 commit comments

Comments
 (0)