2.2 CP Setup Script Error
Hi there and thanks for helping.
I'm using the following virtual machine setup on Mac M1 chip.
$ multipass info --all Name: cp State: Running IPv4: 192.168.64.6 172.17.0.1 Release: Ubuntu 20.04.6 LTS Image hash: 6de60c14be0f (Ubuntu 20.04 LTS) CPU(s): 2 Load: 0.24 0.16 0.10 Disk usage: 2.3GiB out of 20.3GiB Memory usage: 273.4MiB out of 7.8GiB Mounts: --
With this, I'm getting some errors on the LFD259/SOLUTIONS/s_02/k8scp.sh
script. I've been executing the script line by line and the first errors come up here.
# Install the containerd software $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - $ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" $ sudo apt-get update $ sudo apt-get install containerd.io -y Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package containerd.io E: Couldn't find any package by glob 'containerd.io' E: Couldn't find any package by regex 'containerd.io'
I got around this by running
$ sudo apt-get install containerd -y
but then...
ubuntu@cp:~$ sudo crictl config --set runtime-endpoint=unix:///run/containerd/containerd.sock --set image-endpoint=unix:///run/containerd/containerd.sock /usr/local/bin/crictl: 1: Syntax error: end of file unexpected (expecting ")") ubuntu@cp:~$ sudo kubeadm init --pod-network-cidr=192.168.0.0/16 | sudo tee /var/log/kubeinit.log [init] Using Kubernetes version: v1.27.3 [preflight] Running pre-flight checks error execution phase preflight: [preflight] Some fatal errors occurred: [ERROR CRI]: container runtime is not running: output: , error: executable file not found in $PATH [preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...` To see the stack trace of this error execute with --v=5 or higher
Can somebody please help me troubleshoot this?
Answers
-
Hi @johannespn,
I remember some strange behaviors reported a while back on environments provisioned with multipass. You may find some tips in those earlier posts.
One thing I'd recommend however, to not assign 192.168.x.y IP addresses to your VMs, because that very same private network will be used for the application pods network layer, and such overlaps will cause routing conflicts in your cluster.I just ran the installation steps, and it seems that the recommended
containerd.io
package from Docker repo installs just fine. It is the most up to date package, as opposed to thecontainerd
package downloaded from Ubuntu repo, that may be older. On M1 you may run into issues with some container images not supporting the chipset, so you'd need to find alternate images built specifically for the ARM architecture.Regards,
-Chris1 -
Hi and thanks a lot, I solved by running my cluster on AWS instead. The costs are quite cheap
0 -
Hi,
I was having the same issue with installation today. I've modified the script slightly so now it runs on arm64 architecture without any errors.
https://gist.github.com/kindejak/a16ee99e92e8e98c265f5256f6902f58#!/bin/bash # ############################################################### # NOTE: This script was slightly edited by Jakub Kindermann on 16/11/2023 to run the script on arm64-linux architecture ################# LFD459:1.25.1 s_02/k8scp.sh ################ # The code herein is: Copyright the Linux Foundation, 2022 # # This Copyright is retained for the purpose of protecting free # redistribution of source. # # URL: https://training.linuxfoundation.org # email: info@linuxfoundation.org # # This code is distributed under Version 2 of the GNU General Public # License, which you should have received with the source. #Version 1.26.1 # # This script is intended to be run on an Ubuntu 20.04, # 2cpu, 8G. # By Tim Serewicz, 05/2022 GPL # Note there is a lot of software downloaded, which may require # some troubleshooting if any of the sites updates their code, # which should be expected # Check to see if the script has been run before. Exit out if so. FILE=/k8scp_run if [ -f "$FILE" ]; then echo "WARNING!" echo "$FILE exists. Script has already been run on control plane." echo exit 1 else echo "$FILE does not exist. Running script" fi # Create a file when this script is started to keep it from running # twice on same node sudo touch /k8scp_run # Update the system sudo apt-get update ; sudo apt-get upgrade -y # Install necessary software sudo apt-get install curl apt-transport-https vim git wget gnupg2 software-properties-common apt-transport-https ca-certificates -y # Add repo for Kubernetes curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list # Install the Kubernetes software, and lock the version sudo apt-get update sudo apt-get -y install kubelet=1.28.1-00 kubeadm=1.28.1-00 kubectl=1.28.1-00 sudo apt-mark hold kubelet kubeadm kubectl # Ensure Kubelet is running sudo systemctl enable --now kubelet # Disable swap just in case sudo swapoff -a # Ensure Kernel has modules sudo modprobe overlay sudo modprobe br_netfilter # Update networking to allow traffic cat <<EOF | sudo tee /etc/sysctl.d/kubernetes.conf net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 net.ipv4.ip_forward = 1 EOF sudo sysctl --system # Configure containerd settings cat <<EOF | sudo tee /etc/modules-load.d/containerd.conf overlay br_netfilter EOF sudo sysctl --system export CLI_ARCH=amd64 # Ensure correct architecture if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi # Install the containerd software curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=${CLI_ARCH}] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get update sudo apt-get install containerd.io -y # Configure containerd and restart sudo mkdir -p /etc/containerd containerd config default | sudo tee /etc/containerd/config.toml sudo sed -e 's/SystemdCgroup = false/SystemdCgroup = true/g' -i /etc/containerd/config.toml sudo systemctl restart containerd sudo systemctl enable containerd # Create the config file so no more errors # Install and configure crictl export VER="v1.26.0" wget https://github.com/kubernetes-sigs/cri-tools/releases/download/$VER/crictl-$VER-linux-$CLI_ARCH.tar.gz tar zxvf crictl-$VER-linux-$CLI_ARCH.tar.gz sudo mv crictl /usr/local/bin # Set the endpoints to avoid the deprecation error sudo crictl config --set \ runtime-endpoint=unix:///run/containerd/containerd.sock \ --set image-endpoint=unix:///run/containerd/containerd.sock # Configure the cluster sudo kubeadm init --pod-network-cidr=192.168.0.0/16 | sudo tee /var/log/kubeinit.log # Configure the non-root user to use kubectl mkdir -p $HOME/.kube sudo cp -f /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config # Use Cilium as the network plugin # Install the CLI first export CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/master/stable.txt) curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} # Make sure download worked sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum # Move binary to correct location and remove tarball sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} # Now that binary is in place, install network plugin echo '********************************************************' echo '********************************************************' echo echo Installing Cilium, this may take a bit... echo echo '********************************************************' echo '********************************************************' echo cilium install echo sleep 3 echo Cilium install finished. Continuing with script. echo # Add Helm to make our life easier wget https://get.helm.sh/helm-v3.11.1-linux-${CLI_ARCH}.tar.gz tar -xf helm-v3.11.1-linux-amd64.tar.gz sudo cp linux-amd64/helm /usr/local/bin/ sleep 15 # Output the state of the cluster kubectl get node # Ready to continue sleep 3 echo echo echo '***************************' echo echo "Continue to the next step" echo echo '***************************' echo
0
Categories
- All Categories
- 167 LFX Mentorship
- 219 LFX Mentorship: Linux Kernel
- 795 Linux Foundation IT Professional Programs
- 355 Cloud Engineer IT Professional Program
- 179 Advanced Cloud Engineer IT Professional Program
- 82 DevOps Engineer IT Professional Program
- 127 Cloud Native Developer IT Professional Program
- 112 Express Training Courses
- 112 Express Courses - Discussion Forum
- 6.2K Training Courses
- 48 LFC110 Class Forum - Discontinued
- 17 LFC131 Class Forum
- 35 LFD102 Class Forum
- 227 LFD103 Class Forum
- 14 LFD110 Class Forum
- 39 LFD121 Class Forum
- 15 LFD133 Class Forum
- 7 LFD134 Class Forum
- 17 LFD137 Class Forum
- 63 LFD201 Class Forum
- 3 LFD210 Class Forum
- 5 LFD210-CN Class Forum
- 2 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum - Discontinued
- 1 LFD233 Class Forum
- 2 LFD237 Class Forum
- 23 LFD254 Class Forum
- 697 LFD259 Class Forum
- 109 LFD272 Class Forum
- 3 LFD272-JP クラス フォーラム
- 10 LFD273 Class Forum
- 152 LFS101 Class Forum
- 1 LFS111 Class Forum
- 1 LFS112 Class Forum
- 1 LFS116 Class Forum
- 1 LFS118 Class Forum
- LFS120 Class Forum
- 7 LFS142 Class Forum
- 7 LFS144 Class Forum
- 3 LFS145 Class Forum
- 1 LFS146 Class Forum
- 3 LFS147 Class Forum
- 1 LFS148 Class Forum
- 15 LFS151 Class Forum
- 1 LFS157 Class Forum
- 33 LFS158 Class Forum
- 8 LFS162 Class Forum
- 1 LFS166 Class Forum
- 1 LFS167 Class Forum
- 3 LFS170 Class Forum
- 2 LFS171 Class Forum
- 1 LFS178 Class Forum
- 1 LFS180 Class Forum
- 1 LFS182 Class Forum
- 1 LFS183 Class Forum
- 29 LFS200 Class Forum
- 736 LFS201 Class Forum - Discontinued
- 2 LFS201-JP クラス フォーラム
- 14 LFS203 Class Forum
- 102 LFS207 Class Forum
- 1 LFS207-DE-Klassenforum
- 1 LFS207-JP クラス フォーラム
- 301 LFS211 Class Forum
- 55 LFS216 Class Forum
- 48 LFS241 Class Forum
- 42 LFS242 Class Forum
- 37 LFS243 Class Forum
- 15 LFS244 Class Forum
- LFS245 Class Forum
- LFS246 Class Forum
- 50 LFS250 Class Forum
- 1 LFS250-JP クラス フォーラム
- LFS251 Class Forum
- 154 LFS253 Class Forum
- LFS254 Class Forum
- LFS255 Class Forum
- 5 LFS256 Class Forum
- 1 LFS257 Class Forum
- 1.3K LFS258 Class Forum
- 10 LFS258-JP クラス フォーラム
- 111 LFS260 Class Forum
- 159 LFS261 Class Forum
- 41 LFS262 Class Forum
- 82 LFS263 Class Forum - Discontinued
- 15 LFS264 Class Forum - Discontinued
- 11 LFS266 Class Forum - Discontinued
- 20 LFS267 Class Forum
- 24 LFS268 Class Forum
- 29 LFS269 Class Forum
- 1 LFS270 Class Forum
- 199 LFS272 Class Forum
- 1 LFS272-JP クラス フォーラム
- LFS274 Class Forum
- 3 LFS281 Class Forum
- 9 LFW111 Class Forum
- 260 LFW211 Class Forum
- 182 LFW212 Class Forum
- 13 SKF100 Class Forum
- 1 SKF200 Class Forum
- 1 SKF201 Class Forum
- 782 Hardware
- 198 Drivers
- 68 I/O Devices
- 37 Monitors
- 96 Multimedia
- 174 Networking
- 91 Printers & Scanners
- 83 Storage
- 743 Linux Distributions
- 80 Debian
- 67 Fedora
- 15 Linux Mint
- 13 Mageia
- 23 openSUSE
- 143 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 348 Ubuntu
- 461 Linux System Administration
- 39 Cloud Computing
- 70 Command Line/Scripting
- Github systems admin projects
- 90 Linux Security
- 77 Network Management
- 101 System Management
- 46 Web Management
- 64 Mobile Computing
- 17 Android
- 34 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 371 Off Topic
- 114 Introductions
- 174 Small Talk
- 19 Study Material
- 507 Programming and Development
- 285 Kernel Development
- 204 Software Development
- 1.8K Software
- 211 Applications
- 180 Command Line
- 3 Compiling/Installing
- 405 Games
- 309 Installation
- 97 All In Program
- 97 All In Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)