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

Detect /etc/containerd/certs.d automatically for mirror registry config. #3574

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions images/base/files/etc/containerd/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,9 @@ version = 2
tolerate_missing_hugepages_controller = true
# restrict_oom_score_adj needs to be true when running inside UserNS (rootless)
restrict_oom_score_adj = false

# For now it is not the default, but eventually it will. This config is added
# automatically at run time if the folder /etc/containerd/certs.d is detected in
# the node image.
#[plugins."io.containerd.grpc.v1.cri".registry]
# config_path = "/etc/containerd/certs.d"
6 changes: 6 additions & 0 deletions images/base/files/usr/local/bin/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ configure_containerd() {
systemctl enable containerd-fuse-overlayfs
fi
fi

if [[ -e "/etc/containerd/certs.d" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

This is still technically a breaking change because the user could've been using this directory with the old config approach.

I'm not sure this is better than just announcing that we've changed the config and we've already encouraged users customizing the config to switch and updated our registry sample script to switch.

cat >> /etc/containerd/config.toml <<EOF
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = "/etc/containerd/certs.d"
EOF
}

configure_proxy() {
Expand Down
4 changes: 3 additions & 1 deletion site/static/examples/kind-with-registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ fi

# 2. Create kind cluster with containerd registry config dir enabled
# TODO: kind will eventually enable this by default and this patch will
# be unnecessary.
# be unnecessary. Current versions don't need to be patched if the node
# image comes with a /etc/containerd/certs.d directory, or if this folder
# is created at runtime via bind mounts.
#
# See:
# https://github.com/kubernetes-sigs/kind/issues/2875
Expand Down