diff --git a/tools/deployment/sonobuoy/01-install_sonobuoy.sh b/tools/deployment/sonobuoy/01-install_sonobuoy.sh index 1e780e118..97a6b2d7e 100755 --- a/tools/deployment/sonobuoy/01-install_sonobuoy.sh +++ b/tools/deployment/sonobuoy/01-install_sonobuoy.sh @@ -14,8 +14,10 @@ set -xe -: ${SONOBUOY_VERSION:="0.18.2"} +: ${SONOBUOY_VERSION:="0.51.0"} : ${KUBECONFIG:="$HOME/.airship/kubeconfig"} +: ${TARGET_CLUSTER_CONTEXT:="target-cluster"} + URL="https://github.com/vmware-tanzu/sonobuoy/releases/download/v${SONOBUOY_VERSION}/sonobuoy_${SONOBUOY_VERSION}_linux_amd64.tar.gz" rm -rf /tmp/sonobuoy mkdir /tmp/sonobuoy @@ -23,4 +25,4 @@ sudo -E curl -sSLo "/tmp/sonobuoy/sonobuoy_${SONOBUOY_VERSION}_linux_amd64.tar.g tar xvf /tmp/sonobuoy/sonobuoy_${SONOBUOY_VERSION}_linux_amd64.tar.gz -C /tmp/sonobuoy/ sudo install -m 755 -o root /tmp/sonobuoy/sonobuoy /usr/local/bin echo ${KUBECONFIG} -sonobuoy version --kubeconfig ${KUBECONFIG} +sonobuoy version --kubeconfig ${KUBECONFIG} --context ${TARGET_CLUSTER_CONTEXT} diff --git a/tools/deployment/sonobuoy/02-run_default.sh b/tools/deployment/sonobuoy/02-run_default.sh index 502a4f9c8..3892620f8 100755 --- a/tools/deployment/sonobuoy/02-run_default.sh +++ b/tools/deployment/sonobuoy/02-run_default.sh @@ -17,7 +17,6 @@ set -xe # Available Modes: quick, certified-conformance, non-disruptive-conformance. # (default quick) : ${CONFORMANCE_MODE:="quick"} -: ${KUBE_CONFORMANCE_IMAGE_VERSION:="v1.18.6"} : ${TIMEOUT:=10800} : ${TARGET_CLUSTER_CONTEXT:="target-cluster"} @@ -27,7 +26,6 @@ cd /tmp/sonobuoy_snapshots/e2e # Run aggregator, and default plugins e2e and systemd-logs sonobuoy run --plugin e2e --plugin systemd-logs -m ${CONFORMANCE_MODE} \ --context "$TARGET_CLUSTER_CONTEXT" \ ---kube-conformance-image gcr.io/google-containers/conformance:${KUBE_CONFORMANCE_IMAGE_VERSION} \ --kubeconfig ${KUBECONFIG} \ --wait --timeout ${TIMEOUT} \ --log_dir /tmp/sonobuoy_snapshots/e2e @@ -39,7 +37,7 @@ kubectl get all -n sonobuoy --kubeconfig ${KUBECONFIG} --context "$TARGET_CLUSTE sonobuoy status --kubeconfig ${KUBECONFIG} --context "$TARGET_CLUSTER_CONTEXT" # Get logs -sonobuoy logs +sonobuoy logs --kubeconfig ${KUBECONFIG} --context "$TARGET_CLUSTER_CONTEXT" # Store Results results=$(sonobuoy retrieve --kubeconfig ${KUBECONFIG} --context $TARGET_CLUSTER_CONTEXT) diff --git a/tools/deployment/sonobuoy/03-kubebench.sh b/tools/deployment/sonobuoy/03-kubebench.sh index df6399923..6c2aaa049 100755 --- a/tools/deployment/sonobuoy/03-kubebench.sh +++ b/tools/deployment/sonobuoy/03-kubebench.sh @@ -17,8 +17,6 @@ set -xe : ${KUBEBENCH_MASTER_PLUGIN:="https://raw.githubusercontent.com/vmware-tanzu/sonobuoy-plugins/master/cis-benchmarks/kube-bench-master-plugin.yaml"} : ${KUBEBENCH_WORKER_PLUGIN:="https://raw.githubusercontent.com/vmware-tanzu/sonobuoy-plugins/master/cis-benchmarks/kube-bench-plugin.yaml"} : ${TARGET_CLUSTER_CONTEXT:="target-cluster"} -# This shouldnot include minor version -: ${KUBEBENCH_K8S_VERSION:=1.18} : ${TIMEOUT:=300} mkdir -p /tmp/sonobuoy_snapshots/kubebench @@ -30,8 +28,6 @@ sonobuoy run \ --context ${TARGET_CLUSTER_CONTEXT} \ --plugin ${KUBEBENCH_MASTER_PLUGIN} \ --plugin ${KUBEBENCH_WORKER_PLUGIN} \ ---plugin-env kube-bench-master.KUBERNETES_VERSION=${KUBEBENCH_K8S_VERSION} \ ---plugin-env kube-bench-master.KUBERNETES_VERSION=${KUBEBENCH_K8S_VERSION} \ --wait --timeout ${TIMEOUT} \ --log_dir /tmp/sonobuoy_snapshots/kubebench @@ -42,7 +38,7 @@ kubectl get all -n sonobuoy --kubeconfig ${KUBECONFIG} --context ${TARGET_CLUSTE sonobuoy status --kubeconfig ${KUBECONFIG} --context ${TARGET_CLUSTER_CONTEXT} # Get logs -sonobuoy logs +sonobuoy logs --kubeconfig ${KUBECONFIG} --context ${TARGET_CLUSTER_CONTEXT} # Store Results results=$(sonobuoy retrieve --kubeconfig ${KUBECONFIG} --context ${TARGET_CLUSTER_CONTEXT}) diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 20d3e62ce..71f62c449 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -241,8 +241,8 @@ site_name: docker-test-site gate_scripts: - *docker_gate_scripts - - KUBECONFIG=/tmp/target-cluster.kubeconfig TARGET_CLUSTER_CONTEXT=target-cluster ./tools/deployment/sonobuoy/01-install_sonobuoy.sh - - KUBECONFIG=/tmp/target-cluster.kubeconfig TARGET_CLUSTER_CONTEXT=target-cluster ./tools/deployment/sonobuoy/03-kubebench.sh + - ./tools/deployment/sonobuoy/01-install_sonobuoy.sh + - ./tools/deployment/sonobuoy/03-kubebench.sh voting: false - job: name: airship-airshipctl-docker-cncf-conformance @@ -269,8 +269,8 @@ site_name: docker-test-site gate_scripts: - *docker_gate_scripts - - KUBECONFIG=/tmp/target-cluster.kubeconfig TARGET_CLUSTER_CONTEXT=target-cluster ./tools/deployment/sonobuoy/01-install_sonobuoy.sh - - KUBECONFIG=/tmp/target-cluster.kubeconfig TARGET_CLUSTER_CONTEXT=target-cluster CONFORMANCE_MODE=certified-conformance ./tools/deployment/sonobuoy/02-run_default.sh + - ./tools/deployment/sonobuoy/01-install_sonobuoy.sh + - CONFORMANCE_MODE=certified-conformance ./tools/deployment/sonobuoy/02-run_default.sh voting: false - job: name: airship-airshipctl-publish-image