-
Notifications
You must be signed in to change notification settings - Fork 0
/
JenkinsfilePod.yaml
79 lines (77 loc) · 2.22 KB
/
JenkinsfilePod.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
apiVersion: v1
kind: Pod
metadata:
annotations:
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
karpenter.sh/do-not-disrupt: "true"
spec:
# Try to keep build pods away from other build pods if possible, but it's not critical
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 10
podAffinityTerm:
labelSelector:
matchLabels:
jenkins/cgici-jenkins-jenkins-agent: "true"
topologyKey: kubernetes.io/hostname
serviceAccountName: cgici-gaiascope
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
containers:
- name: libeopp-build
image: public.ecr.aws/cgici-images/eopp-build-container:3.2.0
imagePullPolicy: IfNotPresent
command:
- cat
tty: true
volumeMounts:
# This volume is defined by the Jenkins agent, which extends this yaml
# We want to also mount it under ~/.cache to add the Bazel cache to the workspace volume
- mountPath: /home/jenkins/.cache
name: workspace-volume
subPath: .cache
- name: kubedock-socket
mountPath: /var/run/kubedock
env:
- name: DOCKER_HOST
value: "unix:///var/run/kubedock/docker.sock"
- name: TESTCONTAINERS_RYUK_DISABLED
value: "true"
- name: TESTCONTAINERS_CHECKS_DISABLE
value: "true"
# Update bazelrc flags at top of Jenkinsfile if changing resources
resources:
limits:
cpu: "4"
memory: "8Gi"
requests:
cpu: "4"
memory: "8Gi"
# Kubedock provides a limited Docker API backed by the local Kubernetes environment
# we use this for container testing (e.g. our DockerRegistryRule)
- name: kubedock
image: docker.io/joyrex2001/kubedock:0.16.0
imagePullPolicy: Always
args:
- server
- --reverse-proxy
- --unix-socket
- /var/run/kubedock/docker.sock
volumeMounts:
- name: workspace-volume
mountPath: /home/jenkins/agent
- mountPath: /home/jenkins/.cache
name: workspace-volume
subPath: .cache
- name: kubedock-socket
mountPath: /var/run/kubedock
resources:
limits:
cpu: 100m
memory: 80Mi
volumes:
- name: kubedock-socket
emptyDir: { }