Skip to content

Conversation

@raaizik
Copy link
Member

@raaizik raaizik commented Nov 7, 2025

Move kubeadm image pulling to a separate provision step before kubeadm init. This improves probing performance by pre-pulling images upfront, reducing cluster startup time by approximately 100 seconds.

The new step:

  • Pre-pulls all required kubeadm images using kubeadm config images pull
  • Respects LOCAL_REGISTRY parameter for local registry usage
  • Includes safety checks to skip if cluster already initialized

This change follows the upstream Lima improvement in lima-vm/lima#3082 which improves probing when pulling kubeadm images during cluster startup.

TODO

  • Test

Resolves #1764

drenv: Adds separate k8s image pull step to improve probing

Move kubeadm image pulling to a separate provision step before
kubeadm init. This improves probing performance by pre-pulling
images upfront, reducing cluster startup time by approximately
100 seconds.

The new step:
- Pre-pulls all required kubeadm images using kubeadm config images pull
- Respects LOCAL_REGISTRY parameter for local registry usage
- Includes safety checks to skip if cluster already initialized

This change follows the upstream Lima improvement in lima-vm/lima#3082
which improves probing when pulling kubeadm images during cluster
startup.

Resolves RamenDR#1764

Signed-off-by: raaizik <132667934+raaizik@users.noreply.github.com>
Copy link
Member

@nirs nirs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can make sense if pulling the images before kubeadm init can speed up the operation. Please measure and report if this makes an interesting difference.

apiVersion: kubeadm.k8s.io/v1beta3
imageRepository: "$IMAGE_REPOSITORY"
EOF
kubeadm config images pull --config kubeadm-images-config.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using --config for pulling the image from the local registry is nice, but how does it improve probing?

The upstream change added a separate probing script to show progress when the images are pulled, since pulling the images can take lot of time with slow network. Probing does not help us since we don't show the probing logs in drenv. So this change does help with drenv.

When using local registry the images are pulled in 10 seconds with the current code. This change makes sense only if it improves the time in a significant way.

When using remote registry the time can be much longer. Does this change improve the pull time?

script: |
#!/bin/bash
set -eux -o pipefail
test -e /etc/kubernetes/admin.conf && exit 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config is not created by this step - so this step may run multiple times for no reason. When we include a guard command like this it must check something that this provision script creates. The upstream change does not pull the images in a separate provision script so it does not have this issue.

#!/bin/bash
set -eux -o pipefail
test -e /etc/kubernetes/admin.conf && exit 0
command -v kubeadm >/dev/null 2>&1 || exit 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong - since we pull the images with kubeadm, and this exit if kubeadm exist, we will never pull the images in this step, and they are always pulled during kubeadm init.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

drenv macOS: Add k8s.yaml changes from lima

2 participants