Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scale up apiserver #26

Merged
merged 5 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="experiment" type="GoApplicationRunConfiguration" factoryName="Go Application">
<configuration default="false" name="experiment (kind)" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="kubernetes-controller-sharding" />
<working_directory value="$PROJECT_DIR$/webhosting-operator" />
<parameters value="reconcile" />
<envs>
<env name="KUBECONFIG" value="$PROJECT_DIR$/webhosting-operator/dev/kind_kubeconfig.yaml" />
</envs>
<kind value="PACKAGE" />
<package value="github.com/timebertt/kubernetes-controller-sharding/webhosting-operator/cmd/experiment" />
<directory value="$PROJECT_DIR$" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="webhosting-operator process (kind)" type="GoApplicationRunConfiguration" factoryName="Go Application">
<configuration default="false" name="webhosting-operator (kind)" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="kubernetes-controller-sharding" />
<working_directory value="$PROJECT_DIR$/webhosting-operator" />
<envs>
Expand Down
2 changes: 1 addition & 1 deletion webhosting-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ manifests: $(CONTROLLER_GEN) ## Generate WebhookConfiguration, ClusterRole and C
$(CONTROLLER_GEN) rbac:roleName=operator crd paths="./..." output:rbac:artifacts:config=config/manager/rbac output:crd:artifacts:config=config/manager/crds

.PHONY: generate
generate: $(CONTROLLER_GEN) ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
generate: $(CONTROLLER_GEN) modules ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
hack/update-codegen.sh

Expand Down
3 changes: 3 additions & 0 deletions webhosting-operator/config/experiment/base/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ spec:
image: experiment:latest
args:
- --zap-log-level=info
env:
- name: DISABLE_HTTP2
value: "true"
ports:
- name: metrics
containerPort: 8080
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
- --google-zone-visibility=public
- --policy=sync
- --registry=txt
- --txt-owner-id=shoot--timebertt--sharding-0e61b9e9-b7ce-4a71-a502-89f366015617-ond-460a37
- --txt-owner-id=shoot--timebertt--sharding-d657103c-eb4f-4a02-9af3-8ee7dc8d6e12-ond-82dc04
- --interval=1m
# ensure the records are not owned by short-lived acme solvers managed by cert-manager or website ingresses
- --label-filter=acme.cert-manager.io/http01-solver!=true,app!=website
Expand Down
3 changes: 3 additions & 0 deletions webhosting-operator/config/manager/default/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ spec:
image: controller:latest
args:
- --zap-log-level=info
env:
- name: DISABLE_HTTP2
value: "true"
ports:
- name: metrics
containerPort: 8080
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ spec:
mutate:
patchStrategicMerge:
spec:
replicas: 1
replicas: 4
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
mutate:
patchStrategicMerge:
spec:
replicas: 1
replicas: 4
# set static requests/limits on kube-apiserver to ensure similar evaluation environment between load test runs
- name: resources
match:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: kube-apiserver-scale-awake
policies:
- ../../kube-apiserver-scale.yaml
resources:
# spec.replicas=2 -> expect spec.replicas=1
# spec.replicas=2 -> expect spec.replicas=4
- scale.yaml
variables: variables.yaml
results:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ metadata:
name: kube-apiserver
namespace: shoot--timebertt--sharding
spec:
replicas: 1
replicas: 4
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
name: kube-apiserver-awake
namespace: shoot--timebertt--sharding
spec:
replicas: 1
replicas: 4
template:
spec:
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
name: kube-apiserver-null
namespace: shoot--timebertt--sharding
spec:
replicas: 1
replicas: 4
template:
spec:
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: kube-apiserver
policies:
- ../../kube-apiserver.yaml
resources:
# spec.replicas=2 -> expect spec.replicas=1
# spec.replicas=2 -> expect spec.replicas=4
- kube-apiserver-awake.yaml
# spec.replicas=null -> expect spec.replicas=1
# spec.replicas=null -> expect spec.replicas=4
- kube-apiserver-null.yaml
# spec.replicas=0 -> expect skip
- kube-apiserver-hibernated.yaml
Expand Down
4 changes: 0 additions & 4 deletions webhosting-operator/config/policy/default/kustomization.yaml

This file was deleted.

1 change: 0 additions & 1 deletion webhosting-operator/config/policy/shoot/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../default
- experiment-scheduling.yaml
- scale-up-worker-experiment.yaml
- webhosting-operator-scheduling.yaml
Expand Down
2 changes: 1 addition & 1 deletion webhosting-operator/hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ EOF
fi

# fetch code-generator module to execute the scripts from the modcache (we don't vendor here)
CODE_GENERATOR_DIR="$(go list -tags tools -f '{{ .Dir }}' k8s.io/code-generator)"
CODE_GENERATOR_DIR="$(go list -m -tags tools -f '{{ .Dir }}' k8s.io/code-generator)"

rm -f ${GOPATH}/bin/*-gen

Expand Down
2 changes: 1 addition & 1 deletion webhosting-operator/shoot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
nodeCIDRMaskSize: 20
kubeProxy:
mode: IPTables
version: "1.25"
version: "1.26"
verticalPodAutoscaler:
enabled: true
maintenance:
Expand Down
20 changes: 8 additions & 12 deletions webhosting-operator/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,6 @@ metadata:
requires:
- configs:
- kyverno
manifests:
kustomize:
paths:
- config/policy/default
deploy:
kubectl:
defaultNamespace: ""
flags:
apply:
- --server-side
- --force-conflicts
statusCheck: false
profiles:
- name: shoot
activation:
Expand All @@ -41,6 +29,14 @@ profiles:
kustomize:
paths:
- config/policy/shoot
deploy:
kubectl:
defaultNamespace: ""
flags:
apply:
- --server-side
- --force-conflicts
statusCheck: false
---
apiVersion: skaffold/v4beta6
kind: Config
Expand Down