-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: David van der Spek <[email protected]>
- Loading branch information
Showing
27 changed files
with
2,832 additions
and
1,025 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
1,989 changes: 1,116 additions & 873 deletions
1,989
multidimensional-pod-autoscaler/deploy/mpa-v1alpha1-crd-gen.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
117 changes: 0 additions & 117 deletions
117
multidimensional-pod-autoscaler/deploy/mpa-v1alpha1-crd.yaml
This file was deleted.
Oops, something went wrong.
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 @@ | ||
/* | ||
Copyright The Kubernetes Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ |
83 changes: 83 additions & 0 deletions
83
multidimensional-pod-autoscaler/hack/deploy-for-e2e-locally.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,83 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2023 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/.. | ||
|
||
function print_help { | ||
echo "ERROR! Usage: deploy-for-e2e-locally.sh [suite]*" | ||
echo "<suite> should be one of:" | ||
echo " - recommender" | ||
echo " - recommender-externalmetrics" | ||
} | ||
|
||
if [ $# -eq 0 ]; then | ||
print_help | ||
exit 1 | ||
fi | ||
|
||
if [ $# -gt 1 ]; then | ||
print_help | ||
exit 1 | ||
fi | ||
|
||
SUITE=$1 | ||
|
||
case ${SUITE} in | ||
recommender|recommender-externalmetrics) | ||
COMPONENTS="${SUITE}" | ||
;; | ||
*) | ||
print_help | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# Local KIND-hosted registry | ||
export REGISTRY=${REGISTRY:-localhost:5001} | ||
export TAG=${TAG:-latest} | ||
|
||
rm -f ${SCRIPT_ROOT}/hack/e2e/mpa-rbac.yaml | ||
patch -c ${SCRIPT_ROOT}/deploy/mpa-rbac.yaml -i ${SCRIPT_ROOT}/hack/e2e/mpa-rbac.diff -o ${SCRIPT_ROOT}/hack/e2e/mpa-rbac.yaml | ||
kubectl apply -f ${SCRIPT_ROOT}/hack/e2e/mpa-rbac.yaml | ||
# Other-versioned CRDs are irrelevant as we're running a modern-ish cluster. | ||
kubectl apply -f ${SCRIPT_ROOT}/deploy/mpa-v1alpha1-crd-gen.yaml | ||
kubectl apply -f ${SCRIPT_ROOT}/hack/e2e/k8s-metrics-server.yaml | ||
|
||
for i in ${COMPONENTS}; do | ||
if [ $i == recommender-externalmetrics ] ; then | ||
i=recommender | ||
fi | ||
ALL_ARCHITECTURES=amd64 make --directory ${SCRIPT_ROOT}/pkg/${i} release REGISTRY=${REGISTRY} TAG=${TAG} | ||
kind load docker-image ${REGISTRY}/vpa-${i}-amd64:${TAG} | ||
done | ||
|
||
|
||
for i in ${COMPONENTS}; do | ||
if [ $i == recommender-externalmetrics ] ; then | ||
kubectl delete namespace monitoring --ignore-not-found=true | ||
kubectl create namespace monitoring | ||
kubectl apply -f ${SCRIPT_ROOT}/hack/e2e/prometheus.yaml | ||
kubectl apply -f ${SCRIPT_ROOT}/hack/e2e/prometheus-adapter.yaml | ||
kubectl apply -f ${SCRIPT_ROOT}/hack/e2e/metrics-pump.yaml | ||
kubectl apply -f ${SCRIPT_ROOT}/hack/e2e/${i}-deployment.yaml | ||
else | ||
REGISTRY=${REGISTRY} TAG=${TAG} ${SCRIPT_ROOT}/hack/vpa-process-yaml.sh ${SCRIPT_ROOT}/deploy/${i}-deployment.yaml | kubectl apply -f - | ||
fi | ||
done |
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,81 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2018 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/.. | ||
|
||
function print_help { | ||
echo "ERROR! Usage: deploy-for-e2e.sh [suite]*" | ||
echo "<suite> should be one of:" | ||
echo " - recommender" | ||
echo " - updater" | ||
echo " - admission-controller" | ||
echo " - actuation" | ||
echo " - full-vpa" | ||
echo "If component is not specified all above will be started." | ||
} | ||
|
||
if [ $# -eq 0 ]; then | ||
print_help | ||
exit 1 | ||
fi | ||
|
||
if [ $# -gt 1 ]; then | ||
print_help | ||
exit 1 | ||
fi | ||
|
||
SUITE=$1 | ||
|
||
case ${SUITE} in | ||
recommender|updater|admission-controller) | ||
COMPONENTS="${SUITE}" | ||
;; | ||
full-vpa) | ||
COMPONENTS="recommender updater admission-controller" | ||
;; | ||
actuation) | ||
COMPONENTS="updater admission-controller" | ||
;; | ||
*) | ||
print_help | ||
exit 1 | ||
;; | ||
esac | ||
|
||
export REGISTRY=gcr.io/`gcloud config get-value core/project` | ||
export TAG=latest | ||
|
||
echo "Configuring registry authentication" | ||
mkdir -p "${HOME}/.docker" | ||
gcloud auth configure-docker -q | ||
|
||
for i in ${COMPONENTS}; do | ||
if [ $i == admission-controller ] ; then | ||
(cd ${SCRIPT_ROOT}/pkg/${i} && bash ./gencerts.sh e2e || true) | ||
fi | ||
ALL_ARCHITECTURES=amd64 make --directory ${SCRIPT_ROOT}/pkg/${i} release | ||
done | ||
|
||
kubectl create -f ${SCRIPT_ROOT}/deploy/mpa-v1alpha1-crd-gen.yaml | ||
kubectl create -f ${SCRIPT_ROOT}/deploy/mpa-rbac.yaml | ||
|
||
for i in ${COMPONENTS}; do | ||
${SCRIPT_ROOT}/hack/vpa-process-yaml.sh ${SCRIPT_ROOT}/deploy/${i}-deployment.yaml | kubectl create -f - | ||
done |
18 changes: 18 additions & 0 deletions
18
multidimensional-pod-autoscaler/hack/e2e/Dockerfile.externalmetrics-writer
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,18 @@ | ||
# Copyright 2023 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FROM python:3.10-slim | ||
RUN pip3 install kubernetes argparse requests | ||
|
||
COPY emit-metrics.py / |
Oops, something went wrong.