Skip to content

Commit

Permalink
fix: hack nerdctl --insecure-registry flag
Browse files Browse the repository at this point in the history
  • Loading branch information
tmurakam committed Feb 6, 2022
1 parent d2a66c7 commit f7f6d41
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,13 @@ Then execute `offline-repo.yml` playbook.

### Run kubespray

Run kubespray ansible playbook as usual.
Run kubespray ansible playbook.

For Kubespray 2.18, you need to override `image_pull_command` and `image_pull_command_on_localhost`
to allow insecure registry for nerdctl.

# Example
$ PULL_CMD="/usr/local/bin/nerdctl -n k8s.io pull --quiet --insecure-registry"
$ ansible-playbook -i inventory/mycluster/hosts.yaml --become --become-user=root \
-e "image_pull_command='$PULL_CMD'" -e "image_pull_command_on_localhost='$PULL_CMD'" \
cluster.yml
7 changes: 6 additions & 1 deletion test/kubespray.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ EOF
ansible-playbook -i inventory/mycluster/hosts.yaml --become --become-user=root offline-repo.yml || exit 1

echo "===> Execute kubespray"
ansible-playbook -i inventory/mycluster/hosts.yaml --become --become-user=root cluster.yml || exit 1
# Hack #8339
PULL_CMD="/usr/local/bin/nerdctl -n k8s.io pull --quiet --insecure-registry"
ansible-playbook -i inventory/mycluster/hosts.yaml --become --become-user=root \
-e "image_pull_command='$PULL_CMD'" -e "image_pull_command_on_localhost='$PULL_CMD'" \
cluster.yml \
|| exit 1
}

venv
Expand Down

0 comments on commit f7f6d41

Please sign in to comment.