From b562a116c5726925b66cf60df6e511e9211ff3b4 Mon Sep 17 00:00:00 2001 From: alecsandru Date: Fri, 3 May 2024 20:08:59 +0000 Subject: [PATCH] Update 'prepare_k8s.yml' --- prepare_k8s.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/prepare_k8s.yml b/prepare_k8s.yml index 39939c4..388e796 100644 --- a/prepare_k8s.yml +++ b/prepare_k8s.yml @@ -12,10 +12,39 @@ package: name: runc state: present + - name: Configure containerd + command: "{{ item }} chdir=/etc/" + with_items: + - mkdir /etc/containerd + - containerd config default > /etc/containerd/config.toml + - sudo sed -i 's/ SystemdCgroup = false/ SystemdCgroup = true/' /etc/containerd/config.toml - name: Install CNI Plugins command: "{{ item }} chdir=/tmp" with_items: - wget https://github.com/containernetworking/plugins/releases/download/v1.4.1/cni-plugins-linux-arm64-v1.4.1.tgz - mkdir -p /opt/cni/bin - tar Cxzvf /opt/cni/bin cni-plugins-linux-arm64-v1.4.1.tgz - - rm cni-plugins-linux-arm64-v1.4.1.tgz \ No newline at end of file + - rm cni-plugins-linux-arm64-v1.4.1.tgz + - name: Restart containerd + service: + name: containerd + state: restarted + - name: Enable IPv4 Forwarding + copy: + dest: /etc/sysctl.d/k8s.conf + content: | + "net.ipv4.ip_forward = 1" + "net.bridge.bridge-nf-call-iptables = 1" + "net.bridge.bridge-nf-call-ip6tables = 1" + - name: Load required modules + copy: + dest: /etc/modules-load.d/k8s.conf + content: | + "overlay" + "br_netfilter" + - name: Install CriCtl + command: "{{ item }} chdir=/tmp" + with_items: + - "curl -L "https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.30.0/crictl-v1.30.0-linux-arm64.tar.gz" | sudo tar -C /usr/local/bin -xz" + - "rm crictl-v1.30.0-linux-arm64.tar.gz" + - "echo https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/" \ No newline at end of file