Skip to content
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

release tools update #36

Merged
merged 31 commits into from
Dec 23, 2019
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f1697d2
Do full git clones in travis. Shallow clones are causing test-subtree
msau42 Oct 8, 2019
adf00fe
Merge pull request #36 from msau42/full-clone
k8s-ci-robot Oct 8, 2019
e0fde8c
Add new variables for 1.16 and remove 1.13
msau42 Oct 31, 2019
f419d74
Merge pull request #40 from msau42/add-1.16
k8s-ci-robot Oct 31, 2019
5e773d2
update CI to use Go 1.13.3
pohly Oct 31, 2019
c8a1c4a
better handling of Go version
pohly Oct 31, 2019
a53bd4c
Merge pull request #41 from pohly/go-version
k8s-ci-robot Oct 31, 2019
23df4ae
prow.sh: use vendor directory if available
pohly Nov 4, 2019
8067845
travis.yml: also use vendor directory
pohly Nov 4, 2019
ee22a9c
Merge pull request #42 from pohly/use-vendor-dir
k8s-ci-robot Nov 4, 2019
f41c135
prow.sh: also log output of system containers
pohly Nov 5, 2019
4fcafec
Merge pull request #43 from pohly/system-pod-logging
k8s-ci-robot Nov 6, 2019
83a4ef1
Adding build for ppc64le
Pensu Nov 19, 2019
1eaaaa1
Delete kind cluster after tests run.
mucahitkurt Nov 16, 2019
a41f386
Merge pull request #46 from mucahitkurt/kind-cluster-cleanup
k8s-ci-robot Nov 21, 2019
003c14b
Add snapshotter CRDs after cluster setup
ggriffiths Nov 12, 2019
8adde49
Merge pull request #45 from ggriffiths/snapshot_beta_crds
k8s-ci-robot Nov 25, 2019
6d674a7
Merge pull request #47 from Pensu/multi-arch
k8s-ci-robot Nov 26, 2019
80bba1f
Use kind v0.6.0
darkowlzz Nov 29, 2019
4ff2f5f
Merge pull request #50 from darkowlzz/kind-0.6.0
k8s-ci-robot Dec 2, 2019
9a7a685
Create a kind cluster with two worker nodes so that the topology feat…
msau42 Dec 3, 2019
53888ae
Improve README by adding an explicit Kubernetes dependency section
msau42 Dec 4, 2019
4ad6949
Improve snapshot pod running checks and improve version_gt
ggriffiths Dec 4, 2019
d7c69d2
Merge pull request #51 from msau42/enable-multinode
k8s-ci-robot Dec 4, 2019
771ca6f
Merge pull request #49 from ggriffiths/prowsh_improve_version_gt
k8s-ci-robot Dec 4, 2019
a4e6299
fix syntax for ppc64le build
msau42 Dec 4, 2019
540599b
Merge pull request #53 from msau42/fix-make
k8s-ci-robot Dec 4, 2019
9ace020
Merge pull request #52 from msau42/update-readme
k8s-ci-robot Dec 6, 2019
b98b2ae
Enable snapshot tests in 1.17 to be run in non-alpha jobs.
msau42 Dec 17, 2019
9f1f3dd
Merge pull request #56 from msau42/enable-snapshots
k8s-ci-robot Dec 18, 2019
2e964b6
release-tools: merge commit '9f1f3dd84257356f090ea7ce991dbf467784586e'
pohly Dec 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add snapshotter CRDs after cluster setup
Signed-off-by: Grant Griffiths <grant@portworx.com>
  • Loading branch information
ggriffiths committed Nov 24, 2019
commit 003c14b2d4ae3b1463db5e5b3ff91f39b03f5ba8
80 changes: 80 additions & 0 deletions prow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ configvar CSI_PROW_E2E_ALPHA_GATES_1_16 'VolumeSnapshotDataSource=true' "alpha f
configvar CSI_PROW_E2E_ALPHA_GATES_LATEST 'VolumeSnapshotDataSource=true' "alpha feature gates for latest Kubernetes"
configvar CSI_PROW_E2E_ALPHA_GATES "$(get_versioned_variable CSI_PROW_E2E_ALPHA_GATES "${csi_prow_kubernetes_version_suffix}")" "alpha E2E feature gates"

# Which external-snapshotter tag to use for the snapshotter CRD and snapshot-controller deployment
configvar CSI_SNAPSHOTTER_VERSION 'v2.0.0-rc4' "external-snapshotter version tag"

# Some tests are known to be unusable in a KinD cluster. For example,
# stopping kubelet with "ssh <node IP> systemctl stop kubelet" simply
# doesn't work. Such tests should be written in a way that they verify
Expand Down Expand Up @@ -657,6 +660,59 @@ install_hostpath () {
fi
}

# Installs all nessesary snapshotter CRDs
install_snapshot_crds() {
# Wait until volumesnapshot CRDs are in place.
CRD_BASE_DIR="https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/${CSI_SNAPSHOTTER_VERSION}/config/crd"
kubectl apply -f "${CRD_BASE_DIR}/snapshot.storage.k8s.io_volumesnapshotclasses.yaml" --validate=false
kubectl apply -f "${CRD_BASE_DIR}/snapshot.storage.k8s.io_volumesnapshots.yaml" --validate=false
kubectl apply -f "${CRD_BASE_DIR}/snapshot.storage.k8s.io_volumesnapshotcontents.yaml" --validate=false
cnt=0
until kubectl get volumesnapshotclasses.snapshot.storage.k8s.io \
&& kubectl get volumesnapshots.snapshot.storage.k8s.io \
&& kubectl get volumesnapshotcontents.snapshot.storage.k8s.io; do
if [ $cnt -gt 30 ]; then
echo >&2 "ERROR: snapshot CRDs not ready after over 1 min"
exit 1
fi
echo "$(date +%H:%M:%S)" "waiting for snapshot CRDs, attempt #$cnt"
cnt=$((cnt + 1))
sleep 2
done
}

# Install snapshot controller and associated RBAC, retrying until the pod is running.
install_snapshot_controller() {
kubectl apply -f "https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/${CSI_SNAPSHOTTER_VERSION}/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml"
cnt=0
until kubectl get clusterrolebinding snapshot-controller-role; do
if [ $cnt -gt 30 ]; then
echo "Cluster role bindings:"
kubectl describe clusterrolebinding
echo >&2 "ERROR: snapshot controller RBAC not ready after over 5 min"
exit 1
fi
echo "$(date +%H:%M:%S)" "waiting for snapshot RBAC setup complete, attempt #$cnt"
cnt=$((cnt + 1))
sleep 10
done


kubectl apply -f "https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/${CSI_SNAPSHOTTER_VERSION}/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml"
cnt=0
until kubectl get statefulset snapshot-controller | grep snapshot-controller | grep "1/1"; do
if [ $cnt -gt 30 ]; then
echo "Running statefulsets:"
kubectl describe statefulsets
echo >&2 "ERROR: snapshot controller not ready after over 5 min"
exit 1
fi
echo "$(date +%H:%M:%S)" "waiting for snapshot controller deployment to complete, attempt #$cnt"
cnt=$((cnt + 1))
sleep 10
done
}

# collect logs and cluster status (like the version of all components, Kubernetes version, test version)
collect_cluster_info () {
cat <<EOF
Expand Down Expand Up @@ -927,6 +983,10 @@ make_test_to_junit () {
fi
}

function version_gt() {
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1";
}

main () {
local images ret
ret=0
Expand Down Expand Up @@ -987,6 +1047,16 @@ main () {
if tests_need_non_alpha_cluster; then
start_cluster || die "starting the non-alpha cluster failed"

# Install necessary snapshot CRDs and snapshot controller
# For Kubernetes 1.17+, we will install the CRDs and snapshot controller.
if version_gt "${CSI_PROW_KUBERNETES_VERSION}" "1.16.255" || "${CSI_PROW_KUBERNETES_VERSION}" == "latest"; then
info "Version ${CSI_PROW_KUBERNETES_VERSION}, installing CRDs and snapshot controller"
install_snapshot_crds
install_snapshot_controller
else
info "Version ${CSI_PROW_KUBERNETES_VERSION}, skipping CRDs and snapshot controller"
fi

# Installing the driver might be disabled.
if install_hostpath "$images"; then
collect_cluster_info
Expand Down Expand Up @@ -1023,6 +1093,16 @@ main () {
# Need to (re)create the cluster.
start_cluster "${CSI_PROW_E2E_ALPHA_GATES}" || die "starting alpha cluster failed"

# Install necessary snapshot CRDs and snapshot controller
# For Kubernetes 1.17+, we will install the CRDs and snapshot controller.
if version_gt "${CSI_PROW_KUBERNETES_VERSION}" "1.16.255" || "${CSI_PROW_KUBERNETES_VERSION}" == "latest"; then
info "Version ${CSI_PROW_KUBERNETES_VERSION}, installing CRDs and snapshot controller"
install_snapshot_crds
install_snapshot_controller
else
info "Version ${CSI_PROW_KUBERNETES_VERSION}, skipping CRDs and snapshot controller"
fi

# Installing the driver might be disabled.
if install_hostpath "$images"; then
collect_cluster_info
Expand Down