ci: reserve build-node scheduling for eligible pods
This commit is contained in:
parent
22fa9a8ffc
commit
a5b8709411
@ -6,6 +6,7 @@ resources:
|
||||
- certificates.yaml
|
||||
- admission-service.yaml
|
||||
- webhooks.yaml
|
||||
- reservations.yaml
|
||||
configMapGenerator:
|
||||
- name: ci-placement-code
|
||||
files:
|
||||
|
||||
173
infrastructure/core/ci-capacity/reservations.yaml
Normal file
173
infrastructure/core/ci-capacity/reservations.yaml
Normal file
@ -0,0 +1,173 @@
|
||||
# infrastructure/core/ci-capacity/reservations.yaml
|
||||
# Direct binding lets the reservation coexist with tenants already running here.
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: ci-reservation-arm64
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: ci-reservation-arm64
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxSurge: 1
|
||||
maxUnavailable: 0
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: ci-reservation-arm64
|
||||
atlas.bstein.dev/ci-arm64-eligible: 'true'
|
||||
spec:
|
||||
automountServiceAccountToken: false
|
||||
nodeName: titan-07
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- namespaceSelector:
|
||||
matchExpressions:
|
||||
- key: kubernetes.io/metadata.name
|
||||
operator: NotIn
|
||||
values:
|
||||
- jenkins
|
||||
- kube-system
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- key: atlas.bstein.dev/ci-arm64-eligible
|
||||
operator: NotIn
|
||||
values:
|
||||
- 'true'
|
||||
topologyKey: kubernetes.io/hostname
|
||||
- namespaces:
|
||||
- jenkins
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- key: atlas.bstein.dev/ci-arm64-eligible
|
||||
operator: NotIn
|
||||
values:
|
||||
- 'true'
|
||||
- key: kubernetes.jenkins.io/controller
|
||||
operator: NotIn
|
||||
values:
|
||||
- http___jenkins_jenkins_svc_cluster_local_8080x
|
||||
topologyKey: kubernetes.io/hostname
|
||||
- namespaces:
|
||||
- kube-system
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- key: atlas.bstein.dev/ci-arm64-eligible
|
||||
operator: NotIn
|
||||
values:
|
||||
- 'true'
|
||||
- key: k8s-app
|
||||
operator: NotIn
|
||||
values:
|
||||
- kube-dns
|
||||
topologyKey: kubernetes.io/hostname
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 65532
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
containers:
|
||||
- name: reservation
|
||||
image: registry.k8s.io/pause@sha256:ee6521f290b2168b6e0935a181d4cff9be1ac3f505666ef0e3c98fae8199917a
|
||||
resources:
|
||||
requests:
|
||||
cpu: 1m
|
||||
memory: 4Mi
|
||||
limits:
|
||||
cpu: 1m
|
||||
memory: 4Mi
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
readOnlyRootFilesystem: true
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: ci-reservation-amd64
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: ci-reservation-amd64
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxSurge: 1
|
||||
maxUnavailable: 0
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: ci-reservation-amd64
|
||||
atlas.bstein.dev/ci-amd64-eligible: 'true'
|
||||
spec:
|
||||
automountServiceAccountToken: false
|
||||
nodeName: titan-22
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- namespaceSelector:
|
||||
matchExpressions:
|
||||
- key: kubernetes.io/metadata.name
|
||||
operator: NotIn
|
||||
values:
|
||||
- jenkins
|
||||
- kube-system
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- key: atlas.bstein.dev/ci-amd64-eligible
|
||||
operator: NotIn
|
||||
values:
|
||||
- 'true'
|
||||
topologyKey: kubernetes.io/hostname
|
||||
- namespaces:
|
||||
- jenkins
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- key: atlas.bstein.dev/ci-amd64-eligible
|
||||
operator: NotIn
|
||||
values:
|
||||
- 'true'
|
||||
- key: kubernetes.jenkins.io/controller
|
||||
operator: NotIn
|
||||
values:
|
||||
- http___jenkins_jenkins_svc_cluster_local_8080x
|
||||
topologyKey: kubernetes.io/hostname
|
||||
- namespaces:
|
||||
- kube-system
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- key: atlas.bstein.dev/ci-amd64-eligible
|
||||
operator: NotIn
|
||||
values:
|
||||
- 'true'
|
||||
- key: k8s-app
|
||||
operator: NotIn
|
||||
values:
|
||||
- kube-dns
|
||||
topologyKey: kubernetes.io/hostname
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 65532
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
containers:
|
||||
- name: reservation
|
||||
image: registry.k8s.io/pause@sha256:ee6521f290b2168b6e0935a181d4cff9be1ac3f505666ef0e3c98fae8199917a
|
||||
resources:
|
||||
requests:
|
||||
cpu: 1m
|
||||
memory: 4Mi
|
||||
limits:
|
||||
cpu: 1m
|
||||
memory: 4Mi
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
readOnlyRootFilesystem: true
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
@ -11,7 +11,7 @@ webhooks:
|
||||
- v1
|
||||
sideEffects: None
|
||||
timeoutSeconds: 3
|
||||
failurePolicy: Ignore
|
||||
failurePolicy: Fail
|
||||
clientConfig:
|
||||
service:
|
||||
namespace: kube-system
|
||||
@ -44,7 +44,7 @@ webhooks:
|
||||
- v1
|
||||
sideEffects: None
|
||||
timeoutSeconds: 3
|
||||
failurePolicy: Ignore
|
||||
failurePolicy: Fail
|
||||
clientConfig:
|
||||
service:
|
||||
namespace: kube-system
|
||||
@ -76,7 +76,7 @@ webhooks:
|
||||
- v1
|
||||
sideEffects: None
|
||||
timeoutSeconds: 3
|
||||
failurePolicy: Ignore
|
||||
failurePolicy: Fail
|
||||
clientConfig:
|
||||
service:
|
||||
namespace: kube-system
|
||||
|
||||
@ -61,6 +61,11 @@ spec:
|
||||
clear_worker titan-18 rpi4
|
||||
clear_worker titan-22 amd64
|
||||
|
||||
# Required inter-pod anti-affinity enforces the reservation. A soft
|
||||
# taint lets node DaemonSets reach Pod admission on replacement.
|
||||
k taint node titan-07 atlas.bstein.dev/ci-reserved=arm64:PreferNoSchedule --overwrite=true
|
||||
k taint node titan-22 atlas.bstein.dev/ci-reserved=amd64:PreferNoSchedule --overwrite=true
|
||||
|
||||
if k get node titan-22 >/dev/null 2>&1; then
|
||||
k label node titan-22 \
|
||||
atlas.bstein.dev/general-compute=last-resort \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user