-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from timebertt/stable-experiments
Stable experiments
- Loading branch information
Showing
44 changed files
with
578 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
webhosting-operator/config/monitoring/default/ensure-admin-password.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
dir="$(dirname "$0")" | ||
file="$dir/grafana_admin_password.secret.txt" | ||
|
||
[ -f "$file" ] && exit 0 | ||
cat /dev/urandom | tr -dc "a-zA-Z0-9" | head -c 32 > "$file" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
webhosting-operator/config/monitoring/default/patch_filter_nodeexporter_metrics.yaml
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
webhosting-operator/config/policy/controlplane/etcd-main.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
apiVersion: kyverno.io/v1 | ||
kind: Policy | ||
metadata: | ||
name: etcd-main | ||
namespace: shoot--timebertt--sharding | ||
spec: | ||
failurePolicy: Fail | ||
rules: | ||
# set static requests/limits on etcd-main to ensure similar evaluation environment between load test runs | ||
- name: resources | ||
match: | ||
any: | ||
- resources: | ||
kinds: | ||
- Pod | ||
selector: | ||
matchLabels: | ||
instance: etcd-main | ||
name: etcd | ||
mutate: | ||
patchStrategicMerge: | ||
spec: | ||
containers: | ||
- name: etcd | ||
resources: | ||
requests: | ||
cpu: 12000m | ||
memory: 12Gi | ||
limits: | ||
cpu: 12000m | ||
memory: 12Gi | ||
# schedule etcd-main on high-cpu worker pool for stable performance | ||
- name: add-scheduling-constraints | ||
match: | ||
any: | ||
- resources: | ||
kinds: | ||
- Pod | ||
selector: | ||
matchLabels: | ||
instance: etcd-main | ||
name: etcd | ||
mutate: | ||
patchesJson6902: |- | ||
- op: add | ||
path: "/spec/tolerations/-" | ||
value: {"key":"high-cpu","operator":"Equal","value":"true","effect":"NoSchedule"} | ||
- op: add | ||
path: "/spec/affinity/nodeAffinity/requiredDuringSchedulingIgnoredDuringExecution/nodeSelectorTerms/-" | ||
value: {"matchExpressions": [{"key":"high-cpu","operator":"In","values":["true"]}]} |
31 changes: 31 additions & 0 deletions
31
webhosting-operator/config/policy/controlplane/kube-apiserver-scale.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: kyverno.io/v1 | ||
kind: Policy | ||
metadata: | ||
name: kube-apiserver-scale | ||
namespace: shoot--timebertt--sharding | ||
spec: | ||
failurePolicy: Ignore | ||
# schema validation doesn't seem to work in combination with the /scale subresource, disable it for now | ||
schemaValidation: false | ||
rules: | ||
# set static replicas on kube-apiserver to ensure similar evaluation environment between load test runs | ||
- name: replicas-scale | ||
match: | ||
any: | ||
- resources: | ||
# mutate scale requests by HPA | ||
kinds: | ||
- Deployment/scale | ||
# the Scale subresource doesn't have the original resource's labels -> we have to match by name | ||
names: | ||
- kube-apiserver | ||
preconditions: | ||
all: | ||
# Only patch spec.replicas if the control plane is not hibernated, i.e., if spec.replicas>=1. | ||
- key: "{{ request.object.spec.replicas || `1` }}" | ||
operator: GreaterThan | ||
value: 0 | ||
mutate: | ||
patchStrategicMerge: | ||
spec: | ||
replicas: 1 |
74 changes: 74 additions & 0 deletions
74
webhosting-operator/config/policy/controlplane/kube-apiserver.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
apiVersion: kyverno.io/v1 | ||
kind: Policy | ||
metadata: | ||
name: kube-apiserver | ||
namespace: shoot--timebertt--sharding | ||
spec: | ||
failurePolicy: Fail | ||
rules: | ||
# set static replicas on kube-apiserver to ensure similar evaluation environment between load test runs | ||
# if the cluster is hibernated (spec.replicas=0), this rule is skipped | ||
- name: replicas | ||
match: | ||
any: | ||
- resources: | ||
kinds: | ||
- Deployment | ||
selector: | ||
matchLabels: | ||
app: kubernetes | ||
role: apiserver | ||
preconditions: | ||
all: | ||
# Only patch spec.replicas if the control plane is not hibernated, i.e., if spec.replicas>=1. | ||
# NB: gardenlet deploys kube-apiserver with spec.replicas=null which is defaulted after the policy webhook call | ||
# to spec.replicas=1. Hence, treat spec.replicas=null the same way as spec.replicas=1. | ||
- key: "{{ request.object.spec.replicas || `1` }}" | ||
operator: GreaterThan | ||
value: 0 | ||
mutate: | ||
patchStrategicMerge: | ||
spec: | ||
replicas: 1 | ||
# set static requests/limits on kube-apiserver to ensure similar evaluation environment between load test runs | ||
- name: resources | ||
match: | ||
any: | ||
- resources: | ||
kinds: | ||
- Pod | ||
selector: | ||
matchLabels: | ||
app: kubernetes | ||
role: apiserver | ||
mutate: | ||
patchStrategicMerge: | ||
spec: | ||
containers: | ||
- name: kube-apiserver | ||
resources: | ||
requests: | ||
cpu: 12000m | ||
memory: 12Gi | ||
limits: | ||
cpu: 12000m | ||
memory: 12Gi | ||
# schedule kube-apiserver on high-cpu worker pool for stable performance | ||
- name: add-scheduling-constraints | ||
match: | ||
any: | ||
- resources: | ||
kinds: | ||
- Pod | ||
selector: | ||
matchLabels: | ||
app: kubernetes | ||
role: apiserver | ||
mutate: | ||
patchesJson6902: |- | ||
- op: add | ||
path: "/spec/tolerations/-" | ||
value: {"key":"high-cpu","operator":"Equal","value":"true","effect":"NoSchedule"} | ||
- op: add | ||
path: "/spec/affinity/nodeAffinity/requiredDuringSchedulingIgnoredDuringExecution/nodeSelectorTerms/-" | ||
value: {"matchExpressions": [{"key":"high-cpu","operator":"In","values":["true"]}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
...osting-operator/config/policy/controlplane/patch_kube-controller-manager_ratelimiter.yaml
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
...ng-operator/config/policy/controlplane/tests/kube-apiserver-scale-awake/kyverno-test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: kube-apiserver-scale-awake | ||
policies: | ||
- ../../kube-apiserver-scale.yaml | ||
resources: | ||
# spec.replicas=2 -> expect spec.replicas=1 | ||
- scale.yaml | ||
variables: variables.yaml | ||
results: | ||
- policy: kube-apiserver-scale | ||
rule: replicas-scale | ||
resource: kube-apiserver | ||
namespace: shoot--timebertt--sharding | ||
kind: Scale | ||
result: pass | ||
patchedResource: scale_expected.yaml |
7 changes: 7 additions & 0 deletions
7
webhosting-operator/config/policy/controlplane/tests/kube-apiserver-scale-awake/scale.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: Scale | ||
apiVersion: autoscaling/v1 | ||
metadata: | ||
name: kube-apiserver | ||
namespace: shoot--timebertt--sharding | ||
spec: | ||
replicas: 2 |
7 changes: 7 additions & 0 deletions
7
...-operator/config/policy/controlplane/tests/kube-apiserver-scale-awake/scale_expected.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: Scale | ||
apiVersion: autoscaling/v1 | ||
metadata: | ||
name: kube-apiserver | ||
namespace: shoot--timebertt--sharding | ||
spec: | ||
replicas: 1 |
Oops, something went wrong.