Skip to content

Commit

Permalink
Add dedicated worker pool for experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
timebertt committed Aug 23, 2023
1 parent 4e099e7 commit bfb3dc5
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
29 changes: 29 additions & 0 deletions webhosting-operator/config/policy/shoot/experiment-scheduling.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: experiment-scheduling
spec:
failurePolicy: Fail
rules:
# schedule experiment on dedicated worker pool for better isolation in load tests
- name: add-scheduling-constraints
match:
any:
- resources:
kinds:
- Pod
namespaces:
- experiment
selector:
matchLabels:
app.kubernetes.io/name: experiment
operations:
- CREATE
mutate:
patchesJson6902: |-
- op: add
path: "/spec/tolerations/-"
value: {"key":"dedicated-for","operator":"Equal","value":"experiment","effect":"NoSchedule"}
- op: add
path: "/spec/affinity/nodeAffinity/requiredDuringSchedulingIgnoredDuringExecution/nodeSelectorTerms/-"
value: {"matchExpressions": [{"key":"dedicated-for","operator":"In","values":["experiment"]}]}
1 change: 1 addition & 0 deletions webhosting-operator/config/policy/shoot/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ kind: Kustomization

resources:
- ../default
- experiment-scheduling.yaml
- webhosting-operator-scheduling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ spec:
selector:
matchLabels:
app.kubernetes.io/name: webhosting-operator
operations:
- CREATE
mutate:
patchesJson6902: |-
- op: add
Expand Down
25 changes: 25 additions & 0 deletions webhosting-operator/shoot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,31 @@ spec:
type: storage_premium_perf1
zones:
- eu01-2
# runs experiment
- name: experiment
cri:
name: containerd
machine:
image:
name: coreos
type: g1.3
maxSurge: 1
maxUnavailable: 0
maximum: 1
minimum: 0
systemComponents:
allow: false
labels:
dedicated-for: experiment
taints:
- key: dedicated-for
value: experiment
effect: NoSchedule
volume:
size: 50Gi
type: storage_premium_perf1
zones:
- eu01-2
purpose: development
region: RegionOne
secretBindingName: cq12kuc8ir

0 comments on commit bfb3dc5

Please sign in to comment.