Centos7部署kubernetes准备工作(一)

一、准备工作:

1、创建三台虚拟机:(在node1配置好环境,然后关机克隆出node2、node3、并修改网卡、主机名即可)

linux-node1.example.com 192.168.43.21

linux-node2.example.com 192.168.43.22

linux-node3.example.com 192.168.43.23

设置主机名:

[[email protected] ~]# hostnamectl set-hostname linux-node1.example.com

2、配置IP:

[[email protected] ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens32

TYPE=Ethernet

BOOTPROTO=static

NAME=ens32

DEVICE=ens32

ONBOOT=yes

IPADDR=192.168.43.21

NETMASK=255.255.255.0

GATEWAY=192.168.43.2

DNS1=192.168.43.2

3、关闭NetworkManager、firewalld、selinux等

[[email protected] ~]# systemctl disable NetworkManager

[[email protected] ~]# systemctl disable firewalld

[[email protected] ~]# vim /etc/selinux/config ---->SELINUX=enforcing

4、设置主机名解析:

[[email protected] ~]# cat /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.43.21 linux-node1 linux-node1.example.com

192.168.43.22 linux-node2 linux-node2.example.com

192.168.43.23 linux-node3 linux-node3.example.com

5、安装epel扩展源和常用的命令

[[email protected] ~]# rpm -ivh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm

[[email protected] ~]# yum install -y net-tools vim lrzsz tree screenlsof tcpdumpnc mtr nmap

6、安装Docker

[[email protected] ~]# cd /etc/yum.repos.d/

[[email protected] yum.repos.d]# wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

[[email protected] yum.repos.d]# yum install -y docker-ce

[[email protected] yum.repos.d]# systemctl start docker

[[email protected] yum.repos.d]# systemctl enabled docker

7、创建部署目录

[[email protected] ~]# mkdir -p /opt/kubernetes/{cfg,bin,ssl,log} #cfg存放配置文件;bin存放二进制文件;ssl存放证书文件;log存放日志文件。

8、关机---克隆出两台linux-node2、linux-node3并修改主机名、网卡

linux-node2:

[[email protected] ~]# shutdown -h now

[[email protected] ~]# hostnamectl set-hostname linux-node2.example.com #修改主机名

[[email protected] ~]# su -

[[email protected] ~]# hostnamectl

Static hostname: linux-node2.example.com

Icon name: computer-vm

Chassis: vm

Machine ID: 09bb654cb3f7445e9a9abd9dd32b9e2c

Boot ID: 939c901cfa7246dda1e90946ac6f3b08

Virtualization: vmware

Operating System: CentOS Linux 7 (Core)

CPE OS Name: cpe:/o:centos:centos:7

Kernel: Linux 3.10.0-693.el7.x86_64

Architecture: x86-64

[[email protected] ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens32

TYPE=Ethernet

BOOTPROTO=static

NAME=ens32

DEVICE=ens32

ONBOOT=yes

IPADDR=192.168.43.22

NETMASK=255.255.255.0

GATEWAY=192.168.43.2

DNS1=192.168.43.2

linux-node3:

[[email protected] ~]# hostnamectl set-hostname linux-node3.example.com #修改主机名

[[email protected] ~]# su -

[[email protected] ~]# hostnamectl

Static hostname: linux-node3.example.com

Icon name: computer-vm

Chassis: vm

Machine ID: 09bb654cb3f7445e9a9abd9dd32b9e2c

Boot ID: 939c901cfa7246dda1e90946ac6f3b08

Virtualization: vmware

Operating System: CentOS Linux 7 (Core)

CPE OS Name: cpe:/o:centos:centos:7

Kernel: Linux 3.10.0-693.el7.x86_64

Architecture: x86-64

[[email protected] ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens32

TYPE=Ethernet

BOOTPROTO=static

NAME=ens32

DEVICE=ens32

ONBOOT=yes

IPADDR=192.168.43.23

NETMASK=255.255.255.0

GATEWAY=192.168.43.2

DNS1=192.168.43.2

原文地址:https://www.cnblogs.com/xiaoliangxianshen/p/9165423.html

时间: 2024-08-01 05:20:15

Centos7部署kubernetes准备工作(一)的相关文章

CentOS7部署Kubernetes集群

CentOS7部署Kubernetes集群 简介 Kubernetes是什么? Kubernetes一个用于容器集群的自动化部署.扩容以及运维的开源平台. 通过Kubernetes,你可以快速有效地响应用户需求: a.快速而有预期地部署你的应用 b.极速地扩展你的应用 c.无缝对接新的应用功能 d.节省资源,优化硬件资源的使用 我们希望培育出一个组件及工具的生态,帮助大家减轻在公有云及私有云上运行应用的负担. Kubernetes特点: a.可移植: 支持公有云,私有云,混合云,多重云(mult

Centos7部署Kubernetes集群+flannel

centos7 部署Kubernetes+flannel https://www.cnblogs.com/zhenyuyaodidiao/p/6500830.html kubernetes集群部署DashBoard http://www.cnblogs.com/zhenyuyaodidiao/p/6500897.html 原文地址:http://blog.51cto.com/lookingdream/2094162

Centos7部署kubernetes API服务(四)

1.准备软件包 [[email protected] bin]# pwd /usr/local/src/kubernetes/server/bin [[email protected] bin]# cp kube-apiserver kube-controller-manager kube-scheduler /opt/kubernetes/bin/ 2.创建生成CSR的JSON配置文件 [[email protected] bin]# cd /usr/local/src/ssl/ [[emai

CentOS7 部署Kubernetes

一.Installing Docker yum install -y docker systemctl enable docker && systemctl start docker 二.Installing kubeadm, kubelet and kubectl cat <<EOF > /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://packages.cloud

Centos7部署kubernetes集群CA证书创建和分发(二)

1.解压软件包 [[email protected] ~]# cd /usr/local/src/ [[email protected] src]# ls k8s-v1.10.1-manual.zip [[email protected] src]# unzip k8s-v1.10.1-manual.zip [[email protected] src]# cd k8s-v1.10.1-manual [[email protected] k8s-v1.10.1-manual]# cd k8s-v

[转贴]CentOS7.5 Kubernetes V1.13(最新版)二进制部署集群

CentOS7.5 Kubernetes V1.13(最新版)二进制部署集群 http://blog.51cto.com/10880347/2326146 一.概述 kubernetes 1.13 已发布,这是 2018 年年内第四次也是最后一次发布新版本.Kubernetes 1.13 是迄今为止发布间隔最短的版本之一(与上一版本间隔十周),主要关注 Kubernetes 的稳定性与可扩展性,其中存储与集群生命周期相关的三项主要功能已逐步实现普遍可用性. Kubernetes 1.13 的核心

[转帖]centos7 使用kubeadm 快速部署 kubernetes 国内源

centos7 使用kubeadm 快速部署 kubernetes 国内源 https://www.cnblogs.com/qingfeng2010/p/10540832.html 前言 搭建kubernetes时看文档以及资料走了很多弯路,so 整理了最后成功安装的过程已做记录.网上的搭建文章总是少一些步骤,想本人这样的小白总是部署不成功(^_^). 准备两台或两台以上的虚拟机,系统centos7, 本文只准备了两个虚拟机(电脑风扇已转的飞起). 多注意红色加粗的 代码以及文字 ------q

使用Rancher的RKE快速部署Kubernetes集群

简要说明: 本文共涉及3台Ubuntu机器,1台RKE部署机器(192.168.3.161),2台Kubernetes集群机器(3.162和3.163). 先在Windows机器上,将rke_linux-amd64从github上下载下来,重新命名为rke ,编辑好cluster.yml集群部署文件,使用putty提供的pscp命令,将文件上传到3.161机器上.在3.161机器上,执行rke命令,将集群部署到3.162和3.163机器上. 只要环境配置正确,部署非常快,整个集群5分钟搞定. 准

使用kubeadm部署kubernetes集群

使用kubeadm部署kubernetes集群 通过docker,我们可以在单个主机上快速部署各个应用,但是实际的生产环境里,不会单单存在一台主机,这就需要用到docker集群管理工具了,本文将简单介绍使用docker集群管理工具kubernetes进行集群部署. 1 环境规划与准备 本次搭建使用了三台主机,其环境信息如下:| 节点功能 | 主机名 | IP || ------|:------:|-------:|| master | master |192.168.1.11 || slave1