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: [email protected] # # 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
- 51 LFX Mentorship
- 104 LFX Mentorship: Linux Kernel
- 576 Linux Foundation IT Professional Programs
- 304 Cloud Engineer IT Professional Program
- 125 Advanced Cloud Engineer IT Professional Program
- 53 DevOps Engineer IT Professional Program
- 61 Cloud Native Developer IT Professional Program
- 5 Express Training Courses
- 5 Express Courses - Discussion Forum
- 2.1K Training Courses
- 19 LFC110 Class Forum
- 7 LFC131 Class Forum
- 27 LFD102 Class Forum
- 158 LFD103 Class Forum
- 21 LFD121 Class Forum
- 1 LFD137 Class Forum
- 61 LFD201 Class Forum
- 1 LFD210 Class Forum
- LFD210-CN Class Forum
- 1 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum
- LFD237 Class Forum
- 23 LFD254 Class Forum
- 613 LFD259 Class Forum
- 105 LFD272 Class Forum
- 1 LFD272-JP クラス フォーラム
- 1 LFD273 Class Forum
- 2 LFS145 Class Forum
- 25 LFS200 Class Forum
- 739 LFS201 Class Forum
- 1 LFS201-JP クラス フォーラム
- 11 LFS203 Class Forum
- 77 LFS207 Class Forum
- 300 LFS211 Class Forum
- 54 LFS216 Class Forum
- 47 LFS241 Class Forum
- 41 LFS242 Class Forum
- 37 LFS243 Class Forum
- 11 LFS244 Class Forum
- 37 LFS250 Class Forum
- 1 LFS250-JP クラス フォーラム
- LFS251 Class Forum
- 141 LFS253 Class Forum
- LFS254 Class Forum
- 1.1K LFS258 Class Forum
- 10 LFS258-JP クラス フォーラム
- 93 LFS260 Class Forum
- 132 LFS261 Class Forum
- 33 LFS262 Class Forum
- 80 LFS263 Class Forum
- 15 LFS264 Class Forum
- 11 LFS266 Class Forum
- 18 LFS267 Class Forum
- 18 LFS268 Class Forum
- 23 LFS269 Class Forum
- 203 LFS272 Class Forum
- 1 LFS272-JP クラス フォーラム
- LFS274 Class Forum
- LFS281 Class Forum
- 236 LFW211 Class Forum
- 172 LFW212 Class Forum
- 7 SKF100 Class Forum
- SKF200 Class Forum
- 903 Hardware
- 219 Drivers
- 74 I/O Devices
- 44 Monitors
- 116 Multimedia
- 209 Networking
- 101 Printers & Scanners
- 85 Storage
- 763 Linux Distributions
- 88 Debian
- 66 Fedora
- 15 Linux Mint
- 13 Mageia
- 24 openSUSE
- 142 Red Hat Enterprise
- 33 Slackware
- 13 SUSE Enterprise
- 357 Ubuntu
- 479 Linux System Administration
- 41 Cloud Computing
- 70 Command Line/Scripting
- Github systems admin projects
- 95 Linux Security
- 78 Network Management
- 108 System Management
- 49 Web Management
- 68 Mobile Computing
- 23 Android
- 30 Development
- 1.2K New to Linux
- 1.1K Getting Started with Linux
- 538 Off Topic
- 131 Introductions
- 217 Small Talk
- 22 Study Material
- 826 Programming and Development
- 278 Kernel Development
- 514 Software Development
- 928 Software
- 260 Applications
- 184 Command Line
- 3 Compiling/Installing
- 76 Games
- 316 Installation
- 61 All In Program
- 61 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)