-
Notifications
You must be signed in to change notification settings - Fork 0
/
v1_autoscaledagent.yaml
82 lines (82 loc) · 3.03 KB
/
v1_autoscaledagent.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
apiVersion: azurepipelines.k8s.scaler.io/v1
kind: AutoScaledAgent
metadata:
labels:
app.kubernetes.io/name: autoscaledagent
app.kubernetes.io/instance: autoscaledagent-sample
app.kubernetes.io/part-of: azure-pipelines-k8s-agent-scaler
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: azure-pipelines-k8s-agent-scaler
name: autoscaledagent-sample
spec:
poolName: shark-marius-operator-test
organizationUrl: https://dev.azure.com/FOO
personalAccessTokenSecretName: azure-pat
maxTerminatedPodsToKeep: 2
reusableCacheVolumes:
- name: buildkit-cache
storageClassName: hostpath
requestedStorage: 2Gi
podsWithCapabilities:
- capabilities:
buildkit: "1"
minCount: 1
maxCount: 3
podAnnotations:
foo: bar
podTemplateSpec:
spec:
terminationGracePeriodSeconds: 1200
imagePullSecrets: [ ]
shareProcessNamespace: true # needed to be able to use the SAME(!) preStop hook in all containers
containers:
- name: azure-pipelines-agent
image: mshekow/azure-pipelines-agent:local
# TODO only for local use the default pull policy - in production, use this: imagePullPolicy: Always
args:
- "--once"
resources:
requests:
memory: 500Mi
limits:
memory: 500Mi
volumeMounts:
- mountPath: /azp/_work
name: workspace
# Note: the operator automatically sets AZP_AGENT_NAME, AZP_URL, AZP_POOL and AZP_TOKEN (from the secret)
env: [ ]
lifecycle:
preStop:
exec:
command: [ "/bin/sh", "-c", "while [ $(pgrep -l Agent.Worker | wc -l) -ne 0 ]; do sleep 1; done" ]
- name: buildkit # from https://github.com/moby/buildkit/blob/master/examples/kubernetes/pod.rootless.yaml
image: moby/buildkit:master-rootless
args:
- --oci-worker-no-process-sandbox
imagePullPolicy: Always
resources:
requests:
memory: 1Gi
limits:
memory: 4Gi
workingDir: /azp/_work
securityContext:
seccompProfile:
type: Unconfined
# To change UID/GID, you need to rebuild the image
runAsUser: 1000
runAsGroup: 1000
volumeMounts:
- mountPath: /azp/_work
name: workspace
- mountPath: /home/user/.local/share/buildkit
name: buildkit-cache
lifecycle:
preStop:
exec:
command: [ "sudo /bin/sh", "-c", "while [ $(pgrep -l Agent.Worker | wc -l) -ne 0 ]; do sleep 1; done" ]
nodeSelector: { }
tolerations: [ ]
volumes:
- name: workspace
emptyDir: { }