-
Notifications
You must be signed in to change notification settings - Fork 798
/
dev-config.yaml
207 lines (199 loc) · 6.22 KB
/
dev-config.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
proxy:
service:
type: NodePort
nodePorts:
http: 30080
https: 30443
https:
enabled: true
type: letsencrypt
hosts:
- local.jovyan.org
letsencrypt:
contactEmail: "[email protected]"
acmeServer: https://pebble/dir
traefik:
extraVolumes:
- name: pebble-root-cert
configMap:
name: pebble
extraVolumeMounts:
- name: pebble-root-cert
subPath: root-cert.pem
mountPath: /etc/pebble/root-cert.pem
extraEnv:
LEGO_CA_CERTIFICATES: /etc/pebble/root-cert.pem
chp:
resources:
requests:
memory: 0
cpu: 0
networkPolicy:
egress: [] # overrides allowance of 0.0.0.0/0
hub:
db:
type: sqlite-memory
loadRoles:
test-scoped-access:
description: Used to JupyterHub 2.0.0+ RBAC scoped access, currently to the /hub/api/info endpoint via read:hub.
scopes: [read:hub]
services: [test-with-scoped-access]
test-role-with-explicit-name:
name: test-role-2
description: Access to users' information and group membership
scopes: [users, groups]
users: [cyclops, gandalf]
services: [test]
groups: []
services:
# The test service and its apiToken is used to make requests in our pytest
# suite of tests. Note that it can be overridden by the hub.existingSecret,
# which can cause tests to fail with 403.
test:
admin: true
apiToken: give-pytest-control
test-with-scoped-access:
apiToken: give-pytest-scoped-control
test-hub-existing-secret:
apiToken: dddd4444
test-explicit-name:
name: some-explicitly-set-name
apiToken: eeee5555
test-generation-of-apiToken: {}
networkPolicy:
egress: # overrides allowance of 0.0.0.0/0
- ports:
# In kind/k3s clusters the Kubernetes API server is exposing this port
- protocol: TCP
port: 6443
# For testing postgres
- protocol: TCP
port: 5432
resources:
requests:
memory: 0
cpu: 0
extraConfig:
# emit logs associated with our pytest tests
test_hub_existing_secret: |
try:
from z2jh import get_secret_value
print()
print("TEST LOGS: test_hub_existing_secret")
print(f"hub.existingSecret={get_config('hub.existingSecret')}")
print()
print(f"hub.db.type={get_config('hub.db.type')}")
print(f"MYSQL_PWD={os.environ.get('MYSQL_PWD', None)}")
print(f"PGPASSWORD={os.environ.get('PGPASSWORD', None)}")
print()
print(f"hub.services.test-hub-existing-secret.apiToken={get_secret_value('hub.services.test-hub-existing-secret.apiToken', None)}")
print()
print(f"CONFIGPROXY_AUTH_TOKEN={os.environ.get('CONFIGPROXY_AUTH_TOKEN', None)}")
print(f"hub.config.ConfigurableHTTPProxy.auth_token={get_secret_value('hub.config.ConfigurableHTTPProxy.auth_token', None)}")
print(f"hub.config.JupyterHub.cookie_secret={get_secret_value('hub.config.JupyterHub.cookie_secret', None)}")
print(f"hub.config.CryptKeeper.keys={get_secret_value('hub.config.CryptKeeper.keys', None)}")
print()
print(f"singleuser.extraLabels.test-chart-managed-secret={get_config('singleuser.extraLabels.test-chart-managed-secret')}")
print(f"singleuser.extraLabels.test-self-managed-secret={get_config('singleuser.extraLabels.test-self-managed-secret')}")
print("---")
print()
except ImportError:
print("WARNING: z2jh.py didn't contain get_secret_value")
extraFiles:
my_config:
mountPath: /usr/local/etc/jupyterhub/jupyterhub_config.d/my_config.py
stringData: |
with open("/tmp/created-by-extra-files-config.txt", "w") as f:
f.write("hello world!")
binaryData1: &binaryData1
mountPath: /tmp/binaryData.txt
mode: 0666
binaryData: |
aGVsbG8gd
29ybGQhCg==
binaryData2: &binaryData2
mountPath: /tmp/dir1/binaryData.txt
mode: 0666
binaryData: aGVsbG8gd29ybGQhCg==
stringData1: &stringData1
mountPath: /tmp/stringData.txt
mode: 0666
stringData: hello world!
stringData2: &stringData2
mountPath: /tmp/dir1/stringData.txt
mode: 0666
stringData: hello world!
data-yaml: &data-yaml
mountPath: /etc/test/data.yaml
mode: 0444
data:
config:
map:
number: 123
string: "hi"
list: [1, 2]
data-yml: &data-yml
<<: *data-yaml
mountPath: /etc/test/data.yml
data-json: &data-json
<<: *data-yaml
mountPath: /etc/test/data.json
data-toml: &data-toml
<<: *data-yaml
mountPath: /etc/test/data.toml
singleuser:
extraLabels:
test-chart-managed-secret: "ok"
extraFiles:
binaryData1: *binaryData1
binaryData2: *binaryData2
stringData1: *stringData1
stringData2: *stringData2
data-yaml: *data-yaml
data-yml: *data-yml
data-json: *data-json
data-toml: *data-toml
storage:
type: none
memory:
guarantee: null
networkPolicy:
# For testing purposes in the test_spawn_netpol test, we override egress and
# egressAllowRules.nonPrivateIPs to slim the egress rules to a minimum.
egressAllowRules:
nonPrivateIPs: false
egress:
- to:
# jupyter.org has multiple IPs associated with it, among them are these
# two. We explicitly allow access to one, but leave out the the other.
- ipBlock:
cidr: 104.21.25.233/32
# - ipBlock:
# cidr: 172.67.134.225/32
networkTools:
resources:
requests:
memory: 0
cpu: 0
extraEnv:
TEST_ENV_FIELDREF_TO_NAMESPACE:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
prePuller:
hook:
enabled: false
scheduling:
userScheduler:
enabled: true
replicas: 2
# Can be set too low too not show scoring of scheduled pods, but also too
# high to show hex dumps of all network traffic.
#
# FIXME: Tweak this to include scoring, but exclude hex dumps. 10 includes
# hex dumps. 4 does not include scoring. Trying with 6...
logLevel: 6
podPriority:
enabled: true
debug:
enabled: true