暂无图片
暂无图片
暂无图片
暂无图片
暂无图片
ubuntu18.04安装k8s过程
1554
8页
2次
2019-12-02
5墨值下载
Install and Congure Kubernetes (k8s) 1.13 on
Ubuntu 18.04 LTS / Ubuntu 18.10
Kubernetes is a free and open source container orchestration tool. It is used to deploy container
based applications automatically in cluster environment, apart from this it also used to manage
Docker containers across the kubernetes cluster hosts. Kubernetes is also Known as K8s.
In this article I will demonstrate how to install and congure two node Kubernetes (1.13) using
kubeadm on Ubuntu 18.04 / 18.10 systems. Following are the details of my lab setup:
I will be using three Ubuntu 18.04 LTS system, where one system will act as Kubernetes Master
Node and other two nodes will act as Slave node and will join the Kubernetes cluster. I am
assuming minimal 18.04 LTS is installed on these three systems.
Kubernetes Master Node – (Hostname: k8s-master , IP : 192.168.1.70, OS : Minimal Ubuntu
18.04 LTS)
Kubernetes Slave Node 1 – (Hostname: k8s-worker-node1, IP: 192.168.1.80 , OS : Minimal
Ubuntu 18.04 LTS)
Kubernetes Slave Node 2 – (Hostname: k8s-worker-node2, IP: 192.168.1.90 , OS : Minimal
Ubuntu 18.04 LTS)
Note: Kubernetes Slave Node is also known as Worker Node
Let’s jump into the k8s installation and conguration steps.
Step:1) Set Hostname and update hosts le
Login to the master node and congure its hostname using the hostnamectl command
Login to Slave / Worker Nodes and congure their hostname respectively using the hostnamectl
command,
Add the following lines in /etc/hosts le on all three systems,
linuxtechi@localhost:~$ sudo hostnamectl set-hostname "k8s-master"
linuxtechi@localhost:~$ exec bash
linuxtechi@k8s-master:~$
linuxtechi@localhost:~$ sudo hostnamectl set-hostname k8s-worker-node1
linuxtechi@localhost:~$ exec bash
linuxtechi@k8s-worker-node1:~$
linuxtechi@localhost:~$ sudo hostnamectl set-hostname k8s-worker-node2
linuxtechi@localhost:~$ exec bash
linuxtechi@k8s-worker-node2:~$
Step:2) Install and Start Docker Service on Master and Slave Nodes
Run the below apt-get command to install Docker on Master node,
Run the below apt-get command to install docker on slave nodes,
Once the Docker packages are installed on all the three systems , start and enable the docker
service using below systemctl commands, these commands needs to be executed on master and
slave nodes.
Use below docker command to verify which Docker version has been installed on these systems,
Step:3) Congure Kubernetes Package Repository on Master & Slave
Nodes
Note: All the commands in this step are mandate to run on master and slave nodes
Let’s rst install some required packages, run the following commands on all the nodes including
master node
Now add Kubernetes package repository key using the following command,
192.168.1.70 k8s-master
192.168.1.80 k8s-worker-node1
192.168.1.90 k8s-worker-node2
linuxtechi@k8s-master:~$ sudo apt-get install docker.io -y
linuxtechi@k8s-worker-node1:~$ sudo apt-get install docker.io -y
linuxtechi@k8s-worker-node2:~$ sudo apt-get install docker.io -y
~$ sudo systemctl start docker
~$ 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
~$
~$ docker --version
Docker version 18.06.1-ce, build e68fc7a
~$
~$ sudo apt-get install apt-transport-https curl -y
of 8
5墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

关注
最新上传
暂无内容,敬请期待...
下载排行榜
Top250 周榜 月榜