Loading

kubernetes基础环境配置

一、基础环境配置

环境详情

主机名(FQDN) IP地址(NAT) 描述
linux-node1.example.com eth0:192.168.56.11 1VCPU、2G内存、一块硬盘s da50G(动态扩展)
linux-node2.example.com eth0:192.168.56.12 1VCPU、2G内存、一块硬盘s da50G(动态扩展)
linux-node3.example.com eth0:192.168.56.13 1VCPU、2G内存、一块硬盘s da50G(动态扩展)
备注

1.安装的时候将网卡命名为 eth0 

 

环境准备

  • 安装操作系统CentOS-7.x-x86_64。
  • 基本系统:1VCPU+2048M内存+50G(动态)硬盘。

    1. 网络选择:使用网络地址转换(NAT)。

    2. 软件包选择:Minimal Install。
    3. 关闭 iptables 和 SELinux。

  • 设置所有节点的主机名和IP地址,使用/etc/hosts做好主机名解析。 

环境准备

下载系统镜像:可以在阿里云镜像站点下载 CentOS 镜像:https://mirrors.aliyun.com/centos/ 

创建虚拟机点击连接查看:https://www.cnblogs.com/hwlong/p/9105227.html

二、系统配置

网卡配置

[root@linux-node1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
HWADDR=00:0C:29:CA:80:0D
BOOTPROTO=static
NAME=eth0
ONBOOT=yes
IPADDR=192.168.56.11
NETMASK=255.255.255.0
GATEWAY=192.168.56.2

重启网络服务

[root@linux-node1 ~]# systemctl restart network

关闭NetworkManager和防火墙开机自启动

[root@linux-node1 ~]# systemctl disable firewalld
[root@linux-node1 ~]# systemctl disable NetworkManager

设置主机名

[root@linux-node1 ~]# vi /etc/hostname
linux-node1.example.com

 设置主机名解析

[root@linux-node1 ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.56.11 linux-node1 linux-node1.example.com
192.168.56.12 linux-node2 linux-node2.example.com
192.168.56.13 linux-node3 linux-node3.example.com

设置DNS解析

[root@linux-node1 ~]# vi /etc/resolv.conf
nameserver 192.168.56.2

安装EPEL仓库和常用命令

[root@linux-node1 ~]# rpm -ivh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm
[root@linux-node1 ~]# yum -y install net-tools vim lrzsz tree screen lsof tcpdump nc mtr nmap wget unzip

关闭并确认SELinux处于关闭状态

[root@linux-node1 ~]# vim /etc/sysconfig/selinux 
SELINUX=disabled #修改为 disabled

关机

[root@linux-node1 ~]# reboot

三、建议给虚拟机做快照

 

posted @ 2018-05-28 18:36  KubeSec  阅读(814)  评论(0编辑  收藏  举报