forked from kubevirt/kubevirt
-
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.
Bump to the simplified provider layout in kubevirtci
Signed-off-by: Roman Mohr <[email protected]>
- Loading branch information
Showing
52 changed files
with
2,328 additions
and
270 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 |
---|---|---|
@@ -1 +1 @@ | ||
dfa2be010812c39ce653331db5bd974ae347c652 | ||
a5060d40ae57089ca5a318c70f9c592912ecfb95 |
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
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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,49 @@ | ||
# K8S 1.17.0 in a Kind cluster, with IPv6 only | ||
|
||
Provides a pre-deployed k8s cluster with version 1.17.0 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`. | ||
|
||
cluster is brought up with ipv6 support but without flannel or multi nic support | ||
|
||
## Prerequisits | ||
1. kubectl >= 1.16 | ||
1. docker network with ipv6. | ||
To get that you'll have to add the following section to /etc/docker/daemon.json: | ||
``` | ||
{ | ||
"ipv6": true, | ||
"fixed-cidr-v6": "2001:db8:1::/64" | ||
} | ||
``` | ||
and to fully restart docker (systemctl restart docker) | ||
if needed, docker can be tested with: | ||
`docker run --rm busybox ip a` | ||
and make sure you get an ipv6 address | ||
## Bringing the cluster up | ||
```bash | ||
export KUBEVIRT_PROVIDER=kind-k8s-1.17.0-ipv6 | ||
export KUBEVIRT_NUM_NODES=2 # master + one node | ||
make cluster-up | ||
``` | ||
|
||
The cluster can be accessed as usual: | ||
|
||
```bash | ||
$ cluster-up/kubectl.sh get nodes | ||
NAME STATUS ROLES AGE VERSION | ||
kind-1.17.0-control-plane Ready master 105s v1.14.2 | ||
kind-1.17.0-worker Ready <none> 71s v1.14.2 | ||
``` | ||
|
||
## Bringing the cluster down | ||
|
||
```bash | ||
export KUBEVIRT_PROVIDER=kind-k8s-1.17.0 | ||
make cluster-down | ||
``` | ||
|
||
This destroys the whole cluster. | ||
|
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,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
export IPV6_CNI="yes" | ||
export CLUSTER_NAME="kind-1.17.0" | ||
export KIND_NODE_IMAGE="kindest/node:v1.17.0" | ||
|
||
source ${KUBEVIRTCI_PATH}/cluster/kind/common.sh | ||
|
||
function up() { | ||
cp $KIND_MANIFESTS_DIR/kind-ipv6.yaml ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml | ||
kind_up | ||
} |
60 changes: 60 additions & 0 deletions
60
cluster-up/cluster/kind-k8s-sriov-1.14.2/TROUBLESHOOTING.md
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,60 @@ | ||
# How to troubleshoot a failing kind job | ||
|
||
If logging and output artifacts are not enough, there is a way to connect to a running CI pod and troubleshoot directly from there. | ||
|
||
## Pre-requisites | ||
|
||
- A working (enabled) account on the [CI cluster](shift.ovirt.org), specifically enabled to the `kubevirt-prow-jobs` project. | ||
- The [mkpj tool](https://github.com/kubernetes/test-infra/tree/master/prow/cmd/mkpj) installed | ||
|
||
## Launching a custom job | ||
|
||
Through the `mkpj` tool, it's possible to craft a custom Prow Job that can be executed on the CI cluster. | ||
|
||
Just `go get` it by running `go get k8s.io/test-infra/prow/cmd/mkpj` | ||
|
||
Then run the following command from a checkout of the [project-infra repo](https://github.com/kubevirt/project-infra): | ||
|
||
```bash | ||
mkpj --pull-number $KUBEVIRTPRNUMBER -job pull-kubevirt-e2e-kind-k8s-sriov-1.14.2 -job-config-path github/ci/prow/files/jobs/kubevirt/kubevirt-presubmits.yaml --config-path github/ci/prow/files/config.yaml > debugkind.yaml | ||
``` | ||
|
||
You will end up having a ProwJob manifest in the `debugkind.yaml` file. | ||
|
||
It's strongly recommended to replace the job's name, as it will be easier to find and debug the relative pod, by replacing `metadata.name` with something more recognizeable. | ||
|
||
The $KUBEVIRTPRNUMBER can be an actual PR on the [kubevirt repo](https://github.com/kubevirt/kubevirt). | ||
|
||
In case we just want to debug the cluster provided by the CI, it's recommended to override the entry point, either in the test PR we are instrumenting (a good sample can be found [here](https://github.com/kubevirt/kubevirt/pull/3022)), or by overriding the entry point directly in the prow job's manifest. | ||
|
||
Remember that we want the cluster long living, so a long sleep must be provided as part of the entry point. | ||
|
||
Make sure you switch to the `kubevirt-prow-jobs` project, and apply the manifest: | ||
|
||
```bash | ||
kubectl apply -f debugkind.yaml | ||
``` | ||
|
||
You will end up with a ProwJob object, and a pod with the same name you gave to the ProwJob. | ||
|
||
Once the pod is up & running, connect to it via bash: | ||
|
||
```bash | ||
kubectl exec -it debugprowjobpod bash | ||
``` | ||
|
||
### Logistics | ||
|
||
Once you are in the pod, you'll be able to troubleshoot what's happening in the environment CI is running its tests. | ||
|
||
Run the follow to bring up a [kind](https://github.com/kubernetes-sigs/kind) cluster with a single node setup and the SR-IOV operator already setup to go (if it wasn't already done by the job itself). | ||
|
||
```bash | ||
KUBEVIRT_PROVIDER=kind-k8s-sriov-1.14.2 make cluster-up | ||
``` | ||
|
||
The kubeconfig file will be available under `/root/.kube/kind-config-sriov`. | ||
|
||
The `kubectl` binary is already on board and in `$PATH`. | ||
|
||
The container acting as node is the one named `sriov-control-plane`. You can even see what's in there by running `docker exec -it sriov-control-plane bash`. |
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,32 @@ | ||
# K8S 1.17.0 with sriov in a Kind cluster | ||
|
||
Provides a pre-deployed k8s cluster with version 1.17.0 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`. | ||
|
||
This version also expects to have sriov-enabed nics on the current host, and will move all the physical interfaces and virtual interfaces into the `kind`'s cluster master node so that they can be used through multus. | ||
|
||
## Bringing the cluster up | ||
|
||
```bash | ||
export KUBEVIRT_PROVIDER=kind-k8s-sriov-1.17.0 | ||
make cluster-up | ||
``` | ||
|
||
The cluster can be accessed as usual: | ||
|
||
```bash | ||
$ cluster-up/kubectl.sh get nodes | ||
NAME STATUS ROLES AGE VERSION | ||
sriov-control-plane Ready master 2m33s v1.17.0 | ||
``` | ||
|
||
## Bringing the cluster down | ||
|
||
```bash | ||
export KUBEVIRT_PROVIDER=kind-k8s-sriov-1.17.0 | ||
make cluster-down | ||
``` | ||
|
||
This destroys the whole cluster. | ||
|
60 changes: 60 additions & 0 deletions
60
cluster-up/cluster/kind-k8s-sriov-1.17.0/TROUBLESHOOTING.md
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,60 @@ | ||
# How to troubleshoot a failing kind job | ||
|
||
If logging and output artifacts are not enough, there is a way to connect to a running CI pod and troubleshoot directly from there. | ||
|
||
## Pre-requisites | ||
|
||
- A working (enabled) account on the [CI cluster](shift.ovirt.org), specifically enabled to the `kubevirt-prow-jobs` project. | ||
- The [mkpj tool](https://github.com/kubernetes/test-infra/tree/master/prow/cmd/mkpj) installed | ||
|
||
## Launching a custom job | ||
|
||
Through the `mkpj` tool, it's possible to craft a custom Prow Job that can be executed on the CI cluster. | ||
|
||
Just `go get` it by running `go get k8s.io/test-infra/prow/cmd/mkpj` | ||
|
||
Then run the following command from a checkout of the [project-infra repo](https://github.com/kubevirt/project-infra): | ||
|
||
```bash | ||
mkpj --pull-number $KUBEVIRTPRNUMBER -job pull-kubevirt-e2e-kind-k8s-sriov-1.14.2 -job-config-path github/ci/prow/files/jobs/kubevirt/kubevirt-presubmits.yaml --config-path github/ci/prow/files/config.yaml > debugkind.yaml | ||
``` | ||
|
||
You will end up having a ProwJob manifest in the `debugkind.yaml` file. | ||
|
||
It's strongly recommended to replace the job's name, as it will be easier to find and debug the relative pod, by replacing `metadata.name` with something more recognizeable. | ||
|
||
The $KUBEVIRTPRNUMBER can be an actual PR on the [kubevirt repo](https://github.com/kubevirt/kubevirt). | ||
|
||
In case we just want to debug the cluster provided by the CI, it's recommended to override the entry point, either in the test PR we are instrumenting (a good sample can be found [here](https://github.com/kubevirt/kubevirt/pull/3022)), or by overriding the entry point directly in the prow job's manifest. | ||
|
||
Remember that we want the cluster long living, so a long sleep must be provided as part of the entry point. | ||
|
||
Make sure you switch to the `kubevirt-prow-jobs` project, and apply the manifest: | ||
|
||
```bash | ||
kubectl apply -f debugkind.yaml | ||
``` | ||
|
||
You will end up with a ProwJob object, and a pod with the same name you gave to the ProwJob. | ||
|
||
Once the pod is up & running, connect to it via bash: | ||
|
||
```bash | ||
kubectl exec -it debugprowjobpod bash | ||
``` | ||
|
||
### Logistics | ||
|
||
Once you are in the pod, you'll be able to troubleshoot what's happening in the environment CI is running its tests. | ||
|
||
Run the follow to bring up a [kind](https://github.com/kubernetes-sigs/kind) cluster with a single node setup and the SR-IOV operator already setup to go (if it wasn't already done by the job itself). | ||
|
||
```bash | ||
KUBEVIRT_PROVIDER=kind-k8s-sriov-1.14.2 make cluster-up | ||
``` | ||
|
||
The kubeconfig file will be available under `/root/.kube/kind-config-sriov`. | ||
|
||
The `kubectl` binary is already on board and in `$PATH`. | ||
|
||
The container acting as node is the one named `sriov-control-plane`. You can even see what's in there by running `docker exec -it sriov-control-plane bash`. |
Oops, something went wrong.