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.iopackage from Docker repo installs just fine. It is the most up to date package, as opposed to thecontainerdpackage 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 '***************************' echo0
Categories
- All Categories
- 177 LFX Mentorship
- 177 LFX Mentorship: Linux Kernel
- 754 Linux Foundation IT Professional Programs
- 374 Cloud Engineer IT Professional Program
- 170 Advanced Cloud Engineer IT Professional Program
- 74 DevOps IT Professional Program - Discontinued
- 5 DevOps & GitOps IT Professional Program
- 100 Cloud Native Developer IT Professional Program
- 7.6K Training Courses & Learning Paths
- 2 AI & ML Training
- 1 Blockchain & Decentralized Identity Training
- 5 Cloud & Containers Training
- 1 Cybersecurity Training
- 2 DevOps & Site-Reliability Training
- 1 Linux Kernel Development Training
- 1 Networking Training
- 2 Open Source Best Practice Training
- 2 System Administration Training
- 1 System Engineering Training
- 1 Web & Application Development Training
- 794 Hardware
- 202 Drivers
- 68 I/O Devices
- 37 Monitors
- 95 Multimedia
- 173 Networking
- 91 Printers & Scanners
- 89 Storage
- 769 Linux Distributions
- 81 Debian
- 68 Fedora
- 22 Linux Mint
- 13 Mageia
- 24 openSUSE
- 150 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 356 Ubuntu
- 465 Linux System Administration
- 31 Cloud Computing
- 73 Command Line/Scripting
- Github systems admin projects
- 98 Linux Security
- 78 Network Management
- 101 System Management
- 46 Web Management
- 112 Mobile Computing
- 20 Android
- 77 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 393 Off Topic
- 121 Introductions
- 182 Small Talk
- 29 Study Material
- 976 Programming and Development
- 310 Kernel Development
- 648 Software Development
- 990 Software
- 382 Applications
- 182 Command Line
- 5 Compiling/Installing
- 68 Games
- 317 Installation
- Archived
- 2 LFD140 Class Forum
- 1.4K LFS258 Class 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)