Skip to content

Commit 6708a1b

Browse files
csweichelroboquat
authored andcommitted
[ws-manager] Add test for affinity template merge
1 parent 5d751e3 commit 6708a1b

File tree

2 files changed

+280
-0
lines changed

2 files changed

+280
-0
lines changed
Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
{
2+
"reason": {
3+
"metadata": {
4+
"name": "ws-test",
5+
"namespace": "default",
6+
"creationTimestamp": null,
7+
"labels": {
8+
"app": "gitpod",
9+
"component": "workspace",
10+
"gitpod.io/networkpolicy": "default",
11+
"gpwsman": "true",
12+
"headless": "false",
13+
"metaID": "foobar",
14+
"owner": "tester",
15+
"workspaceID": "test",
16+
"workspaceType": "regular"
17+
},
18+
"annotations": {
19+
"cluster-autoscaler.kubernetes.io/safe-to-evict": "false",
20+
"container.apparmor.security.beta.kubernetes.io/workspace": "unconfined",
21+
"gitpod.io/requiredNodeServices": "ws-daemon,registry-facade",
22+
"gitpod/admission": "admit_owner_only",
23+
"gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n",
24+
"gitpod/id": "test",
25+
"gitpod/imageSpec": "Cghzb21lLXJlZhI0ZXUuZ2NyLmlvL2dpdHBvZC1jb3JlLWRldi9idWlkL3RoZWlhLWlkZTpzb21ldmVyc2lvbg==",
26+
"gitpod/never-ready": "true",
27+
"gitpod/ownerToken": "%7J'[Of/8NDiWE+9F,I6^Jcj_1\u0026}-F8p",
28+
"gitpod/servicePrefix": "foobarservice",
29+
"gitpod/traceid": "",
30+
"gitpod/url": "test-foobarservice-gitpod.io",
31+
"prometheus.io/path": "/metrics",
32+
"prometheus.io/port": "23000",
33+
"prometheus.io/scrape": "true",
34+
"seccomp.security.alpha.kubernetes.io/pod": "localhost/workspace-default"
35+
}
36+
},
37+
"spec": {
38+
"volumes": [
39+
{
40+
"name": "vol-this-workspace",
41+
"hostPath": {
42+
"path": "/tmp/workspaces/test",
43+
"type": "DirectoryOrCreate"
44+
}
45+
},
46+
{
47+
"name": "daemon-mount",
48+
"hostPath": {
49+
"path": "/tmp/workspaces/test-daemon",
50+
"type": "DirectoryOrCreate"
51+
}
52+
}
53+
],
54+
"containers": [
55+
{
56+
"name": "workspace",
57+
"image": "registry-facade:8080/remote/test",
58+
"command": [
59+
"/.supervisor/workspacekit",
60+
"ring0"
61+
],
62+
"ports": [
63+
{
64+
"containerPort": 23000
65+
}
66+
],
67+
"env": [
68+
{
69+
"name": "GITPOD_REPO_ROOT",
70+
"value": "/workspace"
71+
},
72+
{
73+
"name": "GITPOD_CLI_APITOKEN",
74+
"value": "Ab=5=rRA*9:C'T{;RRB\u003e]vK2p6`fFfrS"
75+
},
76+
{
77+
"name": "GITPOD_WORKSPACE_ID",
78+
"value": "foobar"
79+
},
80+
{
81+
"name": "GITPOD_INSTANCE_ID",
82+
"value": "test"
83+
},
84+
{
85+
"name": "GITPOD_THEIA_PORT",
86+
"value": "23000"
87+
},
88+
{
89+
"name": "THEIA_WORKSPACE_ROOT",
90+
"value": "/workspace"
91+
},
92+
{
93+
"name": "GITPOD_HOST",
94+
"value": "gitpod.io"
95+
},
96+
{
97+
"name": "GITPOD_WORKSPACE_URL",
98+
"value": "test-foobarservice-gitpod.io"
99+
},
100+
{
101+
"name": "THEIA_SUPERVISOR_ENDPOINT",
102+
"value": ":22999"
103+
},
104+
{
105+
"name": "THEIA_WEBVIEW_EXTERNAL_ENDPOINT",
106+
"value": "webview-{{hostname}}"
107+
},
108+
{
109+
"name": "THEIA_MINI_BROWSER_HOST_PATTERN",
110+
"value": "browser-{{hostname}}"
111+
},
112+
{
113+
"name": "GITPOD_GIT_USER_NAME",
114+
"value": "usernameGoesHere"
115+
},
116+
{
117+
"name": "GITPOD_GIT_USER_EMAIL",
118+
"value": "[email protected]"
119+
},
120+
{
121+
"name": "GITPOD_INTERVAL",
122+
"value": "30000"
123+
},
124+
{
125+
"name": "GITPOD_MEMORY",
126+
"value": "999"
127+
}
128+
],
129+
"resources": {
130+
"limits": {
131+
"cpu": "900m",
132+
"memory": "1G"
133+
},
134+
"requests": {
135+
"cpu": "899m",
136+
"ephemeral-storage": "5Gi",
137+
"memory": "999M"
138+
}
139+
},
140+
"volumeMounts": [
141+
{
142+
"name": "vol-this-workspace",
143+
"mountPath": "/workspace",
144+
"mountPropagation": "HostToContainer"
145+
},
146+
{
147+
"name": "daemon-mount",
148+
"mountPath": "/.workspace",
149+
"mountPropagation": "HostToContainer"
150+
}
151+
],
152+
"readinessProbe": {
153+
"httpGet": {
154+
"path": "/_supervisor/v1/status/content/wait/true",
155+
"port": 22999,
156+
"scheme": "HTTP"
157+
},
158+
"initialDelaySeconds": 4,
159+
"timeoutSeconds": 1,
160+
"periodSeconds": 1,
161+
"successThreshold": 1,
162+
"failureThreshold": 600
163+
},
164+
"terminationMessagePolicy": "File",
165+
"imagePullPolicy": "IfNotPresent",
166+
"securityContext": {
167+
"capabilities": {
168+
"add": [
169+
"AUDIT_WRITE",
170+
"FSETID",
171+
"KILL",
172+
"NET_BIND_SERVICE",
173+
"SYS_PTRACE"
174+
],
175+
"drop": [
176+
"SETPCAP",
177+
"CHOWN",
178+
"NET_RAW",
179+
"DAC_OVERRIDE",
180+
"FOWNER",
181+
"SYS_CHROOT",
182+
"SETFCAP",
183+
"SETUID",
184+
"SETGID"
185+
]
186+
},
187+
"privileged": false,
188+
"runAsUser": 33333,
189+
"runAsGroup": 33333,
190+
"runAsNonRoot": true,
191+
"readOnlyRootFilesystem": false,
192+
"allowPrivilegeEscalation": true
193+
}
194+
}
195+
],
196+
"restartPolicy": "Never",
197+
"serviceAccountName": "workspace",
198+
"automountServiceAccountToken": false,
199+
"affinity": {
200+
"nodeAffinity": {
201+
"requiredDuringSchedulingIgnoredDuringExecution": {
202+
"nodeSelectorTerms": [
203+
{
204+
"matchExpressions": [
205+
{
206+
"key": "gitpod.io/workload_workspace_regular",
207+
"operator": "Exists"
208+
},
209+
{
210+
"key": "foobar",
211+
"operator": "Exists"
212+
}
213+
]
214+
}
215+
]
216+
}
217+
}
218+
},
219+
"schedulerName": "workspace-scheduler",
220+
"tolerations": [
221+
{
222+
"key": "node.kubernetes.io/disk-pressure",
223+
"operator": "Exists",
224+
"effect": "NoExecute"
225+
},
226+
{
227+
"key": "node.kubernetes.io/memory-pressure",
228+
"operator": "Exists",
229+
"effect": "NoExecute"
230+
},
231+
{
232+
"key": "node.kubernetes.io/network-unavailable",
233+
"operator": "Exists",
234+
"effect": "NoExecute",
235+
"tolerationSeconds": 30
236+
}
237+
],
238+
"enableServiceLinks": false
239+
},
240+
"status": {}
241+
}
242+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"enforceAffinity": true,
3+
"defaultTemplate": {
4+
"spec": {
5+
"affinity": {
6+
"nodeAffinity": {
7+
"requiredDuringSchedulingIgnoredDuringExecution": {
8+
"nodeSelectorTerms": [
9+
{
10+
"matchExpressions": [
11+
{
12+
"key": "foobar",
13+
"operator": "Exists"
14+
}
15+
]
16+
}
17+
]
18+
}
19+
}
20+
}
21+
}
22+
},
23+
"spec": {
24+
"ideImage": {
25+
"webRef": "eu.gcr.io/gitpod-core-dev/buid/theia-ide:someversion"
26+
},
27+
"workspaceImage": "some-ref",
28+
"initializer": {
29+
"snapshot": {
30+
"snapshot": "workspaces/cryptic-id-goes-herg/fd62804b-4cab-11e9-843a-4e645373048e.tar@gitpod-dev-user-christesting"
31+
}
32+
},
33+
"git": {
34+
"username": "usernameGoesHere",
35+
"email": "[email protected]"
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)