From 88a5a988a0afc7c92f1a92f02a93a62077c51852 Mon Sep 17 00:00:00 2001 From: Enrique Llorente Pastora Date: Fri, 10 Jul 2020 11:21:39 +0200 Subject: [PATCH] Remove ocp/okd cluster-up (#405) They are not going to be maintained and current images are not working Signed-off-by: Quique Llorente --- cluster-up/cluster/images.sh | 10 ---- cluster-up/cluster/ocp-4.3/README.md | 52 ------------------ cluster-up/cluster/ocp-4.3/provider.sh | 73 ------------------------- cluster-up/cluster/ocp-4.4/README.md | 61 --------------------- cluster-up/cluster/ocp-4.4/provider.sh | 73 ------------------------- cluster-up/cluster/okd-4.1/README.md | 44 --------------- cluster-up/cluster/okd-4.1/provider.sh | 76 -------------------------- cluster-up/cluster/okd-4.2/README.md | 44 --------------- cluster-up/cluster/okd-4.2/provider.sh | 59 -------------------- cluster-up/cluster/okd-4.3/README.md | 45 --------------- cluster-up/cluster/okd-4.3/provider.sh | 75 ------------------------- cluster-up/container.sh | 22 -------- cluster-up/ssh.sh | 17 +----- 13 files changed, 1 insertion(+), 650 deletions(-) delete mode 100644 cluster-up/cluster/ocp-4.3/README.md delete mode 100755 cluster-up/cluster/ocp-4.3/provider.sh delete mode 100644 cluster-up/cluster/ocp-4.4/README.md delete mode 100755 cluster-up/cluster/ocp-4.4/provider.sh delete mode 100644 cluster-up/cluster/okd-4.1/README.md delete mode 100755 cluster-up/cluster/okd-4.1/provider.sh delete mode 100644 cluster-up/cluster/okd-4.2/README.md delete mode 100755 cluster-up/cluster/okd-4.2/provider.sh delete mode 100644 cluster-up/cluster/okd-4.3/README.md delete mode 100755 cluster-up/cluster/okd-4.3/provider.sh delete mode 100755 cluster-up/container.sh diff --git a/cluster-up/cluster/images.sh b/cluster-up/cluster/images.sh index 2322b1ef1c..a402719324 100644 --- a/cluster-up/cluster/images.sh +++ b/cluster-up/cluster/images.sh @@ -11,18 +11,8 @@ if [ -z $KUBEVIRTCI_PROVISION_CHECK ]; then IMAGES[k8s-1.16]="k8s-1.16@sha256:1e153fb62c9a30ce6bc6ddc1af21bb28a56b780ec93ab15e113d729bf664469a" IMAGES[k8s-1.15]="k8s-1.15@sha256:c58cb9d79968590f24e070bc2517088d44fa2f83ba73e989a7e0f690ad08460b" IMAGES[k8s-1.14]="k8s-1.14@sha256:46e449b292dcb420f0944cac0a7a5c667c6f19bba2a4192737380e8e77f27ed0" - IMAGES[okd-4.1]="okd-4.1@sha256:e7e3a03bb144eb8c0be4dcd700592934856fb623d51a2b53871d69267ca51c86" - IMAGES[okd-4.2]="okd-4.2@sha256:a830064ca7bf5c5c2f15df180f816534e669a9a038fef4919116d61eb33e84c5" - IMAGES[okd-4.3]="okd-4.3@sha256:63abc3884002a615712dfac5f42785be864ea62006892bf8a086ccdbca8b3d38" - IMAGES[ocp-4.3]="ocp-4.3@sha256:d293f0bca338136ed136b08851de780d710c9e40e2a1d18e5a5595491dbdd1ea" - IMAGES[ocp-4.4]="ocp-4.4@sha256:42497f3a848c2847e3caeff6fbb7f4bb28ee48b692c0541ec7099392067a0387" fi export IMAGES -IMAGE_SUFFIX="" -if [[ $KUBEVIRT_PROVIDER =~ (ocp|okd).* ]]; then - IMAGE_SUFFIX="-provision" -fi - image="${IMAGES[$KUBEVIRT_PROVIDER]:-${KUBEVIRT_PROVIDER}${IMAGE_SUFFIX}:latest}" export image diff --git a/cluster-up/cluster/ocp-4.3/README.md b/cluster-up/cluster/ocp-4.3/README.md deleted file mode 100644 index e060c26319..0000000000 --- a/cluster-up/cluster/ocp-4.3/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# OCP 4.3 in ephemeral containers - -Provides a pre-deployed OCP with version 4.3 purely in docker -containers with libvirt. The provided VMs are completely ephemeral and are -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 container is stored at a private repository at quay.io/kubevirtci, you -have to ask for pull permissions there and do a docker login before cluster-up - -```bash -docker login -u [quay user] -p [quay password] quay.io -``` - -```bash -export KUBEVIRT_PROVIDER=ocp-4.3 -export KUBEVIRT_NUM_NODES=3 # master + two workers -make cluster-up -``` - -The cluster can be accessed as usual: - -```bash -$ cluster/kubectl.sh get nodes -NAME STATUS ROLES AGE VERSION -test-1-82xp6-master-0 Ready master 62m v1.12.4+509916ce1 -test-1-82xp6-worker-0-wxf27 Ready worker 57m v1.12.4+509916ce1 -``` - -## Bringing the cluster down - -```bash -export KUBEVIRT_PROVIDER=ocp-4.3 -make cluster-down -``` - -This destroys the whole cluster. Recreating the cluster is fast, since OCP is -already pre-deployed. The only state which is kept is the state of the local -docker registry. - -## Destroying the docker registry state - -The docker registry survives a `make cluster-down`. It's state is stored in a -docker volume called `kubevirt_registry`. If the volume gets too big or the -volume contains corrupt data, it can be deleted with - -```bash -docker volume rm kubevirt_registry -``` diff --git a/cluster-up/cluster/ocp-4.3/provider.sh b/cluster-up/cluster/ocp-4.3/provider.sh deleted file mode 100755 index aa71648b4c..0000000000 --- a/cluster-up/cluster/ocp-4.3/provider.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env bash - -set -e - -source ${KUBEVIRTCI_PATH}/cluster/ephemeral-provider-common.sh -source ${KUBEVIRTCI_PATH}/cluster/openshift-provider-common.sh - -function _port() { - ${_cli} ports --prefix $provider_prefix --container-name cluster "$@" -} - -function _install_from_cluster() { - local src_cid="$1" - local src_file="$2" - local dst_perms="$3" - local dst_file="${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/$4" - - touch $dst_file - chmod $dst_perms $dst_file - docker exec $src_cid cat $src_file > $dst_file -} - -function up() { - container_registry="quay.io" - workers=$(($KUBEVIRT_NUM_NODES-1)) - if [[ ( $workers < 1 ) ]]; then - workers=1 - fi - echo "Number of workers: $workers" - params="--random-ports --background --prefix $provider_prefix --master-cpu 6 --workers-cpu 6 --workers-memory 8192 --secondary-nics ${KUBEVIRT_NUM_SECONDARY_NICS} --registry-volume $(_registry_volume) --workers $workers kubevirtci/${image}" - if [[ ! -z "${RHEL_NFS_DIR}" ]]; then - params=" --nfs-data $RHEL_NFS_DIR ${params}" - fi - - if [[ ! -z "${OKD_CONSOLE_PORT}" ]]; then - params=" --ocp-console-port $OKD_CONSOLE_PORT ${params}" - fi - - if [[ ! -z "${INSTALLER_PULL_SECRET}" ]]; then - params=" --installer-pull-secret-file ${INSTALLER_PULL_SECRET} ${params}" - fi - - # The auth has the format base64(user:password) - auth=$(cat ~/.docker/config.json | docker run --rm -i imega/jq:1.6 -r '.auths["'$container_registry'"]["auth"]' |base64 -d) - user=$(echo $auth |awk -F: '{print $1}') - password=$(echo $auth |awk -F: '{print $2}') - - # If provision test mode is on, use local image - if [ -z $KUBEVIRTCI_PROVISION_CHECK ]; then - params=" --container-registry ${container_registry} $params" - else - params=" --container-registry= $params" - fi - - ${_cli} run okd ${params} --container-registry-user $user --container-registry-password $password - - # Copy k8s config and kubectl - cluster_container_id=$(docker ps -f "name=$provider_prefix-cluster" --format "{{.ID}}") - - _install_from_cluster $cluster_container_id /usr/local/bin/oc 0755 .kubectl - _install_from_cluster $cluster_container_id /root/install/auth/kubeconfig 0644 .kubeconfig - - # Set server and disable tls check - export KUBECONFIG=${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubeconfig - ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl config set-cluster test-1 --server=https://$(_main_ip):$(_port k8s) - ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl config set-cluster test-1 --insecure-skip-tls-verify=true - - - # Make sure that local config is correct - prepare_config - - ln_kubeconfig -} diff --git a/cluster-up/cluster/ocp-4.4/README.md b/cluster-up/cluster/ocp-4.4/README.md deleted file mode 100644 index 44a025de85..0000000000 --- a/cluster-up/cluster/ocp-4.4/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# OCP 4.4 in ephemeral containers - -Provides a pre-deployed OCP with version 4.4 purely in docker -containers with libvirt. The provided VMs are completely ephemeral and are -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`. - -It also comes with OVNKubernetes at ocp networking type instead of OpenShiftSDN -you can follow guide to play with it [1]. - -There are 3 masters and 1 worker due to -https://bugzilla.redhat.com/show_bug.cgi?id=1805034 -Machine should be stronger, and more time needed for cluster-up. - -[1] https://github.com/ovn-org/ovn-kubernetes/blob/master/README_MANUAL.md - -## Bringing the cluster up - -The container is stored at a private repository at quay.io/kubevirtci, you -have to ask for pull permissions there and do a docker login before cluster-up - -```bash -docker login -u [quay user] -p [quay password] quay.io -``` - -```bash -export KUBEVIRT_PROVIDER=ocp-4.4 -export KUBEVIRT_NUM_NODES=3 # master + two workers -make cluster-up -``` - -The cluster can be accessed as usual: - -```bash -$ cluster/kubectl.sh get nodes -NAME STATUS ROLES AGE VERSION -test-1-82xp6-master-0 Ready master 62m v1.12.4+509916ce1 -test-1-82xp6-worker-0-wxf27 Ready worker 57m v1.12.4+509916ce1 -``` - -## Bringing the cluster down - -```bash -export KUBEVIRT_PROVIDER=ocp-4.4 -make cluster-down -``` - -This destroys the whole cluster. Recreating the cluster is fast, since OCP is -already pre-deployed. The only state which is kept is the state of the local -docker registry. - -## Destroying the docker registry state - -The docker registry survives a `make cluster-down`. It's state is stored in a -docker volume called `kubevirt_registry`. If the volume gets too big or the -volume contains corrupt data, it can be deleted with - -```bash -docker volume rm kubevirt_registry -``` diff --git a/cluster-up/cluster/ocp-4.4/provider.sh b/cluster-up/cluster/ocp-4.4/provider.sh deleted file mode 100755 index aa71648b4c..0000000000 --- a/cluster-up/cluster/ocp-4.4/provider.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env bash - -set -e - -source ${KUBEVIRTCI_PATH}/cluster/ephemeral-provider-common.sh -source ${KUBEVIRTCI_PATH}/cluster/openshift-provider-common.sh - -function _port() { - ${_cli} ports --prefix $provider_prefix --container-name cluster "$@" -} - -function _install_from_cluster() { - local src_cid="$1" - local src_file="$2" - local dst_perms="$3" - local dst_file="${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/$4" - - touch $dst_file - chmod $dst_perms $dst_file - docker exec $src_cid cat $src_file > $dst_file -} - -function up() { - container_registry="quay.io" - workers=$(($KUBEVIRT_NUM_NODES-1)) - if [[ ( $workers < 1 ) ]]; then - workers=1 - fi - echo "Number of workers: $workers" - params="--random-ports --background --prefix $provider_prefix --master-cpu 6 --workers-cpu 6 --workers-memory 8192 --secondary-nics ${KUBEVIRT_NUM_SECONDARY_NICS} --registry-volume $(_registry_volume) --workers $workers kubevirtci/${image}" - if [[ ! -z "${RHEL_NFS_DIR}" ]]; then - params=" --nfs-data $RHEL_NFS_DIR ${params}" - fi - - if [[ ! -z "${OKD_CONSOLE_PORT}" ]]; then - params=" --ocp-console-port $OKD_CONSOLE_PORT ${params}" - fi - - if [[ ! -z "${INSTALLER_PULL_SECRET}" ]]; then - params=" --installer-pull-secret-file ${INSTALLER_PULL_SECRET} ${params}" - fi - - # The auth has the format base64(user:password) - auth=$(cat ~/.docker/config.json | docker run --rm -i imega/jq:1.6 -r '.auths["'$container_registry'"]["auth"]' |base64 -d) - user=$(echo $auth |awk -F: '{print $1}') - password=$(echo $auth |awk -F: '{print $2}') - - # If provision test mode is on, use local image - if [ -z $KUBEVIRTCI_PROVISION_CHECK ]; then - params=" --container-registry ${container_registry} $params" - else - params=" --container-registry= $params" - fi - - ${_cli} run okd ${params} --container-registry-user $user --container-registry-password $password - - # Copy k8s config and kubectl - cluster_container_id=$(docker ps -f "name=$provider_prefix-cluster" --format "{{.ID}}") - - _install_from_cluster $cluster_container_id /usr/local/bin/oc 0755 .kubectl - _install_from_cluster $cluster_container_id /root/install/auth/kubeconfig 0644 .kubeconfig - - # Set server and disable tls check - export KUBECONFIG=${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubeconfig - ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl config set-cluster test-1 --server=https://$(_main_ip):$(_port k8s) - ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl config set-cluster test-1 --insecure-skip-tls-verify=true - - - # Make sure that local config is correct - prepare_config - - ln_kubeconfig -} diff --git a/cluster-up/cluster/okd-4.1/README.md b/cluster-up/cluster/okd-4.1/README.md deleted file mode 100644 index ba8a182d9c..0000000000 --- a/cluster-up/cluster/okd-4.1/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# OKD 4.1 in ephemeral containers - -Provides a pre-deployed OKD with version 4.1 purely in docker -containers with libvirt. The provided VMs are completely ephemeral and are -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 - -```bash -export KUBEVIRT_PROVIDER=okd-4.1 -make cluster-up -``` - -The cluster can be accessed as usual: - -```bash -$ cluster/kubectl.sh get nodes -NAME STATUS ROLES AGE VERSION -test-1-82xp6-master-0 Ready master 62m v1.12.4+509916ce1 -test-1-82xp6-worker-0-wxf27 Ready worker 57m v1.12.4+509916ce1 -``` - -## Bringing the cluster down - -```bash -export KUBEVIRT_PROVIDER=okd-4.1 -make cluster-down -``` - -This destroys the whole cluster. Recreating the cluster is fast, since OKD is -already pre-deployed. The only state which is kept is the state of the local -docker registry. - -## Destroying the docker registry state - -The docker registry survives a `make cluster-down`. It's state is stored in a -docker volume called `kubevirt_registry`. If the volume gets too big or the -volume contains corrupt data, it can be deleted with - -```bash -docker volume rm kubevirt_registry -``` diff --git a/cluster-up/cluster/okd-4.1/provider.sh b/cluster-up/cluster/okd-4.1/provider.sh deleted file mode 100755 index adb7f91afe..0000000000 --- a/cluster-up/cluster/okd-4.1/provider.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env bash - -set -e - -source ${KUBEVIRTCI_PATH}/cluster/ephemeral-provider-common.sh -source ${KUBEVIRTCI_PATH}/cluster/openshift-provider-common.sh - -function _port() { - ${_cli} ports --prefix $provider_prefix --container-name cluster "$@" -} - -function _install_from_cluster() { - local src_cid="$1" - local src_file="$2" - local dst_perms="$3" - local dst_name="$4" - local dst_file="${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/$4" - local pack8s_path="$5" - - if [ "$KUBEVIRTCI_RUNTIME" = "podman" ]; then - pack8s exec $src_cid cp $src_file /tmp/$dst_name - cp $pack8s_path/$dst_name $dst_file - else - touch $dst_file - docker exec $src_cid cat $src_file > $dst_file - fi - chmod $dst_perms $dst_file -} - -function up() { - workers=$(($KUBEVIRT_NUM_NODES-1)) - if [[ ( $workers < 1 ) ]]; then - workers=1 - fi - echo "Number of workers: $workers" - params="--random-ports --background --prefix $provider_prefix --master-cpu 6 --workers-cpu 6 --workers-memory 8192 --secondary-nics ${KUBEVIRT_NUM_SECONDARY_NICS} --registry-volume $(_registry_volume) --workers $workers kubevirtci/${image}" - if [[ ! -z "${RHEL_NFS_DIR}" ]]; then - params=" --nfs-data $RHEL_NFS_DIR ${params}" - fi - - if [[ ! -z "${OKD_CONSOLE_PORT}" ]]; then - params=" --ocp-console-port $OKD_CONSOLE_PORT ${params}" - fi - - if [[ ! -z "${INSTALLER_PULL_SECRET}" ]]; then - params=" --installer-pull-secret-file ${INSTALLER_PULL_SECRET} ${params}" - fi - - if [ "$KUBEVIRTCI_RUNTIME" = "podman" ]; then - pack8s_path=$(mktemp -d /tmp/pack8sXXX) - params=" --volume $pack8s_path:/tmp ${params}" - fi - - ${_cli} run okd ${params} - - - if [ "$KUBEVIRTCI_RUNTIME" = "podman" ]; then - cluster_container_id=$(pack8s -p "$provider_prefix-cluster" show -i) - else - cluster_container_id=$(docker ps -f "name=$provider_prefix-cluster" --format "{{.ID}}") - fi - # Copy k8s config and kubectl - - _install_from_cluster $cluster_container_id /usr/local/bin/oc 0755 .kubectl $pack8s_path - _install_from_cluster $cluster_container_id /root/install/auth/kubeconfig 0644 .kubeconfig $pack8s_path - - # Set server and disable tls check - export KUBECONFIG=${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubeconfig - ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl config set-cluster test-1 --server=https://$(_main_ip):$(_port k8s) - ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl config set-cluster test-1 --insecure-skip-tls-verify=true - - # Make sure that local config is correct - prepare_config - - ln_kubeconfig -} diff --git a/cluster-up/cluster/okd-4.2/README.md b/cluster-up/cluster/okd-4.2/README.md deleted file mode 100644 index 51a6326064..0000000000 --- a/cluster-up/cluster/okd-4.2/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# OKD 4.2 in ephemeral containers - -Provides a pre-deployed OKD with version 4.2 purely in docker -containers with libvirt. The provided VMs are completely ephemeral and are -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 - -```bash -export KUBEVIRT_PROVIDER=okd-4.2 -make cluster-up -``` - -The cluster can be accessed as usual: - -```bash -$ cluster/kubectl.sh get nodes -NAME STATUS ROLES AGE VERSION -test-1-82xp6-master-0 Ready master 62m v1.14.4+509916ce1 -test-1-82xp6-worker-0-wxf27 Ready worker 57m v1.14.4+509916ce1 -``` - -## Bringing the cluster down - -```bash -export KUBEVIRT_PROVIDER=okd-4.2 -make cluster-down -``` - -This destroys the whole cluster. Recreating the cluster is fast, since OKD is -already pre-deployed. The only state which is kept is the state of the local -docker registry. - -## Destroying the docker registry state - -The docker registry survives a `make cluster-down`. It's state is stored in a -docker volume called `kubevirt_registry`. If the volume gets too big or the -volume contains corrupt data, it can be deleted with - -```bash -docker volume rm kubevirt_registry -``` diff --git a/cluster-up/cluster/okd-4.2/provider.sh b/cluster-up/cluster/okd-4.2/provider.sh deleted file mode 100755 index 53de92cbd8..0000000000 --- a/cluster-up/cluster/okd-4.2/provider.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env bash - -set -e - -source ${KUBEVIRTCI_PATH}/cluster/ephemeral-provider-common.sh -source ${KUBEVIRTCI_PATH}/cluster/openshift-provider-common.sh - -function _port() { - ${_cli} ports --prefix $provider_prefix --container-name cluster "$@" -} - -function _install_from_cluster() { - local src_cid="$1" - local src_file="$2" - local dst_perms="$3" - local dst_file="${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/$4" - - touch $dst_file - chmod $dst_perms $dst_file - docker exec $src_cid cat $src_file > $dst_file -} - -function up() { - workers=$(($KUBEVIRT_NUM_NODES-1)) - if [[ ( $workers < 1 ) ]]; then - workers=1 - fi - echo "Number of workers: $workers" - params="--random-ports --background --prefix $provider_prefix --master-cpu 6 --workers-cpu 6 --workers-memory 8192 --secondary-nics ${KUBEVIRT_NUM_SECONDARY_NICS} --registry-volume $(_registry_volume) --workers $workers kubevirtci/${image}" - if [[ ! -z "${RHEL_NFS_DIR}" ]]; then - params=" --nfs-data $RHEL_NFS_DIR ${params}" - fi - - if [[ ! -z "${OKD_CONSOLE_PORT}" ]]; then - params=" --ocp-console-port $OKD_CONSOLE_PORT ${params}" - fi - - if [[ ! -z "${INSTALLER_PULL_SECRET}" ]]; then - params=" --installer-pull-secret-file ${INSTALLER_PULL_SECRET} ${params}" - fi - - ${_cli} run okd ${params} - - # Copy k8s config and kubectl - cluster_container_id=$(docker ps -f "name=$provider_prefix-cluster" --format "{{.ID}}") - - _install_from_cluster $cluster_container_id /usr/local/bin/oc 0755 .kubectl - _install_from_cluster $cluster_container_id /root/install/auth/kubeconfig 0644 .kubeconfig - - # Set server and disable tls check - export KUBECONFIG=${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubeconfig - ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl config set-cluster test-1 --server=https://$(_main_ip):$(_port k8s) - ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl config set-cluster test-1 --insecure-skip-tls-verify=true - - # Make sure that local config is correct - prepare_config - - ln_kubeconfig -} diff --git a/cluster-up/cluster/okd-4.3/README.md b/cluster-up/cluster/okd-4.3/README.md deleted file mode 100644 index b1a7078afc..0000000000 --- a/cluster-up/cluster/okd-4.3/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# OKD 4.3 in ephemeral containers - -Provides a pre-deployed OKD with version 4.3 purely in docker -containers with libvirt. The provided VMs are completely ephemeral and are -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 - -```bash -export KUBEVIRT_PROVIDER=okd-4.3 -export KUBEVIRT_NUM_NODES=3 # master + two workers -make cluster-up -``` - -The cluster can be accessed as usual: - -```bash -$ cluster/kubectl.sh get nodes -NAME STATUS ROLES AGE VERSION -test-1-82xp6-master-0 Ready master 62m v1.12.4+509916ce1 -test-1-82xp6-worker-0-wxf27 Ready worker 57m v1.12.4+509916ce1 -``` - -## Bringing the cluster down - -```bash -export KUBEVIRT_PROVIDER=okd-4.3 -make cluster-down -``` - -This destroys the whole cluster. Recreating the cluster is fast, since OKD is -already pre-deployed. The only state which is kept is the state of the local -docker registry. - -## Destroying the docker registry state - -The docker registry survives a `make cluster-down`. It's state is stored in a -docker volume called `kubevirt_registry`. If the volume gets too big or the -volume contains corrupt data, it can be deleted with - -```bash -docker volume rm kubevirt_registry -``` diff --git a/cluster-up/cluster/okd-4.3/provider.sh b/cluster-up/cluster/okd-4.3/provider.sh deleted file mode 100755 index 78a509cf20..0000000000 --- a/cluster-up/cluster/okd-4.3/provider.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env bash - -set -e - -source ${KUBEVIRTCI_PATH}/cluster/ephemeral-provider-common.sh -source ${KUBEVIRTCI_PATH}/cluster/openshift-provider-common.sh - -function _port() { - ${_cli} ports --prefix $provider_prefix --container-name cluster "$@" -} - -function _install_from_cluster() { - local src_cid="$1" - local src_file="$2" - local dst_perms="$3" - local dst_name="$4" - local dst_file="${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/$4" - local pack8s_path="$5" - - if [ "$KUBEVIRTCI_RUNTIME" = "podman" ]; then - pack8s exec $src_cid cp $src_file /tmp/$dst_name - cp $pack8s_path/$dst_name $dst_file - else - touch $dst_file - docker exec $src_cid cat $src_file > $dst_file - fi - chmod $dst_perms $dst_file -} - -function up() { - workers=$(($KUBEVIRT_NUM_NODES-1)) - if [[ ( $workers < 1 ) ]]; then - workers=1 - fi - echo "Number of workers: $workers" - params="--random-ports --background --prefix $provider_prefix --master-cpu 6 --workers-cpu 6 --secondary-nics ${KUBEVIRT_NUM_SECONDARY_NICS} --registry-volume $(_registry_volume) --workers $workers kubevirtci/${image}" - if [[ ! -z "${RHEL_NFS_DIR}" ]]; then - params=" --nfs-data $RHEL_NFS_DIR ${params}" - fi - - if [[ ! -z "${OKD_CONSOLE_PORT}" ]]; then - params=" --ocp-console-port $OKD_CONSOLE_PORT ${params}" - fi - - if [[ ! -z "${INSTALLER_PULL_SECRET}" ]]; then - params=" --installer-pull-secret-file ${INSTALLER_PULL_SECRET} ${params}" - fi - - if [ "$KUBEVIRTCI_RUNTIME" = "podman" ]; then - pack8s_path=$(mktemp -d /tmp/pack8sXXX) - params=" --volume $pack8s_path:/tmp ${params}" - fi - - ${_cli} run okd ${params} - - # Copy k8s config and kubectl - if [ "$KUBEVIRTCI_RUNTIME" = "podman" ]; then - cluster_container_id=$(pack8s -p "$provider_prefix-cluster" show -i) - else - cluster_container_id=$(docker ps -f "name=$provider_prefix-cluster" --format "{{.ID}}") - fi - - _install_from_cluster $cluster_container_id /usr/local/bin/oc 0755 .kubectl $pack8s_path - _install_from_cluster $cluster_container_id /root/install/auth/kubeconfig 0644 .kubeconfig $pack8s_path - - # Set server and disable tls check - export KUBECONFIG=${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubeconfig - ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl config set-cluster test-1 --server=https://$(_main_ip):$(_port k8s) - ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl config set-cluster test-1 --insecure-skip-tls-verify=true - - # Make sure that local config is correct - prepare_config - - ln_kubeconfig -} diff --git a/cluster-up/container.sh b/cluster-up/container.sh deleted file mode 100755 index 207e2ee60c..0000000000 --- a/cluster-up/container.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [ -z "$KUBEVIRTCI_PATH" ]; then - KUBEVIRTCI_PATH="$( - cd "$(dirname "$BASH_SOURCE[0]")/" - echo "$(pwd)/" - )" -fi - -source ${KUBEVIRTCI_PATH}/hack/common.sh - -if [[ $KUBEVIRT_PROVIDER =~ (ocp|okd).* ]]; then - - # If it's terminal make it interactive - test -t 1 && USE_TTY="-it" - - docker exec $USE_TTY ${provider_prefix}-cluster $@ -else - echo "connect is supported only for ocp / okd, (or KUBEVIRT_PROVIDER isnt exported ?)" -fi diff --git a/cluster-up/ssh.sh b/cluster-up/ssh.sh index 36cf143598..68276fdd53 100755 --- a/cluster-up/ssh.sh +++ b/cluster-up/ssh.sh @@ -19,26 +19,11 @@ node=$1 if [ -z "$node" ]; then echo "node name required as argument" - echo "okd/ocp example: ./ssh master-0" echo "k8s example: ./ssh node01" exit 1 fi -if [[ $KUBEVIRT_PROVIDER =~ (ocp|okd).* ]]; then - - # Get the exact virsh domain name - domain=$($KUBEVIRTCI_PATH/container.sh virsh list |grep $node |awk '{print $2}') - - # Get the virsh address for the node - ip=$($KUBEVIRTCI_PATH/container.sh virsh domifaddr $domain |grep vnet |head -n 1 | awk '{print $4}' | sed "s/\/.*//g") - - # Ignore the node argument - shift - - # Run the passed arguments into the oc node - $KUBEVIRTCI_PATH/container.sh ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -q -lcore core@$ip -i /vagrant.key $@ - -elif [[ $KUBEVIRT_PROVIDER =~ kind.* ]]; then +if [[ $KUBEVIRT_PROVIDER =~ kind.* ]]; then _ssh_into_node "$@" else ${_cli} --prefix $provider_prefix ssh "$@"