This is an old revision of the document!
Overview
To install kubernetes or minikube in general, which is a taste of Kubernetes. You need to configuration the repository first. So let's configure the Repository, depending on the operation system. In our case we will use Ubuntu, but I will show how to do it in every distribution
Repo Config
Let's start with Ubuntu:
Ubuntu
Download the GPG Key
root@k8s-master:/etc/apt/sources.list.d# curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - OK root@k8s-master:
Then we have to insert the repo details:
Insert Repo Location
root@k8s-master:/etc/apt/apt.conf.d# cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list > deb https://apt.kubernetes.io/ kubernetes-xenial main > EOF deb https://apt.kubernetes.io/ kubernetes-xenial main root@k8s-master:/etc/apt/apt.conf.d#
That command, will add the: “deb https://apt.kubernetes.io/ kubernetes-xenial main” string in the kuberenetes.list file.
After that, we can update the local repo:
Update the local repo
root@k8s-master:/etc/apt/sources.list.d# apt-get update Ign http://archive.ubuntu.com trusty InRelease Hit http://archive.ubuntu.com trusty-updates InRelease Hit http://archive.ubuntu.com trusty-backports InRelease Hit http://security.ubuntu.com trusty-security InRelease Hit http://archive.ubuntu.com trusty Release.gpg Hit http://archive.ubuntu.com trusty-updates/main Sources Hit https://download.docker.com xenial InRelease Hit http://archive.ubuntu.com trusty-updates/restricted Sources Hit http://security.ubuntu.com trusty-security/main Sources Hit https://download.docker.com trusty InRelease Hit https://download.docker.com xenial/stable amd64 Packages Hit http://archive.ubuntu.com trusty-updates/universe Sources Hit http://archive.ubuntu.com trusty-updates/multiverse Sources Hit http://security.ubuntu.com trusty-security/universe Sources Hit https://esm.ubuntu.com trusty-infra-security InRelease Hit http://archive.ubuntu.com trusty-updates/main amd64 Packages Hit https://esm.ubuntu.com trusty-infra-updates InRelease Hit http://archive.ubuntu.com trusty-updates/restricted amd64 Packages Hit http://security.ubuntu.com trusty-security/main amd64 Packages Hit https://esm.ubuntu.com trusty-infra-security/main amd64 Packages Hit http://archive.ubuntu.com trusty-updates/universe amd64 Packages Get:1 https://esm.ubuntu.com trusty-infra-security/main Translation-en_US Hit http://archive.ubuntu.com trusty-updates/multiverse amd64 Packages Hit https://download.docker.com trusty/stable amd64 Packages Hit http://security.ubuntu.com trusty-security/universe amd64 Packages Hit http://archive.ubuntu.com trusty-updates/main Translation-en Hit https://esm.ubuntu.com trusty-infra-updates/main amd64 Packages Hit http://archive.ubuntu.com trusty-updates/multiverse Translation-en Get:2 https://esm.ubuntu.com trusty-infra-updates/main Translation-en_US Get:3 https://download.docker.com trusty/stable Translation-en_US Hit http://archive.ubuntu.com trusty-updates/restricted Translation-en Hit http://security.ubuntu.com trusty-security/main Translation-en Hit http://archive.ubuntu.com trusty-updates/universe Translation-en Hit http://archive.ubuntu.com trusty-backports/main Sources Hit http://security.ubuntu.com trusty-security/universe Translation-en Hit http://archive.ubuntu.com trusty-backports/restricted Sources Hit http://archive.ubuntu.com trusty-backports/universe Sources Hit http://archive.ubuntu.com trusty-backports/multiverse Sources Hit http://archive.ubuntu.com trusty-backports/main amd64 Packages Hit http://archive.ubuntu.com trusty-backports/restricted amd64 Packages Hit http://archive.ubuntu.com trusty-backports/universe amd64 Packages Hit http://archive.ubuntu.com trusty-backports/multiverse amd64 Packages Hit http://archive.ubuntu.com trusty-backports/main Translation-en Hit http://archive.ubuntu.com trusty-backports/multiverse Translation-en Hit http://archive.ubuntu.com trusty-backports/restricted Translation-en Hit http://archive.ubuntu.com trusty-backports/universe Translation-en Ign https://esm.ubuntu.com trusty-infra-security/main Translation-en_US Hit http://archive.ubuntu.com trusty Release Ign https://esm.ubuntu.com trusty-infra-security/main Translation-en Hit http://archive.ubuntu.com trusty/main Sources Ign https://esm.ubuntu.com trusty-infra-updates/main Translation-en_US Hit http://archive.ubuntu.com trusty/restricted Sources Ign https://esm.ubuntu.com trusty-infra-updates/main Translation-en Hit http://archive.ubuntu.com trusty/universe Sources Hit http://archive.ubuntu.com trusty/multiverse Sources Hit http://archive.ubuntu.com trusty/main amd64 Packages Hit http://archive.ubuntu.com trusty/restricted amd64 Packages Hit http://archive.ubuntu.com trusty/universe amd64 Packages Hit http://archive.ubuntu.com trusty/multiverse amd64 Packages Hit http://archive.ubuntu.com trusty/main Translation-en Hit http://archive.ubuntu.com trusty/multiverse Translation-en Hit http://archive.ubuntu.com trusty/restricted Translation-en Hit http://archive.ubuntu.com trusty/universe Translation-en Ign http://archive.ubuntu.com trusty/main Translation-en_US Ign https://download.docker.com xenial/stable Translation-en_US Ign http://archive.ubuntu.com trusty/multiverse Translation-en_US Ign http://archive.ubuntu.com trusty/restricted Translation-en_US Ign http://archive.ubuntu.com trusty/universe Translation-en_US Ign https://download.docker.com xenial/stable Translation-en Ign https://download.docker.com trusty/stable Translation-en_US Ign https://download.docker.com trusty/stable Translation-en Ign https://apt.kubernetes.io kubernetes-xenial/main Translation-en_US Ign https://apt.kubernetes.io kubernetes-xenial/main Translation-en Fetched 43.7 kB in 3s (11.0 kB/s) Reading package lists... Done root@k8s-master:/etc/apt/sources.list.d# apt-get install kuberctl Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package kuberctl root@k8s-master:/etc/apt/sources.list.d#
Finally, we can install the kuberctl:
Install the kuberctl
root@k8s-master:/etc/apt/sources.list.d# apt-get install -y kubelet kubeadm kubectl kubernetes-cni Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: acl at-spi2-core colord dconf-gsettings-backend dconf-service libasound2 libasound2-data libatk-bridge2.0-0 libatspi2.0-0 libcairo-gobject2 libcanberra-gtk3-0 libcanberra-gtk3-module libcanberra0 libcolord1 libcolorhug1 libdconf1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libexif12 libfontenc1 libgd3 libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libgphoto2-6 libgphoto2-l10n libgphoto2-port10 libgtk-3-0 libgtk-3-bin libgtk-3-common libgudev-1.0-0 libgusb2 libice6 libieee1284-3 liblcms2-2 libllvm3.4 libltdl7 libnotify-bin libnotify4 libogg0 libpciaccess0 libsane libsane-common libsm6 libtdb1 libtxc-dxtn-s2tc0 libv4l-0 libv4lconvert0 libvorbis0a libvorbisfile3 libvpx1 libwayland-client0 libwayland-cursor0 libx11-xcb1 libxaw7 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-sync1 libxfont1 libxkbcommon0 libxkbfile1 libxmu6 libxpm4 libxshmfence1 libxt6 libxtst6 libxxf86vm1 notification-daemon sound-theme-freedesktop x11-common x11-xkb-utils xfonts-base xfonts-encodings xfonts-utils xserver-common xserver-xorg-core Use 'apt-get autoremove' to remove them. The following extra packages will be installed: conntrack cri-tools ebtables libmnl0 libnetfilter-conntrack3 socat The following NEW packages will be installed: conntrack cri-tools ebtables kubeadm kubectl kubelet kubernetes-cni libmnl0 libnetfilter-conntrack3 socat 0 upgraded, 10 newly installed, 0 to remove and 1 not upgraded. Need to get 52.1 MB of archives. After this operation, 275 MB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libmnl0 amd64 1.0.3-3ubuntu1 [11.4 kB] Get:2 http://archive.ubuntu.com/ubuntu/ trusty/main libnetfilter-conntrack3 amd64 1.0.4-1 [45.9 kB] Get:3 http://archive.ubuntu.com/ubuntu/ trusty/universe conntrack amd64 1:1.4.1-1ubuntu1 [25.1 kB] Get:4 http://archive.ubuntu.com/ubuntu/ trusty-updates/main ebtables amd64 2.0.10.4-3ubuntu1.14.04.2 [77.2 kB] Get:5 http://archive.ubuntu.com/ubuntu/ trusty/universe socat amd64 1.7.2.3-1 [302 kB] Fetched 52.1 MB in 5s (9,095 kB/s) Selecting previously unselected package libmnl0:amd64. (Reading database ... 63064 files and directories currently installed.) Preparing to unpack .../libmnl0_1.0.3-3ubuntu1_amd64.deb ... Unpacking libmnl0:amd64 (1.0.3-3ubuntu1) ... Selecting previously unselected package libnetfilter-conntrack3:amd64. Preparing to unpack .../libnetfilter-conntrack3_1.0.4-1_amd64.deb ... Unpacking libnetfilter-conntrack3:amd64 (1.0.4-1) ... Selecting previously unselected package conntrack. Preparing to unpack .../conntrack_1%3a1.4.1-1ubuntu1_amd64.deb ... Unpacking conntrack (1:1.4.1-1ubuntu1) ... Selecting previously unselected package cri-tools. Preparing to unpack .../cri-tools_1.13.0-00_amd64.deb ... Unpacking cri-tools (1.13.0-00) ... Selecting previously unselected package ebtables. Preparing to unpack .../ebtables_2.0.10.4-3ubuntu1.14.04.2_amd64.deb ... Unpacking ebtables (2.0.10.4-3ubuntu1.14.04.2) ... Selecting previously unselected package kubernetes-cni. Preparing to unpack .../kubernetes-cni_0.7.5-00_amd64.deb ... Unpacking kubernetes-cni (0.7.5-00) ... Selecting previously unselected package socat. Preparing to unpack .../socat_1.7.2.3-1_amd64.deb ... Unpacking socat (1.7.2.3-1) ... Selecting previously unselected package kubelet. Preparing to unpack .../kubelet_1.18.0-00_amd64.deb ... Unpacking kubelet (1.18.0-00) ... Selecting previously unselected package kubectl. Preparing to unpack .../kubectl_1.18.0-00_amd64.deb ... Unpacking kubectl (1.18.0-00) ... Selecting previously unselected package kubeadm. Preparing to unpack .../kubeadm_1.18.0-00_amd64.deb ... Unpacking kubeadm (1.18.0-00) ... Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Processing triggers for ureadahead (0.100.0-16) ... Setting up libmnl0:amd64 (1.0.3-3ubuntu1) ... Setting up libnetfilter-conntrack3:amd64 (1.0.4-1) ... Setting up conntrack (1:1.4.1-1ubuntu1) ... Setting up cri-tools (1.13.0-00) ... Setting up ebtables (2.0.10.4-3ubuntu1.14.04.2) ... Setting up kubernetes-cni (0.7.5-00) ... Setting up socat (1.7.2.3-1) ... Setting up kubectl (1.18.0-00) ... Processing triggers for ureadahead (0.100.0-16) ... Setting up kubelet (1.18.0-00) ... Setting up kubeadm (1.18.0-00) ... Processing triggers for libc-bin (2.19-0ubuntu6.15) ...