forked from solo-io/gloo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stability: Simplify Image Building and Publishing CI (solo-io#8060)
* clarify variables in makefile around creating assets * simplify setup-kind script, move assets into kind directory, reuse os/arch variables from makefile * change script reference * introduce build-cli-local, remove arm code for mtls test * make fmt * cleanup references to localhost:5000 * add changelog * update changelog * unfocus test * simplify docker/kind make targets * move changelog dir to rc1 * Adding changelog file to new location * Deleting changelog file from old location * move changelog dir to beta1 * remove extended images, simplify docker publishing * docker-retag: DRY * small cleanup * separate retag and publish-retag * undo import rename * setup-kind: improve readability * docker-publish -> publish-docker * Adding changelog file to new location * Deleting changelog file from old location * support kind-build-and-load-% like we do in solo-projects * oneline * fix oneline naming * fix oneline naming * Adding changelog file to new location * Deleting changelog file from old location * IMAGE_REPO -> IMAGE_REGISTRY --------- Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com> Co-authored-by: changelog-bot <changelog-bot>
- Loading branch information
1 parent
5b83075
commit 35bfd59
Showing
19 changed files
with
310 additions
and
454 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
changelog: | ||
- type: NON_USER_FACING | ||
issueLink: https://github.com/solo-io/gloo/issues/5471 | ||
resolvesIssue: false | ||
description: >- | ||
Simplify how we setup a kind cluster used in our kubernetes regression tests. |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
kubeadmConfigPatches: | ||
- | | ||
apiVersion: kubeadm.k8s.io/v1beta3 | ||
kind: ClusterConfiguration | ||
metadata: | ||
name: config | ||
- | | ||
apiVersion: kubeadm.k8s.io/v1beta3 | ||
kind: InitConfiguration | ||
metadata: | ||
name: config |
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,73 @@ | ||
#!/bin/bash -ex | ||
|
||
# 0. Assign default values to some of our environment variables | ||
# Get directory this script is located in to access script local files | ||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" | ||
# The name of the kind cluster to deploy to | ||
CLUSTER_NAME="${CLUSTER_NAME:-kind}" | ||
# The version of the Node Docker image to use for booting the cluster | ||
CLUSTER_NODE_VERSION="${CLUSTER_NODE_VERSION:-v1.25.3}" | ||
# The version used to tag images | ||
VERSION="${VERSION:-1.0.0-ci}" | ||
# Skip building docker images if we are testing a released version | ||
SKIP_DOCKER="${SKIP_DOCKER:-false}" | ||
# Stop after creating the kind cluster | ||
JUST_KIND="${JUST_KIND:-false}" | ||
# Offer a default value for type of installation | ||
KUBE2E_TESTS="${KUBE2E_TESTS:-gateway}" # If 'KUBE2E_TESTS' not set or null, use 'gateway'. | ||
# The version of istio to install for glooctl tests | ||
# https://istio.io/latest/docs/releases/supported-releases/#support-status-of-istio-releases | ||
ISTIO_VERSION="${ISTIO_VERSION:-1.17.1}" | ||
|
||
function create_kind_cluster_or_skip() { | ||
activeClusters=$(kind get clusters) | ||
|
||
# if the kind cluster exists already, return | ||
if [[ "$activeClusters" =~ .*"$CLUSTER_NAME".* ]]; then | ||
echo "cluster exists, skipping cluster creation" | ||
return | ||
fi | ||
|
||
echo "creating cluster ${CLUSTER_NAME}" | ||
kind create cluster \ | ||
--name "$CLUSTER_NAME" \ | ||
--image "kindest/node:$CLUSTER_NODE_VERSION" \ | ||
--config="$SCRIPT_DIR/cluster.yaml" | ||
echo "Finished setting up cluster $CLUSTER_NAME" | ||
|
||
# so that you can just build the kind image alone if needed | ||
if [[ $JUST_KIND == 'true' ]]; then | ||
echo "JUST_KIND=true, not building images" | ||
exit | ||
fi | ||
} | ||
|
||
# 1. Create a kind cluster (or skip creation if a cluster with name=CLUSTER_NAME already exists) | ||
# This config is roughly based on: https://kind.sigs.k8s.io/docs/user/ingress/ | ||
create_kind_cluster_or_skip | ||
|
||
if [[ $SKIP_DOCKER == 'true' ]]; then | ||
echo "SKIP_DOCKER=true, not building images or chart" | ||
else | ||
# 2. Make all the docker images and load them to the kind cluster | ||
VERSION=$VERSION CLUSTER_NAME=$CLUSTER_NAME make kind-build-and-load | ||
|
||
# 3. Build the test helm chart, ensuring we have a chart in the `_test` folder | ||
VERSION=$VERSION make build-test-chart | ||
fi | ||
|
||
# 4. Build the gloo command line tool, ensuring we have one in the `_output` folder | ||
make build-cli-local | ||
|
||
# 5. Install additional resources used for particular KUBE2E tests | ||
if [[ $KUBE2E_TESTS = "glooctl" || $KUBE2E_TESTS = "istio" ]]; then | ||
TARGET_ARCH=x86_64 | ||
if [[ $ARCH == 'arm64' ]]; then | ||
TARGET_ARCH=arm64 | ||
fi | ||
echo "Downloading Istio $ISTIO_VERSION" | ||
curl -L https://istio.io/downloadIstio | ISTIO_VERSION=$ISTIO_VERSION TARGET_ARCH=$TARGET_ARCH sh - | ||
|
||
echo "Installing Istio" | ||
yes | "./istio-$ISTIO_VERSION/bin/istioctl" install --set profile=minimal | ||
fi |
Oops, something went wrong.