Skip to content

Commit d95c3a5

Browse files
committed
fix(demo): use OpenShift-compatible nginx configuration
Fix permission denied errors by: - Using port 8080 instead of 80 (non-root compatible) - Custom nginx.conf with /tmp for cache directories - Proper securityContext for OpenShift - runAsNonRoot and dropped capabilities The visualization is now accessible at the OpenShift route. Signed-off-by: Yossi Ovadia <yovadia@redhat.com>
1 parent 1cd86d8 commit d95c3a5

File tree

1 file changed

+59
-4
lines changed

1 file changed

+59
-4
lines changed

deploy/openshift/demo/flow-viz-deployment.yaml

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,47 @@ data:
88
index.html: |
99
<!-- Content will be added via: kubectl create configmap flow-visualization-html --from-file=index.html=flow-visualization.html -->
1010
---
11+
apiVersion: v1
12+
kind: ConfigMap
13+
metadata:
14+
name: flow-visualization-nginx-config
15+
namespace: vllm-semantic-router-system
16+
data:
17+
nginx.conf: |
18+
worker_processes auto;
19+
error_log /dev/stderr info;
20+
pid /tmp/nginx.pid;
21+
22+
events {
23+
worker_connections 1024;
24+
}
25+
26+
http {
27+
include /etc/nginx/mime.types;
28+
default_type application/octet-stream;
29+
30+
access_log /dev/stdout;
31+
sendfile on;
32+
keepalive_timeout 65;
33+
34+
# Use /tmp for cache directories (writable in OpenShift)
35+
client_body_temp_path /tmp/client_temp;
36+
proxy_temp_path /tmp/proxy_temp;
37+
fastcgi_temp_path /tmp/fastcgi_temp;
38+
uwsgi_temp_path /tmp/uwsgi_temp;
39+
scgi_temp_path /tmp/scgi_temp;
40+
41+
server {
42+
listen 8080;
43+
server_name _;
44+
45+
location / {
46+
root /usr/share/nginx/html;
47+
index index.html;
48+
}
49+
}
50+
}
51+
---
1152
apiVersion: apps/v1
1253
kind: Deployment
1354
metadata:
@@ -29,22 +70,36 @@ spec:
2970
- name: nginx
3071
image: nginx:alpine
3172
ports:
32-
- containerPort: 80
73+
- containerPort: 8080
74+
protocol: TCP
75+
command: ["nginx", "-c", "/etc/nginx/custom/nginx.conf", "-g", "daemon off;"]
3376
volumeMounts:
3477
- name: html
3578
mountPath: /usr/share/nginx/html
3679
readOnly: true
80+
- name: nginx-config
81+
mountPath: /etc/nginx/custom
82+
readOnly: true
3783
resources:
3884
requests:
3985
memory: "32Mi"
4086
cpu: "10m"
4187
limits:
4288
memory: "64Mi"
4389
cpu: "50m"
90+
securityContext:
91+
runAsNonRoot: true
92+
allowPrivilegeEscalation: false
93+
capabilities:
94+
drop:
95+
- ALL
4496
volumes:
4597
- name: html
4698
configMap:
4799
name: flow-visualization-html
100+
- name: nginx-config
101+
configMap:
102+
name: flow-visualization-nginx-config
48103
---
49104
apiVersion: v1
50105
kind: Service
@@ -55,8 +110,8 @@ spec:
55110
selector:
56111
app: flow-visualization
57112
ports:
58-
- port: 80
59-
targetPort: 80
113+
- port: 8080
114+
targetPort: 8080
60115
---
61116
apiVersion: route.openshift.io/v1
62117
kind: Route
@@ -68,4 +123,4 @@ spec:
68123
kind: Service
69124
name: flow-visualization
70125
port:
71-
targetPort: 80
126+
targetPort: 8080

0 commit comments

Comments
 (0)