-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add check-cluster-up script for KinD providers #645
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"Description": "DEFAULT", | ||
"UUID": "c3bc7d76-6ce8-4c8a-8bcb-5c7ae5fb22a3", | ||
"Version": "v0.50.0", | ||
"ResultsDir": "/tmp/sonobuoy", | ||
"Resources": [ | ||
"apiservices", | ||
"certificatesigningrequests", | ||
"clusterrolebindings", | ||
"clusterroles", | ||
"componentstatuses", | ||
"configmaps", | ||
"controllerrevisions", | ||
"cronjobs", | ||
"customresourcedefinitions", | ||
"daemonsets", | ||
"deployments", | ||
"endpoints", | ||
"ingresses", | ||
"jobs", | ||
"leases", | ||
"limitranges", | ||
"mutatingwebhookconfigurations", | ||
"namespaces", | ||
"networkpolicies", | ||
"nodes", | ||
"persistentvolumeclaims", | ||
"persistentvolumes", | ||
"poddisruptionbudgets", | ||
"pods", | ||
"podlogs", | ||
"podsecuritypolicies", | ||
"podtemplates", | ||
"priorityclasses", | ||
"replicasets", | ||
"replicationcontrollers", | ||
"resourcequotas", | ||
"rolebindings", | ||
"roles", | ||
"servergroups", | ||
"serverversion", | ||
"serviceaccounts", | ||
"services", | ||
"statefulsets", | ||
"storageclasses", | ||
"validatingwebhookconfigurations", | ||
"volumeattachments" | ||
], | ||
"Filters": { | ||
"Namespaces": ".*", | ||
"LabelSelector": "" | ||
}, | ||
"Limits": { | ||
"PodLogs": { | ||
"Namespaces": "", | ||
"SonobuoyNamespace": true, | ||
"FieldSelectors": [], | ||
"LabelSelector": "", | ||
"Previous": false, | ||
"SinceSeconds": null, | ||
"SinceTime": null, | ||
"Timestamps": false, | ||
"TailLines": null, | ||
"LimitBytes": null, | ||
"LimitSize": "", | ||
"LimitTime": "" | ||
} | ||
}, | ||
"QPS": 30, | ||
"Burst": 50, | ||
"Server": { | ||
"bindaddress": "0.0.0.0", | ||
"bindport": 8080, | ||
"advertiseaddress": "", | ||
"timeoutseconds": 10800 | ||
}, | ||
"Plugins": null, | ||
"PluginSearchPath": [ | ||
"./plugins.d", | ||
"/etc/sonobuoy/plugins.d", | ||
"~/sonobuoy/plugins.d" | ||
], | ||
"Namespace": "sonobuoy", | ||
"WorkerImage": "projects.registry.vmware.com/sonobuoy/sonobuoy:v0.50.0", | ||
"ImagePullPolicy": "IfNotPresent", | ||
"ImagePullSecrets": "", | ||
"ProgressUpdatesPort": "8099" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/bash | ||
# | ||
# This file is part of the KubeVirt project | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Copyright 2021 Red Hat, Inc. | ||
|
||
set -exuo pipefail | ||
|
||
SCRIPT_PATH=$(dirname "$(realpath "$0")") | ||
|
||
kubevirtci_path="$(realpath "${SCRIPT_PATH}/../../..")/" | ||
PROVIDER_PATH="${kubevirtci_path}/cluster-up/cluster/${KUBEVIRT_PROVIDER}" | ||
|
||
RUN_KUBEVIRT_CONFORMANCE=${RUN_KUBEVIRT_CONFORMANCE:-"false"} | ||
|
||
( | ||
cd $kubevirtci_path | ||
kubectl="./cluster-up/kubectl.sh" | ||
echo "Wait for pods to be ready.." | ||
timeout 5m bash -c "until ${kubectl} wait --for=condition=Ready pod --timeout=30s --all -A; do sleep 1; done" | ||
timeout 5m bash -c "until ${kubectl} wait --for=condition=Ready pod --timeout=30s -n kube-system --all; do sleep 1; done" | ||
${kubectl} get nodes | ||
${kubectl} get pods -A | ||
echo "" | ||
|
||
nodes=$(${kubectl} get nodes --no-headers | awk '{print $1}') | ||
for node in $nodes; do | ||
node_exec="docker exec ${node}" | ||
echo "[$node] network interfaces status:" | ||
${node_exec} ip a | ||
echo "" | ||
echo "[$node] route table:" | ||
${node_exec} ip r | ||
echo "" | ||
echo "[$node] hosts file:" | ||
${node_exec} cat /etc/hosts | ||
echo "" | ||
echo "[$node] resolve config:" | ||
${node_exec} cat /etc/resolv.conf | ||
echo "" | ||
done | ||
|
||
if [ "$RUN_KUBEVIRT_CONFORMANCE" == "true" ]; then | ||
nightly_build_base_url="https://storage.googleapis.com/kubevirt-prow/devel/nightly/release/kubevirt/kubevirt" | ||
latest=$(curl -sL "${nightly_build_base_url}/latest") | ||
|
||
echo "Deploy latest nighly build Kubevirt" | ||
if [ "$(kubectl get kubevirts -n kubevirt kubevirt -ojsonpath='{.status.phase}')" != "Deployed" ]; then | ||
${kubectl} apply -f "${nightly_build_base_url}/${latest}/kubevirt-operator.yaml" | ||
${kubectl} apply -f "${nightly_build_base_url}/${latest}/kubevirt-cr.yaml" | ||
fi | ||
${kubectl} wait -n kubevirt kv kubevirt --for condition=Available --timeout 15m | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe should be part of the if, else it means that the kubevirt is deployed but here you are checking that its also Available, again up to you There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check is not part of the if in order to prevent running tests in case not all kubevirt components are ready. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe 15 minutes is too much ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on hack/cluster-deploy.sh it check every 5 minutes for 25 minutes |
||
|
||
echo "Run latest nighly build Kubevirt conformance tests" | ||
kubevirt_plugin="--plugin ${nightly_build_base_url}/${latest}/conformance.yaml" | ||
SONOBUOY_EXTRA_ARGS="${SONOBUOY_EXTRA_ARGS} ${kubevirt_plugin}" | ||
|
||
commit=$(curl -sL "${nightly_build_base_url}/${latest}/commit") | ||
commit="${commit:0:9}" | ||
container_tag="--plugin-env kubevirt-conformance.CONTAINER_TAG=${latest}_${commit}" | ||
SONOBUOY_EXTRA_ARGS="${SONOBUOY_EXTRA_ARGS} ${container_tag}" | ||
|
||
hack/conformance.sh ${PROVIDER_PATH}/conformance.json | ||
fi | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some thing nice is to create an array of command strings and then iterate on it , executing it,
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree its nicer, I didnt do it because I wanted to keep the log messages before each command.
Putting it in bash equivalent for map doesn't make things prettier in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can still keep log messages or whatever you desire in the loop isnt it ?
something like this wouldn't be nicer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will print the command we executes and not its descriptions, for example
for
ip a
command, it will print:[sriov-worker] ip r
instead of:
[sriov-worker] network interfaces status:
It makes the log easier to follow, cosmetics.