千家信息网

cento7.6安装kubernetes1.14.1

发表于:2025-02-04 作者:千家信息网编辑
千家信息网最后更新 2025年02月04日,1 .准备:两台虚拟机maste.lab.example.com 192.168.125.142 2cpu 2G 60Gnode.lab.example.com 192.168.125.141 2cp
千家信息网最后更新 2025年02月04日cento7.6安装kubernetes1.14.1

1 .准备:两台虚拟机maste.lab.example.com 192.168.125.142 2cpu 2G 60G
node.lab.example.com 192.168.125.141 2cpu 4G 60G

  1. 更新软件包及源
    更新软件包 yum update -y
    新增源 :cd /etc/yum.repos.d
    mv CentOS-Base.repo CentOS-Base.repo.bak
    curl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/CentOS-Base.repo
    curl -o docker-ce.repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    cat < /etc/yum.repos.d/kubernetes.repo
    [kubernetes]
    name=Kubernetes
    baseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
    enabled=1
    gpgcheck=0
    repo_gpgcheck=0
    gpgkey=http://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg
    http://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
    EOF
    yum clean all && yum makecache
  2. 系统设置
    关闭selinux和firewalld
    setenforce 0
    sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
    systemctl stop firewalld && systemctl disable firewalld
    修改内核参数
    cat < /etc/sysctl.d/k8s.conf
    net.bridge.bridge-nf-call-ip6tables = 1
    net.bridge.bridge-nf-call-iptables = 1
    EOF

sysctl -p
加载内核模块
modprobe br_netfilter
lsmod | grep br_netfilter
禁用swap
swapoff -a
echo "vm.swappiness = 0">> /etc/sysctl.conf
sysctl -p

  1. 安装docker
    yum install docker-ce
    设置镜像加速器(这里我使用了自己个人的阿里云镜像加速,根据个人实际情况来写)
    mkdir -p /etc/docker
    tee /etc/docker/daemon.json <<-'EOF'
    {
    "registry-mirrors": ["https://o9ofxrn0.mirror.aliyuncs.com"]
    }
    EOF
    systemctl daemon-reload
    systemctl restart docker && systemctl enable docker
    1. 加载镜像
      由于国内网络已被墙,我在这里事先吧1.14.1的镜像提供出来
      链接:https://pan.baidu.com/s/1QkRoRHLFJxrQHAuslpFN4Q
      提取码:ovgt
      复制这段内容后打开百度网盘手机App,操作更方便哦
    2. 安装kubeadm、kubelet和kubectl
      yum install -y kubelet kubeadm kubectl
      注:我这里现在yum源中是1.14.1的版本,之后会有更新的版本,如果是更高或者是其他版本,我这里提供的镜像就不能用了。
      kubeadm init --pod-network-cidr=10.244.0.0/16
      跑完上面的init命令后会看到类似如下的输出:
      Your Kubernetes master has initialized successfully!

To start using your cluster, you need to run the following as a regular user:

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
https://kubernetes.io/docs/concepts/cluster-administration/addons/

You can now join any number of machines by running the following on each node
as root:
kubeadm join 192.168.125.142:6443 --token 5fasbl.ctmnsuq04udlb8t2 \
--discovery-token-ca-cert-hash sha256:c7fea93fa4ebcc695a48720fb007185102167bbd7f7ff9d2be178efdee20dad0
接下来你懂的,该怎么做!!!

镜像 版本 更新 个人 内核 软件 软件包 接下来 内容 加速器 参数 命令 实际 情况 手机 模块 系统 网络 链接 面的 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 上海大学网络安全博士怎么样 dell 服务器如何连线电脑 企业网络技术支持与服务 软件开发团队工资是成本吗 ifix组态软件开发价格 腾讯云服务器电脑密码 如何学会计算机软件开发 青海电脑教室管理软件开发 gps监控服务器端软件 高中网络安全手抄报图片大全 网络数据库营销特点 软件开发服务股票 九台区网络安全诚信经营 网络安全基础第六章课后答案 网络安全课程优化建议 重启服务器raid管理没了 关于网络安全方案的设计论文 阿里云能装数据库吗 信息技术与网络安全 审稿 idc服务器租用 增值税 国家电网公司网络安全投入 徐汇漕河泾做软件开发 雄安网络安全研究院 网络安全运营的实训报告 上海易递互联网科技有限公司 本地数据库如何上传服务器 公安部网络安全保卫局王处长 联通网络技术研究院5g中心 江宁区网络技术服务信息推荐 属于网络技术的都有哪些
0