-
Notifications
You must be signed in to change notification settings - Fork 49
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
Update Kind to 1.29.1 #73
Conversation
@@ -44,4 +48,4 @@ KIND_K8S_DIR="${TMP_DIR}/kubernetes-${KIND_K8S_TAG}" | |||
git clone --depth 1 --branch ${KIND_K8S_TAG} ${KIND_K8S_REPO} ${KIND_K8S_DIR} | |||
|
|||
# Build the kind base image | |||
kind build node-image --base-image "${KIND_IMAGE_BASE}" --image "${KIND_IMAGE}" "${KIND_K8S_DIR}" | |||
kind build node-image ${KIND_IMAGE_BASE:+--base-image "${KIND_IMAGE_BASE}"} --image "${KIND_IMAGE}" "${KIND_K8S_DIR}"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.
What is the fi
at the end of this?
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.
Ah. Yes, I had this in a separate conditional block instead of quick returning above. Will update.
if [[ x"${KIND_IMAGE_BASE}" == x"" && x"${KIND_K8S_TAG}" == x"" ]]; then | ||
exit 0 | ||
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.
Ia tehre a reason to use the double [[
syntax and the x
before the strings here? Mostly because it is inconsistent with the rest of the bash scripts 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.
No, not really. I'm just used to the double syntax. Will update.
demo/clusters/kind/scripts/common.sh
Outdated
: ${KIND_IMAGE_BASE_TAG:="v20230515-01914134-containerd_v1.7.1"} | ||
: ${KIND_IMAGE_BASE:="gcr.io/k8s-staging-kind/base:${KIND_IMAGE_BASE_TAG}"} | ||
: ${KIND_IMAGE:="kindest/node:${KIND_K8S_TAG}-${KIND_IMAGE_BASE_TAG}"} | ||
${NVIDIA_DRIVER_ROOT:+--set nvidiaDriverRoot=${NVIDIA_DRIVER_ROOT}} |
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.
What does the :+
yntax do exactly? Where is this variable used later on and why wasn't it needed in v1.27.1?
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.
:+
only expands the section that follows it if the variable is defined.
For example:
$ export FOO=baz
$ echo "some/thing/possibly${FOO:+-${FOO}}"
some/thing/possibly-bar
$ unset FOO
$ echo "some/thing/possibly${FOO:+-${FOO}}"
some/thing/possibly
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.
Sorry, now I see the confusion. The NVIDIA_DRIVER_ROOT
is not required. I had pasted the syntax here as a reminder while working on the usage of :+
below but never removed it.
Removed now.
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 still seems to be there.
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.
Yes. I had forgotten to push.
54f368f
to
5ced581
Compare
@@ -29,6 +29,11 @@ if [ "${EXISTING_IMAGE_ID}" != "" ]; then | |||
exit 0 | |||
fi | |||
|
|||
PREBUILT_IMAGE="$( ( docker manifest inspect ${KIND_IMAGE} > /dev/null && echo "available" ) || ( echo "not-available" ) )" | |||
if [ "${PREBUILT_IMAGE}" = "available" ] && [ x"${KIND_IMAGE_BASE}" = x"" ]; then |
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.
nit: remove the 'x's in [ x"${KIND_IMAGE_BASE}" = x"" ]
.
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.
Should be updated now.
demo/clusters/kind/scripts/common.sh
Outdated
## KIND_IMAGE_BASE_TAG can be specified to build specific requirements into a kind image. | ||
## This should in general not be required. | ||
# : ${KIND_IMAGE_BASE_TAG:="v20230515-01914134-containerd_v1.7.1"} | ||
: ${KIND_IMAGE_BASE:="${KIND_IMAGE_BASE_TAG:+gcr.io/k8s-staging-kind/base:${KIND_IMAGE_BASE_TAG}}"} | ||
: ${KIND_IMAGE:="kindest/node:${KIND_K8S_TAG}${KIND_IMAGE_BASE_TAG:+-${KIND_IMAGE_BASE_TAG}}"} |
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.
This section is confusing to me. Why do we have KIND_IMAGE_BASE_TAG
but it is commented out. We then clearly set a KIND_IMAGE_BASE
(though I guess it equals "" since KIND_IMAGE_BASE_TAG
is commented out?). Then in KIND_IMAGE
we only conditionally include -${KIND_IMAGE_BASE_TAG}
if KIND_IMAGE_BASE_TAG
is set (which according to the logic above it never is).
The only thing I can figure is that this is designed to support someone setting KIND_IMAGE_BASE_TAG
on the command line, which I don't think we want to do.
Can we simplify this to remove all of this inline cnditional logic (maybe leaving a separate comment block to show what would be necessary if we ever need to support a KIND_IMAGE_BASE_TAG
in the future again).
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.
OK. I have cleaned this up a bit. We only specify the full kind image here and then the note on how to use a custom base image is included where we build the image.
I think it's less likely that we will need custom base images since we don't specifically need runtime features for this to work.
demo/clusters/kind/scripts/common.sh
Outdated
: ${KIND_IMAGE_BASE_TAG:="v20230515-01914134-containerd_v1.7.1"} | ||
: ${KIND_IMAGE_BASE:="gcr.io/k8s-staging-kind/base:${KIND_IMAGE_BASE_TAG}"} | ||
: ${KIND_IMAGE:="kindest/node:${KIND_K8S_TAG}-${KIND_IMAGE_BASE_TAG}"} | ||
${NVIDIA_DRIVER_ROOT:+--set nvidiaDriverRoot=${NVIDIA_DRIVER_ROOT}} |
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 still seems to be there.
c739617
to
716a822
Compare
Signed-off-by: Evan Lezar <[email protected]>
716a822
to
e7d9271
Compare
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.
Much clearer now thanks.
This change updates the Kind cluster definition to
v1.29.1
.This also removes the need to use a custom kind base image if the version is already available.