使用 Kubeadm 部署 K8S安装

打印 上一主题 下一主题

主题 559|帖子 559|积分 1677

1. 安装要求

在开始之前,部署Kubernetes集群机器需要满足以下几个条件:

  • 一台或多台机器,操作系统 CentOS7.x-86_x64
  • 硬件配置:2GB或更多RAM,2个CPU或更多CPU,硬盘30GB或更多
  • 可以访问外网,需要拉取镜像,如果服务器不能上网,需要提前下载镜像并导入节点
  • 禁止swap分区
2. 准备环境

角色IPHostNamemaster172.16.3.181k8smasternode1172.16.3.182k8snode1node2172.16.3.183k8snode22.1. 基础配置

[code]# 关闭防火墙[root@localhost ~]# firewall-cmd --state #查看防火墙状态[root@localhost ~]# systemctl stop firewalld     # 停止防火墙的服务[root@localhost ~]# systemctl disable firewalld    # 禁止开机启动# 关闭selinux[root@localhost ~]# setenforce 0  # 临时(当前不用重启)[root@localhost ~]# sed -i 's/enforcing/disabled/' /etc/selinux/config  # 永久(重启后生效)[root@localhost ~]# sestatus -v  # 查看状态(需要重启生效)# 关闭swap[root@localhost ~]# swapoff -a  # 临时[root@localhost ~]# sed -ri 's/.*swap.*/#&/' /etc/fstab    # 永久# 根据规划设置主机名[root@localhost ~]# hostnamectl set-hostname k8smaster  #其它的服务器为 k8snode1,k8snode2# 在master添加hosts[root@localhost ~]# cat >> /etc/hosts  /etc/sysctl.d/k8s.conf  /etc/docker/daemon.json  /etc/yum.repos.d/kubernetes.repo
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

反转基因福娃

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表