Kubernetes also referred to as k8 , is a free and opensource tool used for management of Docker containers. It’s a container orchestration platform that is tailored to automate the deployment, scaling, and management of containerized applications. In this guide, you will learn how to install and configure Kubernetes on Ubuntu 18.04 LTS.
Kubernetes也称为k8 ,是一种免费的开源工具,用于管理Docker容器。 这是一个容器编排平台,专门用于自动执行容器化应用程序的部署,扩展和管理。 在本指南中,您将学习如何在Ubuntu 18.04 LTS上安装和配置Kubernetes。
先决条件 (Prerequisites)
Before we get started , we are going to have a test lab comprising 3 Ubuntu 18.04 nodes as shown below
在开始之前,我们将有一个包含3个Ubuntu 18.04节点的测试实验室,如下所示
- Kubernetes Master Node IP address: 172.31.4.36 Hostname: k8-master Kubernetes主节点IP地址:172.31.4.36主机名:k8-master
- Kubernetes Slave Node 1 IP address: 172.31.4.170 Hostname: k8-slave Kubernetes从站节点1 IP地址:172.31.4.170主机名:k8-slave
- Kubernetes Slave Node 2 IP address: 172.31.10.30 Hostname: k8-slave2 Kubernetes从站节点2 IP地址:172.31.10.30主机名:k8-slave2
In addition, ensure that your system has the following minimum requirements.
此外,请确保您的系统具有以下最低要求。
- 2 CPUS 2个CPU
- 4 GB RAM 4 GB内存
- 8 GB free Hard disk space 8 GB可用硬盘空间
Let’s now dive in and get started.
现在让我们开始吧。
步骤1.设置主机名和更新主机文件 (Step 1. Setting up hostname & Updating hosts file )
To start off, you are going to log in the Master Node via SSH and set up the hostname as shown
首先,您将通过SSH登录主节点并设置主机名,如下所示
$ sudo hostnamectl set-h