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

kubeadm images not being downloaded #11740

Closed
shaked-final opened this issue Nov 24, 2024 · 0 comments · Fixed by #11741
Closed

kubeadm images not being downloaded #11740

shaked-final opened this issue Nov 24, 2024 · 0 comments · Fixed by #11741
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@shaked-final
Copy link

What happened?

I run kubespray to be used as an offline deployment of clusters.
I noticed an issue that kubeadm images were not being downloaded as part of the cache.
closer inspection I noticed that the mapping of the images, created in 'roles/download/tasks/prep_kubeadm_images.yml', differ from the mapping under 'roles/kubespray-defaults/defaults/main/download.yml', specifically the 'groups' value is a type 'list' in the 'defaults' but 'string' in the 'prep_kubeadm'.
this causes the images of kubeadm to be skipped as part of the download to cache, branching with the fix below, fixes the issue

example from kube-spray-defaults:
netcheck_agent:
enabled: "{{ deploy_netchecker }}"
container: true
repo: "{{ netcheck_agent_image_repo }}"
tag: "{{ netcheck_agent_image_tag }}"
sha256: "{{ netcheck_agent_digest_checksum | default(None) }}"
groups:
- k8s_cluster

mapping in prep_kubeadm_images.yml:
kubeadm_image:
key: "kubeadm_{{ (item | regex_replace('^(?:.\/)', '')).split(':')[0] }}"
value:
enabled: true
container: true
repo: "{{ item | regex_replace('^(.):.$', '\1') }}"
tag: "{{ item | regex_replace('^.:(.)$', '\1') }}"
groups: k8s_cluster

What did you expect to happen?

all images including kubeadm images, which are generated separately to be downloaded

How can we reproduce it (as minimally and precisely as possible)?

Running with these parameters in verbose mode, will show the images are being listed but not downloaded:

OS

ubuntu 20

Version of Ansible

9.8.0

Version of Python

python3

Version of Kubespray (commit)

0b9872c

Network plugin used

calico

Full inventory with variables

image_command_tool_on_localhost: "docker"
container_manager_on_localhost: "docker"

helm_enabled: True
metrics_server_enabled: True
ingress_nginx_enabled: True
dashboard_enabled: True

kubeconfig_localhost: True
kubectl_localhost: True

download_force_cache: True
download_run_once: True
download_localhost: True

Command used to invoke ansible

python3 /usr/local/bin/ansible-playbook cluster.yml --inventory /kubespray/inventory/hosts.ini --become --become-user root --extra-vars 'download_cache_dir=/tmp/kubespray_cache' --extra-vars '@offline_install_vars.yml' -vvv

Output of ansible run

Anything else we need to know

No response

@shaked-final shaked-final added the kind/bug Categorizes issue or PR as related to a bug. label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant