eks-distro icon indicating copy to clipboard operation
eks-distro copied to clipboard

How to install EKS-D on-premise on ubuntu 20.04

Open ess-1048 opened this issue 3 years ago • 0 comments

following install procedure is succeeded on ubuntu 18.04.6, but failed on ubuntu 20.04.4 this is based on https://distro.eks.amazonaws.com/users/install/kubeadm-onsite/ what is wrong for ubuntu 20.04?

focal@ubuntu:~$ sudo apt-get update [sudo] password for focal: Hit:1 https://download.docker.com/linux/ubuntu focal InRelease Hit:2 http://jp.archive.ubuntu.com/ubuntu focal InRelease Hit:3 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease Hit:4 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease Hit:5 http://jp.archive.ubuntu.com/ubuntu focal-security InRelease Reading package lists... Done focal@ubuntu:~$ sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages have been kept back: fwupd 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. focal@ubuntu:~$ docker version Client: Docker Engine - Community Version: 20.10.13 API version: 1.41 Go version: go1.16.15 Git commit: a224086 Built: Thu Mar 10 14:07:51 2022 OS/Arch: linux/amd64 Context: default Experimental: true

Server: Docker Engine - Community Engine: Version: 20.10.13 API version: 1.41 (minimum version 1.12) Go version: go1.16.15 Git commit: 906f57f Built: Thu Mar 10 14:05:44 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.5.10 GitCommit: 2a1d4dbdb2a1030dc5b01e96fb110a9d9f150ecc runc: Version: 1.0.3 GitCommit: v1.0.3-0-gf46b6ba docker-init: Version: 0.19.0 GitCommit: de40ad0 focal@ubuntu:~$ sudo nano /etc/docker/daemon.json focal@ubuntu:~$ focal@ubuntu:~$ sudo systemctl enable docker Synchronizing state of docker.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable docker focal@ubuntu:~$ sudo systemctl daemon-reload focal@ubuntu:~$ sudo systemctl restart docker focal@ubuntu:~$ sudo apt-get install apt-transport-https Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: apt-transport-https 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. Need to get 4,680 B of archives. After this operation, 162 kB of additional disk space will be used. Get:1 http://jp.archive.ubuntu.com/ubuntu focal-updates/universe amd64 apt-transport-https all 2.0.6 [4,680 B] Fetched 4,680 B in 0s (33.3 kB/s) Selecting previously unselected package apt-transport-https. (Reading database ... 72098 files and directories currently installed.) Preparing to unpack .../apt-transport-https_2.0.6_all.deb ... Unpacking apt-transport-https (2.0.6) ... Setting up apt-transport-https (2.0.6) ... focal@ubuntu:~$ sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg focal@ubuntu:~$ echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main focal@ubuntu:~$ sudo apt-get update Hit:1 https://download.docker.com/linux/ubuntu focal InRelease Hit:2 http://jp.archive.ubuntu.com/ubuntu focal InRelease Hit:3 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease Hit:4 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease Hit:5 http://jp.archive.ubuntu.com/ubuntu focal-security InRelease Get:6 https://packages.cloud.google.com/apt kubernetes-xenial InRelease [9,383 B] Get:7 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 Packages [54.7 kB] Fetched 64.1 kB in 1s (55.9 kB/s) Reading package lists... Done focal@ubuntu:~$ sudo apt-get install kubelet=1.21.9-00 kubeadm=1.21.9-00 kubectl=1.21.9-00 Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: conntrack cri-tools ebtables kubernetes-cni socat Suggested packages: nftables The following NEW packages will be installed: conntrack cri-tools ebtables kubeadm kubectl kubelet kubernetes-cni socat 0 upgraded, 8 newly installed, 0 to remove and 1 not upgraded. Need to get 77.2 MB of archives. After this operation, 328 MB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 conntrack amd64 1:1.4.5-2 [30.3 kB] Get:3 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 ebtables amd64 2.0.11-3build1 [80.3 kB] Get:4 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 socat amd64 1.7.3.3-2 [323 kB] Get:2 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 cri-tools amd64 1.23.0-00 [15.3 MB] Get:5 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 kubernetes-cni amd64 0.8.7-00 [25.0 MB] Get:6 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 kubelet amd64 1.21.9-00 [18.9 MB] Get:7 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 kubectl amd64 1.21.9-00 [9,013 kB] Get:8 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 kubeadm amd64 1.21.9-00 [8,590 kB] Fetched 77.2 MB in 14s (5,467 kB/s) Selecting previously unselected package conntrack. (Reading database ... 72102 files and directories currently installed.) Preparing to unpack .../0-conntrack_1%3a1.4.5-2_amd64.deb ... Unpacking conntrack (1:1.4.5-2) ... Selecting previously unselected package cri-tools. Preparing to unpack .../1-cri-tools_1.23.0-00_amd64.deb ... Unpacking cri-tools (1.23.0-00) ... Selecting previously unselected package ebtables. Preparing to unpack .../2-ebtables_2.0.11-3build1_amd64.deb ... Unpacking ebtables (2.0.11-3build1) ... Selecting previously unselected package kubernetes-cni. Preparing to unpack .../3-kubernetes-cni_0.8.7-00_amd64.deb ... Unpacking kubernetes-cni (0.8.7-00) ... Selecting previously unselected package socat. Preparing to unpack .../4-socat_1.7.3.3-2_amd64.deb ... Unpacking socat (1.7.3.3-2) ... Selecting previously unselected package kubelet. Preparing to unpack .../5-kubelet_1.21.9-00_amd64.deb ... Unpacking kubelet (1.21.9-00) ... Selecting previously unselected package kubectl. Preparing to unpack .../6-kubectl_1.21.9-00_amd64.deb ... Unpacking kubectl (1.21.9-00) ... Selecting previously unselected package kubeadm. Preparing to unpack .../7-kubeadm_1.21.9-00_amd64.deb ... Unpacking kubeadm (1.21.9-00) ... Setting up conntrack (1:1.4.5-2) ... Setting up kubectl (1.21.9-00) ... Setting up ebtables (2.0.11-3build1) ... Setting up socat (1.7.3.3-2) ... Setting up cri-tools (1.23.0-00) ... Setting up kubernetes-cni (0.8.7-00) ... Setting up kubelet (1.21.9-00) ... Created symlink /etc/systemd/system/multi-user.target.wants/kubelet.service → /lib/systemd/system/kubelet.service. Setting up kubeadm (1.21.9-00) ... Processing triggers for man-db (2.9.1-1) ... focal@ubuntu:~$ sudo apt-mark hold kubelet kubeadm kubectl kubelet set on hold. kubeadm set on hold. kubectl set on hold. focal@ubuntu:~$ cd /usr/bin focal@ubuntu:/usr/bin$ sudo rm kubelet kubeadm kubectl focal@ubuntu:/usr/bin$ sudo wget https://distro.eks.amazonaws.com/kubernetes-1-21/releases/10/artifacts/kubernetes/v1.21.9/bin/linux/amd64/kubelet --2022-03-21 23:36:40-- https://distro.eks.amazonaws.com/kubernetes-1-21/releases/10/artifacts/kubernetes/v1.21.9/bin/linux/amd64/kubelet Resolving distro.eks.amazonaws.com (distro.eks.amazonaws.com)... 13.32.54.56, 13.32.54.60, 13.32.54.25, ... Connecting to distro.eks.amazonaws.com (distro.eks.amazonaws.com)|13.32.54.56|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 118112256 (113M) [binary/octet-stream] Saving to: ‘kubelet’

kubelet 100%[=================================================>] 112.64M 6.25MB/s in 19s

2022-03-21 23:36:59 (6.05 MB/s) - ‘kubelet’ saved [118112256/118112256]

focal@ubuntu:/usr/bin$ sudo wget https://distro.eks.amazonaws.com/kubernetes-1-21/releases/10/artifacts/kubernetes/v1.21.9/bin/linux/amd64/kubeadm --2022-03-21 23:37:05-- https://distro.eks.amazonaws.com/kubernetes-1-21/releases/10/artifacts/kubernetes/v1.21.9/bin/linux/amd64/kubeadm Resolving distro.eks.amazonaws.com (distro.eks.amazonaws.com)... 13.32.54.56, 13.32.54.60, 13.32.54.25, ... Connecting to distro.eks.amazonaws.com (distro.eks.amazonaws.com)|13.32.54.56|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 44732416 (43M) [binary/octet-stream] Saving to: ‘kubeadm’

kubeadm 100%[=================================================>] 42.66M 5.77MB/s in 7.3s

2022-03-21 23:37:14 (5.81 MB/s) - ‘kubeadm’ saved [44732416/44732416]

focal@ubuntu:/usr/bin$ sudo wget https://distro.eks.amazonaws.com/kubernetes-1-21/releases/10/artifacts/kubernetes/v1.21.9/bin/linux/amd64/kubectl --2022-03-21 23:37:26-- https://distro.eks.amazonaws.com/kubernetes-1-21/releases/10/artifacts/kubernetes/v1.21.9/bin/linux/amd64/kubectl Resolving distro.eks.amazonaws.com (distro.eks.amazonaws.com)... 13.32.54.56, 13.32.54.60, 13.32.54.25, ... Connecting to distro.eks.amazonaws.com (distro.eks.amazonaws.com)|13.32.54.56|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 46542848 (44M) [binary/octet-stream] Saving to: ‘kubectl’

