Skip to content

Commit

Permalink
Bump kubevirtci
Browse files Browse the repository at this point in the history
[6101481 cluster kind: add kind-1.27](kubevirt/kubevirtci#1027)
[865e563 k8s-1.27: Bump CRIO](kubevirt/kubevirtci#1029)

```release-note
NONE
```

Signed-off-by: kubevirt-bot <[email protected]>
  • Loading branch information
kubevirt-bot authored and akalenyu committed Jul 13, 2023
1 parent feb1693 commit 67a688f
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cluster-up-sha.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
421e919fd8c849930a6be66e5696e80ac81df5b3
c941b504e3899de4b96c7f14c5203eb4a6e0c2e8
45 changes: 45 additions & 0 deletions cluster-up/cluster/kind-1.27/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# K8S with mdev support in a Kind cluster

Provides a pre-deployed k8s cluster that runs using [kind](https://github.com/kubernetes-sigs/kind) The cluster is completely ephemeral and is recreated on every cluster restart.
The KubeVirt containers are built on the local machine and are then pushed to a registry which is exposed at
`localhost:5000`.

## Bringing the cluster up

The following needs to be executed as root. Please refer to the name of the directory to get the kind version.

```bash
export KUBEVIRT_PROVIDER=kind-x.yz
make cluster-up
```

The cluster can be accessed as usual:

```bash
$ cluster-up/kubectl.sh get nodes
NAME STATUS ROLES AGE
kind-x.yz-control-plane Ready master 6m14s
```

## Bringing the cluster down

```bash
make cluster-down
```

This destroys the whole cluster.

## Setting a custom kind version

In order to use a custom kind image / kind version,
export KIND_NODE_IMAGE, KIND_VERSION, KUBECTL_PATH before running cluster-up.
For example in order to use kind 0.9.0 (which is based on k8s-1.19.1) use:
```bash
export KIND_NODE_IMAGE="kindest/node:v1.19.1@sha256:98cf5288864662e37115e362b23e4369c8c4a408f99cbc06e58ac30ddc721600"
export KIND_VERSION="0.9.0"
export KUBECTL_PATH="/usr/bin/kubectl"
```
This allows users to test or use custom images / different kind versions before making them official.
See https://github.com/kubernetes-sigs/kind/releases for details about node images according to the kind version.

- In order to use `make cluster-down` please make sure the right `CLUSTER_NAME` is exported.
51 changes: 51 additions & 0 deletions cluster-up/cluster/kind-1.27/provider.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env bash

set -e

DEFAULT_CLUSTER_NAME="kind-1.27"
DEFAULT_HOST_PORT=5000
ALTERNATE_HOST_PORT=5001
export CLUSTER_NAME=${CLUSTER_NAME:-$DEFAULT_CLUSTER_NAME}

if [ $CLUSTER_NAME == $DEFAULT_CLUSTER_NAME ]; then
export HOST_PORT=$DEFAULT_HOST_PORT
else
export HOST_PORT=$ALTERNATE_HOST_PORT
fi

function set_kind_params() {
export KIND_VERSION="${KIND_VERSION:-0.19.0}"
export KIND_NODE_IMAGE="${KIND_NODE_IMAGE:-kindest/node:v1.27.1@sha256:b7d12ed662b873bd8510879c1846e87c7e676a79fefc93e17b2a52989d3ff42b}"
export KUBECTL_PATH="${KUBECTL_PATH:-/usr/bin/kubectl}"
}

function configure_registry_proxy() {
[ "$CI" != "true" ] && return

echo "Configuring cluster nodes to work with CI mirror-proxy..."

local -r ci_proxy_hostname="docker-mirror-proxy.kubevirt-prow.svc"
local -r kind_binary_path="${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kind"
local -r configure_registry_proxy_script="${KUBEVIRTCI_PATH}/cluster/kind/configure-registry-proxy.sh"

KIND_BIN="$kind_binary_path" PROXY_HOSTNAME="$ci_proxy_hostname" $configure_registry_proxy_script
}

function up() {
cp $KIND_MANIFESTS_DIR/kind.yaml ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml
_add_kubeadm_cpu_manager_config_patch
_add_extra_mounts
export CONFIG_WORKER_CPU_MANAGER=true
kind_up

configure_registry_proxy

# remove the rancher.io kind default storageClass
_kubectl delete sc standard

echo "$KUBEVIRT_PROVIDER cluster '$CLUSTER_NAME' is ready"
}

set_kind_params

source ${KUBEVIRTCI_PATH}/cluster/kind/common.sh
2 changes: 1 addition & 1 deletion cluster-up/hack/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ provider_prefix=${JOB_NAME:-${KUBEVIRT_PROVIDER}}${EXECUTOR_NUMBER}
job_prefix=${JOB_NAME:-kubevirt}${EXECUTOR_NUMBER}

mkdir -p $KUBEVIRTCI_CONFIG_PATH/$KUBEVIRT_PROVIDER
KUBEVIRTCI_TAG=2306132225-e29c9f6
KUBEVIRTCI_TAG=2306151451-6101481
2 changes: 1 addition & 1 deletion cluster-up/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2306132225-e29c9f6
2306151451-6101481
2 changes: 1 addition & 1 deletion hack/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cdi_namespace=cdi
image_pull_policy=${IMAGE_PULL_POLICY:-IfNotPresent}
verbosity=${VERBOSITY:-2}
package_name=${PACKAGE_NAME:-kubevirt-dev}
kubevirtci_git_hash="2306132225-e29c9f6"
kubevirtci_git_hash="2306151451-6101481"
conn_check_ipv4_address=${CONN_CHECK_IPV4_ADDRESS:-""}
conn_check_ipv6_address=${CONN_CHECK_IPV6_ADDRESS:-""}
conn_check_dns=${CONN_CHECK_DNS:-""}
Expand Down

0 comments on commit 67a688f

Please sign in to comment.