K8s学习-day1虚拟环境准备

Kubernetes  官网: Kubernetes 是什么? | Kubernetes

Kubernetes 是一个可移植的、可扩展的开源平台,用于管理容器化的工作负载和服务,可促进声明式配置和自动化。 Kubernetes 拥有一个庞大且快速增长的生态系统。Kubernetes 的服务、支持和工具广泛可用。

准备:

安装Centos

root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
hostnamectl --static set-hostname  k8s-master

修改配置文件:/etc/sysconfig/network-scripts/ifcfg-ens33     no改成yes

 service network restart

使用阿里云的源替换

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum makecache

关闭防火墙,防止开机自启动

systemctl stop firewalld & systemctl disable firewalld
systemctl stop iptables  & systemctl disable iptables
sed -i 's/enforcing/disabled/' /etc/selinux/config
setenforce 0

关闭防火墙后,外部请求方可到达虚拟机

此外还需要关闭Swap内存交互机制,注释掉最后一行

vim /etc/fstab

​​​​​​​ 

yum install docker-ce -y

 启动docker并设置开机自启动

systemctl start docker & systemctl enable docker

cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF

setenforce 0 

参考:

Kubernetes核心原理和搭建 - 哔哩哔哩

Centos7使用yum方式部署Kubernetes1.5集群_菲宇运维-CSDN博客

centos 密钥登陆 - 菜鸟web - 博客园

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值