kubectl 100%[=================================================>] 44.39M 5.00MB/s in 8.8s

2022-03-21 23:37:36 (5.05 MB/s) - ‘kubectl’ saved [46542848/46542848]

focal@ubuntu:/usr/bin$ sudo chmod +x kubeadm kubectl kubelet focal@ubuntu:/usr/bin$ cd focal@ubuntu:~$ sudo nano /etc/default/kubelet focal@ubuntu:~$ focal@ubuntu:~$ sudo swapoff -a focal@ubuntu:~$ sudo nano /etc/fstab focal@ubuntu:~$ focal@ubuntu:~$ sudo systemctl enable kubelet focal@ubuntu:~$ sudo mkdir -p /var/lib/kubelet focal@ubuntu:~$ sudo nano /var/lib/kubelet/kubeadm-flags.env focal@ubuntu:~$ focal@ubuntu:~$ sudo docker pull public.ecr.aws/eks-distro/etcd-io/etcd:v3.4.18-eks-1-21-10 v3.4.18-eks-1-21-10: Pulling from eks-distro/etcd-io/etcd 4dfd587572c7: Pull complete 5430a4b1aee0: Pull complete 69d160e00699: Pull complete 1854c3e0826f: Pull complete 96c094bf7e44: Pull complete a875aa951018: Pull complete Digest: sha256:7174fee9e550cba9b30d373006db3a8387bb9b06d14db132879358bf98993f71 Status: Downloaded newer image for public.ecr.aws/eks-distro/etcd-io/etcd:v3.4.18-eks-1-21-10 public.ecr.aws/eks-distro/etcd-io/etcd:v3.4.18-eks-1-21-10 focal@ubuntu:~$ sudo docker pull public.ecr.aws/eks-distro/kubernetes/pause:v1.21.9-eks-1-21-10 v1.21.9-eks-1-21-10: Pulling from eks-distro/kubernetes/pause 40ea8c1b5979: Pull complete Digest: sha256:646fa0ffa8bb584aa8fbda9551b91c7561eb25d725ddd879152531bc9c8febf4 Status: Downloaded newer image for public.ecr.aws/eks-distro/kubernetes/pause:v1.21.9-eks-1-21-10 public.ecr.aws/eks-distro/kubernetes/pause:v1.21.9-eks-1-21-10 focal@ubuntu:~$ sudo docker pull public.ecr.aws/eks-distro/coredns/coredns:v1.8.4-eks-1-21-10 v1.8.4-eks-1-21-10: Pulling from eks-distro/coredns/coredns c4e16a868f6d: Pull complete afcf1694b62e: Pull complete bfaa59083871: Pull complete 7103d0ccafd5: Pull complete Digest: sha256:13164a59ef3419242e568d9b6fa8fe3c483b771a5684f74fbf9a25b9ac72a201 Status: Downloaded newer image for public.ecr.aws/eks-distro/coredns/coredns:v1.8.4-eks-1-21-10 public.ecr.aws/eks-distro/coredns/coredns:v1.8.4-eks-1-21-10 focal@ubuntu:~$ sudo docker tag public.ecr.aws/eks-distro/etcd-io/etcd:v3.4.18-eks-1-21-10 public.ecr.aws/eks-distro/kubernetes/etcd:3.4.13-0 focal@ubuntu:~$ sudo docker tag public.ecr.aws/eks-distro/kubernetes/pause:v1.21.9-eks-1-21-10 public.ecr.aws/eks-distro/kubernetes/pause:3.4.1 focal@ubuntu:~$ sudo docker tag public.ecr.aws/eks-distro/coredns/coredns:v1.8.4-eks-1-21-10 public.ecr.aws/eks-distro/kubernetes/coredns:v1.8.0 focal@ubuntu:~$ sudo kubeadm init --image-repository public.ecr.aws/eks-distro/kubernetes --kubernetes-version v1.21.9-eks-1-21-10 [init] Using Kubernetes version: v1.21.9-eks-1-21-10 [preflight] Running pre-flight checks [preflight] Pulling images required for setting up a Kubernetes cluster [preflight] This might take a minute or two, depending on the speed of your internet connection [preflight] You can also perform this action in beforehand using 'kubeadm config images pull' [certs] Using certificateDir folder "/etc/kubernetes/pki" [certs] Generating "ca" certificate and key [certs] Generating "apiserver" certificate and key [certs] apiserver serving cert is signed for DNS names [kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local ubuntu] and IPs [10.96.0.1 192.168.66.132] [certs] Generating "apiserver-kubelet-client" certificate and key [certs] Generating "front-proxy-ca" certificate and key [certs] Generating "front-proxy-client" certificate and key [certs] Generating "etcd/ca" certificate and key [certs] Generating "etcd/server" certificate and key [certs] etcd/server serving cert is signed for DNS names [localhost ubuntu] and IPs [192.168.66.132 127.0.0.1 ::1] [certs] Generating "etcd/peer" certificate and key [certs] etcd/peer serving cert is signed for DNS names [localhost ubuntu] and IPs [192.168.66.132 127.0.0.1 ::1] [certs] Generating "etcd/healthcheck-client" certificate and key [certs] Generating "apiserver-etcd-client" certificate and key [certs] Generating "sa" key and public key [kubeconfig] Using kubeconfig folder "/etc/kubernetes" [kubeconfig] Writing "admin.conf" kubeconfig file [kubeconfig] Writing "kubelet.conf" kubeconfig file [kubeconfig] Writing "controller-manager.conf" kubeconfig file [kubeconfig] Writing "scheduler.conf" kubeconfig file [kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env" [kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml" [kubelet-start] Starting the kubelet [control-plane] Using manifest folder "/etc/kubernetes/manifests" [control-plane] Creating static Pod manifest for "kube-apiserver" [control-plane] Creating static Pod manifest for "kube-controller-manager" [control-plane] Creating static Pod manifest for "kube-scheduler" [etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests" [wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s [kubelet-check] Initial timeout of 40s passed.

    Unfortunately, an error has occurred:
            timed out waiting for the condition

    This error is likely caused by:
            - The kubelet is not running
            - The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)

    If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands:
            - 'systemctl status kubelet'
            - 'journalctl -xeu kubelet'

    Additionally, a control plane component may have crashed or exited when started by the container runtime.
    To troubleshoot, list all containers using your preferred container runtimes CLI.

    Here is one example how you may list all Kubernetes containers running in docker:
            - 'docker ps -a | grep kube | grep -v pause'
            Once you have found the failing container, you can inspect its logs with:
            - 'docker logs CONTAINERID'

error execution phase wait-control-plane: couldn't initialize a Kubernetes cluster To see the stack trace of this error execute with --v=5 or higher focal@ubuntu:~$

ess-1048 avatar Mar 23 '22 22:03 ess-1048