forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provider for k8s 1.15.1 (kubevirt#127)
* Add 1.15.1 provider * Fix nodes startup script * Remove outdated comments * Add shasum
- Loading branch information
Showing
6 changed files
with
165 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
export version=1.15.1 | ||
../provision.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,8 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
export version=1.15.1 | ||
../publish.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
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,45 @@ | ||
# Kubernetes 1.15.1 in ephemeral containers | ||
|
||
Provides a pre-deployed Kubernetes with version 1.15.1 purely in docker | ||
containers with qemu. The provided VMs are completely ephemeral and are | ||
recreated on every cluster restart. The KubeVirt containers are built on the | ||
local machine and are the pushed to a registry which is exposed at | ||
`localhost:5000`. | ||
|
||
## Bringing the cluster up | ||
|
||
```bash | ||
export KUBEVIRT_PROVIDER=k8s-1.15.1 | ||
export KUBEVIRT_NUM_NODES=2 # master + one node | ||
make cluster-up | ||
``` | ||
|
||
The cluster can be accessed as usual: | ||
|
||
```bash | ||
$ cluster/kubectl.sh get nodes | ||
NAME STATUS ROLES AGE VERSION | ||
node01 NotReady master 31s v1.15.1 | ||
node02 NotReady <none> 5s v1.15.1 | ||
``` | ||
|
||
## Bringing the cluster down | ||
|
||
```bash | ||
export KUBEVIRT_PROVIDER=k8s-1.15.1 | ||
make cluster-down | ||
``` | ||
|
||
This destroys the whole cluster. Recreating the cluster is fast, since k8s 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 | ||
``` |
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,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
image="k8s-1.15.1@sha256:14d7b1806f24e527167d2913deafd910ea46e69b830bf0b094dde35ba961b159" | ||
|
||
source ${KUBEVIRTCI_PATH}/cluster/ephemeral-provider-common.sh | ||
|
||
function up() { | ||
${_cli} run $(_add_common_params) | ||
|
||
# Copy k8s config and kubectl | ||
${_cli} scp --prefix $provider_prefix /usr/bin/kubectl - >${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl | ||
chmod u+x ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl | ||
${_cli} scp --prefix $provider_prefix /etc/kubernetes/admin.conf - >${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubeconfig | ||
|
||
# Set server and disable tls check | ||
export KUBECONFIG=${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubeconfig | ||
${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl config set-cluster kubernetes --server=https://$(_main_ip):$(_port k8s) | ||
${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl config set-cluster kubernetes --insecure-skip-tls-verify=true | ||
|
||
# Make sure that local config is correct | ||
prepare_config | ||
} |