资讯专栏INFORMATION COLUMN

【边玩边学K8S】【001】环境准备

baoxl / 491人阅读

摘要:环境准备虚拟机主机名角色虚拟机需要和外网通信,需要配置配置主机名配置网络代理有条件可选用户名密码代理端口用户名密码代理端口可选,如果访问外网需要代理请正确填写用户名密码代理和端口,追加以上内容到,执行命令使其生效配置代理有条件可选追加上一步

环境准备 虚拟机
主机名 IP OS 角色
host01 192.168.31.63 CentOS 7 Master & Node
虚拟机需要和外网通信,需要配置EIP
配置主机名
[root@host01 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.31.63 host01
配置网络代理(有条件可选)
export http_proxy="http://用户名:密码@代理IP:端口"
export https_proxy="https://用户名:密码@代理IP:端口"
export NO_PROXY="127.0.0.1,localhost"
可选,如果访问外网需要代理请正确填写用户名、密码、代理IP和端口,追加以上内容到/root/.bashrc,执行命令使其生效
[root@host01 ~]# source /root/.bashrc
配置Yum代理(有条件可选)

追加上一步代理配置内容到/etc/yum.conf

关闭防火墙
[root@host01 ~]# systemctl stop firewalld
[root@host01 ~]# systemctl disable firewalld
禁用SELINUX
[root@host01 ~]# cat /etc/selinux/config | grep SELINUX=
# SELINUX=disabled
SELINUX=disabled
[root@host01 ~]# setenforce 0
确保SELINUX=disabled
配置系统项
[root@host01 ~]# cat /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
vm.swappiness=0
[root@host01 ~]# sysctl -p /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
vm.swappiness = 0
新建/etc/sysctl.d/k8s.conf并追加相应内容
关闭SWAP
[root@host01 ~]# swapoff -a

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/32697.html

相关文章

  • 边玩边学K8S】【002】安装Docker

    安装Docker 安装 [root@host01 ~]# yum makecache [root@host01 ~]# yum install docker [root@host01 ~]# yum install golang 启动 [root@host01 ~]# systemctl enable docker [root@host01 ~]# systemctl start docker [...

    Lowky 评论0 收藏0
  • 边玩边学K8S】【002】安装Docker

    安装Docker 安装 [root@host01 ~]# yum makecache [root@host01 ~]# yum install docker [root@host01 ~]# yum install golang 启动 [root@host01 ~]# systemctl enable docker [root@host01 ~]# systemctl start docker [...

    trilever 评论0 收藏0
  • 慕课网_《Java模板引擎之Freemarker》学习总结

    摘要:时间年月日星期日说明本文部分内容均来自慕课网。整体目录结构如下项目文件用于数据持久化配置项目配置配置视图解析器配置静态资源映射配置配置配置自定义指令配置解析器配置,类似于项目启动类新建,注册配置类,并将其和当前关联。 时间:2017年3月19日星期日说明:本文部分内容均来自慕课网。@慕课网:http://www.imooc.com教学示例源码:无个人学习源码:https://githu...

    xumenger 评论0 收藏0
  • Nuxt 3 即将发布、layui 即将退出历史舞台 | 淘系前端架构周刊 210927 期

    摘要:即将发布经过漫长的等待,即将发布。是一款很不错的组件库,虽然在的下载量仍远高于,但不可否认的是在生态和社区活跃度上,更胜一筹。 .markdown-body{word-break:break-word;line-height:1.75;font-weight:400;font-size:15px;overflow-x:hidden;color:#333}.markdown-body h1,...

    NusterCache 评论0 收藏0

发表评论

0条评论

最新活动
阅读需要支付1元查看
<