-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathrp.yaml
94 lines (86 loc) · 1.89 KB
/
rp.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: reverse-proxy-jlab
namespace: open-hydra
spec:
replicas: 1
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-container
image: docker.io/library/nginx:1.24.0-alpine
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
volumeMounts:
- name: nginx-conf
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
readOnly: true
volumes:
- name: nginx-conf
configMap:
name: nginx-conf-jlab
items:
- key: nginx.conf
path: nginx.conf
---
apiVersion: v1
kind: Service
metadata:
name: reverse-proxy
namespace: open-hydra
spec:
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
ports:
- port: 8888
protocol: TCP
targetPort: 8888
selector:
app: my-app
sessionAffinity: None
type: ClusterIP
---
apiVersion: v1
data:
nginx.conf: |
# /etc/nginx/nginx.conf
user nginx;
worker_processes 1;
events {
worker_connections 1024;
}
http {
upstream upstream_jupyter {
server openhydra-service-aes-admin.open-hydra.svc:8888;
keepalive 32;
}
server {
listen 8888;
server_name test.com;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_hide_header "X-Frame-Options";
proxy_pass http://upstream_jupyter;
proxy_http_version 1.1;
proxy_set_header Upgrade "websocket";
proxy_set_header Connection "Upgrade";
proxy_read_timeout 86400;
}
}
}
kind: ConfigMap
metadata:
name: nginx-conf-jlab
namespace: open-hydra