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
e2e: defend on k8s version for snap-controller install #1534
Conversation
I have come across this reference but again this doesn't have any mapping for the latest releases > v2.1.0 |
Went through each release notes at https://github.com/kubernetes-csi/external-snapshotter/tags If I understand it right, for our ceph-csi we need atleast k8s >= v1.14.0, So the map should be:
Does it look good? |
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.
Looks mostly good to me. Note that with the Partially Fixes: #...
comment, the issue will be closed because GitHub detects Fixes: #...
we don't need to support snapshots if the kubernetes version is <1.17 as snapshotter beta is not backward compatible with alpha version |
scripts/install-snapshot.sh
Outdated
|
||
KUBE_VERSION=$(kubectl version --short 2>/dev/null | grep "^Server Version" | cut -d' ' -f3) | ||
if [[ -z ${KUBE_VERSION} ]]; then | ||
echo "could not get kube server version" |
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.
could not get Kubernetes server version
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.
sure
Yep, I'm aware of this, my intention was to fix the other part of the issue as part of this PR. @nixpanic @Madhu-1 @humblec can I have at least one ack on the table of mapping at #1534 (comment) Logically:
We also need to fix in the current patch, like we need to skip the snapshot controller install if k8s version < 1.14.0, rather than 1.17.0 Does this all sound good? Thanks! |
already added here #1534 (comment) |
Thanks Madhu, this means the current patch is good enough to fix #1139 @Madhu-1 we got a new release out for External snapshotter v3.0.0 a couple of weeks ago. |
Yes, @agarwal-mudit is already working on updating sidecar containers. and also can you please update the version from v2.1.1 to 3.0.0 here ceph-csi/scripts/install-snapshot.sh Line 5 in d7802eb
|
/test ci/centos/mini-e2e |
/test ci/centos/mini-e2e/k8s-1.18 |
/test ci/centos/mini-e2e/k8s-1.19 |
/test ci/centos/mini-e2e/k8s-1.18 |
/test ci/centos/mini-e2e-helm/k8s-1.19 |
CI fails with:
Maybe we need to wait until Mudit patches land and rebase this on top of them. |
Will try to raise a PR by tomorrow. |
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.
The failed tests complain that the v3.0.0 VolumeSnapshotClass CRD can not be found:
error: unable to read URL "https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/v3.0.0/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml", server reported 404 Not Found, status code=404
Please check where the CRD needs to come from with newer versions.
Indeed, as dicussed in the above comments, this should be rebased on Mudit's changes, once the changes are merged. 👍 |
On a second look, is this path hard coded in the script because the crd path is changed in v3.0.0. |
@pkalever Mudit PR won't fix this one I think. we can go and make the below changes, please double-check once again
|
@Madhu-1 you are right, starting from external snapshotter v2.0 they are at external-snapshotter/config/crd/, at v3.0 they moved to external-snapshotter/config/crd/client/. Also came across kubernetes-csi/external-snapshotter#365 :-) Based on Neils's comments, I'm inclined to move the SNAPSHOT_VERSION variable to build.env. Do we need to still support v2.1.1? Meaning do we need to defend on the versions and select the appropriate link/path in this script? I'm not sure if we have a strong reason to support <3.0 anymore. Thanks! |
/test all |
@Madhu-1 ready for merge? |
scripts/install-snapshot.sh
Outdated
echo "${KUBE_VERSION}" | sed 's/^v//' | cut -d'.' -f"${1}" | ||
} | ||
|
||
KUBE_VERSION=$(kubectl version --short 2>/dev/null | grep "^Server Version" | cut -d' ' -f3) |
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.
Redirecting stderr to /dev/null might make debugging more difficult in case an error occurs. Is there a good reason to not display potential errors here?
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.
Because we do not want the next line (condition) to return false in case of error.
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.
But the output of stderr is not captured in KUBE_VERSION
if you do not use 2>&1
or a similar redirection?
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.
fixed now. Thanks Neils.
7acca64
to
bc5f8a8
Compare
/test all |
Currently the scripts/install-snapshot.sh script needs to be called depending on the Kubernetes version. It would be much easier to use the script if it is intelligent enough to decide itself whether k8s snapshot controller needs to be installed or not. Fixes: ceph#1139 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
For external-snapshotter v3.0.1, Supported CSI Spec Versions: 1.0.0, 1.1.0, 1.2.0 Minimum Kubernetes version: 1.17 Recommended Kubernetes version: 1.17 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
bc5f8a8
to
3cb094d
Compare
Describe what this PR does
Currently the scripts/install-snapshot.sh script needs to be called
depending on the Kubernetes version. It would be much easier to use the
script if it is intelligent enough to decide itself whether k8s snapshot
controller needs to be installed or not.
Fixes: #1139
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>