Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nfs-subdir-external-provisioner
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rancher商店
nfs-subdir-external-provisioner
Commits
003c14b2
Commit
003c14b2
authored
Nov 11, 2019
by
Grant Griffiths
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add snapshotter CRDs after cluster setup
Signed-off-by:
Grant Griffiths
<
grant@portworx.com
>
parent
4fcafece
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
0 deletions
+80
-0
prow.sh
prow.sh
+80
-0
No files found.
prow.sh
View file @
003c14b2
...
@@ -322,6 +322,9 @@ configvar CSI_PROW_E2E_ALPHA_GATES_1_16 'VolumeSnapshotDataSource=true' "alpha f
...
@@ -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_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"
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,
# Some tests are known to be unusable in a KinD cluster. For example,
# stopping kubelet with "ssh <node IP> systemctl stop kubelet" simply
# stopping kubelet with "ssh <node IP> systemctl stop kubelet" simply
# doesn't work. Such tests should be written in a way that they verify
# doesn't work. Such tests should be written in a way that they verify
...
@@ -657,6 +660,59 @@ install_hostpath () {
...
@@ -657,6 +660,59 @@ install_hostpath () {
fi
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 logs and cluster status (like the version of all components, Kubernetes version, test version)
collect_cluster_info
()
{
collect_cluster_info
()
{
cat
<<
EOF
cat
<<
EOF
...
@@ -927,6 +983,10 @@ make_test_to_junit () {
...
@@ -927,6 +983,10 @@ make_test_to_junit () {
fi
fi
}
}
function
version_gt
()
{
test
"
$(
printf
'%s\n'
"
$@
"
|
sort
-V
|
head
-n
1
)
"
!=
"
$1
"
;
}
main
()
{
main
()
{
local
images ret
local
images ret
ret
=
0
ret
=
0
...
@@ -987,6 +1047,16 @@ main () {
...
@@ -987,6 +1047,16 @@ main () {
if
tests_need_non_alpha_cluster
;
then
if
tests_need_non_alpha_cluster
;
then
start_cluster
||
die
"starting the non-alpha cluster failed"
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.
# Installing the driver might be disabled.
if
install_hostpath
"
$images
"
;
then
if
install_hostpath
"
$images
"
;
then
collect_cluster_info
collect_cluster_info
...
@@ -1023,6 +1093,16 @@ main () {
...
@@ -1023,6 +1093,16 @@ main () {
# Need to (re)create the cluster.
# Need to (re)create the cluster.
start_cluster
"
${
CSI_PROW_E2E_ALPHA_GATES
}
"
||
die
"starting alpha cluster failed"
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.
# Installing the driver might be disabled.
if
install_hostpath
"
$images
"
;
then
if
install_hostpath
"
$images
"
;
then
collect_cluster_info
collect_cluster_info
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment