This repository has been archived by the owner on Sep 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpod.yaml.tim
94 lines (94 loc) · 2.92 KB
/
pod.yaml.tim
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: v1
kind: Pod
metadata:
name: "{{pod_name}}"
labels:
sdbuild: "{{build_id_with_prefix}}"
app: screwdriver-vm
tier: builds
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- screwdriver-vm
restartPolicy: Never
terminationGracePeriodSeconds: {{termination_grace_period_seconds}}
containers:
- name: vm-launcher
image: {{base_image}}
imagePullPolicy: Always
lifecycle:
preStop:
exec:
command: ["/bin/sh","-c","sleep 30"]
securityContext:
privileged: true
resources:
limits:
cpu: "{{cpu}}"
memory: {{memory}}Mi
command: ["/sd/hyper-runner.sh"]
args: [
"--cpu", "{{cpu}}",
"--memory", "{{memory}}",
"--container", "{{container}}",
"--api_uri", "{{api_uri}}",
"--store_uri", "{{store_uri}}",
"--ui_uri", "{{ui_uri}}",
"--build_id", "{{build_id}}",
"--job_id", "{{job_id}}",
"--event_id","{{event_id}}",
"--pipeline_id", "{{pipeline_id}}",
"--id_with_prefix", "{{build_id_with_prefix}}",
"--build_token", "{{token}}",
"--build_timeout", "{{build_timeout}}",
"--launcher_version", "{{launcher_version}}",
"--cache_strategy", "{{cache_strategy}}",
"--cache_path", "{{cache_path}}",
"--cache_compress", "{{cache_compress}}",
"--cache_md5check", "{{cache_md5check}}",
"--cache_max_size_mb", "{{cache_max_size_mb}}",
"--cache_max_go_threads", "{{cache_max_go_threads}}"
]
env:
- name: SD_PUSHGATEWAY_URL
value: "{{pushgateway_url}}"
- name: SD_TERMINATION_GRACE_PERIOD_SECONDS
value: "{{termination_grace_period_seconds}}"
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- mountPath: /var/run
name: hyper-socket
- mountPath: /var/sd-workspaces
name: sd-workspaces
- mountPath: /opt/sd
name: sdlauncher
initContainers:
- name: launcher
image: {{launcher_image}}
command: ['/bin/sh', '-c', 'if ! [ -f /opt/launcher/launch ]; then TEMP_DIR=`mktemp -d -p /opt/launcher` && cp -a /opt/sd/* $TEMP_DIR && mkdir -p $TEMP_DIR/hab && cp -a /hab/* $TEMP_DIR/hab && mv $TEMP_DIR/* /opt/launcher && rm -rf $TEMP_DIR || true; else ls /opt/launcher; fi;']
volumeMounts:
- mountPath: /opt/launcher
name: sdlauncher
volumes:
- name: hyper-socket
hostPath:
path: /var/run
- name: sd-workspaces
hostPath:
path: /opt/screwdriver
- name: sdlauncher
type: DirectoryOrCreate
hostPath:
path: /opt/screwdriver/sdlauncher/{{launcher_version}}