Welcome to the Linux Foundation Forum!

Exercise 3.2: Configure A Local Repo - fix for containerd restart issue after reboot

Hello all,

Since containerd v2 was released several configuration options have changed. A most recent change is impacting the behavior of the containerd service after rebooting of the cp and worker nodes respectively. Until our course maintainer will merge these changes into the course and publish a new release, please use the solution below to fix the containerd behavior after the reboot.

After the completion of the local-repo-setup.sh script (step 4 on cp, step 9 on worker), perform the following config steps.

  1. Backup your current containerd config file:
sudo cp /etc/containerd/config.toml /etc/containerd/config.toml-backup
  1. Reset the containerd config file:
sudo containerd config default | sudo tee /etc/containerd/config.toml
sudo sed -e 's/SystemdCgroup = false/SystemdCgroup = true/g' -i /etc/containerd/config.toml
  1. Edit the new containerd config file. Use the LINE number references to locate existing entries. LINE 54 needs to be modified. LINEs 56 57 58 are new entries. Ensure proper indentation for the new entries. For reference LINE 38 is not indented, LINE 39 indented 2 spaces, LINE 53 indented 4 spaces, LINE 54 indented 6 spaces, LINE 56 indented 6 spaces, LINE 57 indented 8 spaces, LINE 58 indented 10 spaces.
sudo vim /etc/containerd/config.toml
<file content truncated>
...
[plugins]                                         # LINE 38
  [plugins.'io.containerd.cri.v1.images']         # LINE 39
    ...

    [plugins.'io.containerd.cri.v1.images'.registry]    # LINE 53
      config_path = ''                                  # LINE 54 - REMOVE VALUE OF CONFIG PATH

      [plugins.'io.containerd.cri.v1.images'.registry.mirrors]           # LINE 56 - ADD THIS LINE
        [plugins.'io.containerd.cri.v1.images'.registry.mirrors.'*']     # LINE 57 - ADD THIS LINE
          endpoint = ['http://10.97.40.62:5000']                         # LINE 58 - ADD THIS LINE

    [plugins.'io.containerd.cri.v1.images'.image_decryption]
      key_model = 'node'
...
  1. Reload daemon and restart containerd service:
sudo systemctl daemon-reload
sudo systemctl restart containerd

These steps need to be executed on both nodes. Start with the cp node, then complete them on the worker node. From here on, the upcoming steps from the lab guide should work, even after a new reboot.

Regards,
-Chris

Comments

  • jayantkrran
    jayantkrran Posts: 1
    edited January 24

    Hi Chris,

    Thanks for sharing the steps it works well. After every reboot I have to push the image to local repo again, I think it should be persistent.

    regards,
    Jayant

Categories

Upcoming Training