centos7 --kubeadm安装

本文详细介绍了在多种操作系统上部署Kubernetes集群的步骤,包括Ubuntu、Debian、CentOS等,强调了硬件需求如2GB RAM和2个CPU,网络连接及端口开放的重要性。提供了关闭SELinux、添加Google repo源、安装kubelet、kubeadm和kubectl的方法,并解释了如何配置网络桥接和禁用交换分区。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

One or more machines running one of:
Ubuntu 16.04+
Debian 9
CentOS 7
RHEL 7
Fedora 25/26 (best-effort)
HypriotOS v1.0.1+
Container Linux (tested with 1800.6.0)
内存:2 GB or more of RAM per machine (any less will leave little room for your apps)
cpu:2 CPUs or more
网络:Full network connectivity between all machines in the cluster (public or private network is fine)
独立:Unique hostname, MAC address, and product_uuid for every node. ip link or ifconfig -a ,cat /sys/class/dmi/id/product_uuid
端口开放:Certain ports are open on your machines. See here for more details.
swap:Swap disabled. You MUST disable swap in order for the kubelet to work properly

一、基础配置

#添加google repo源,要FQ。
cat <<EOF > /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg exclude=kube* EOF #关闭selinux setenforce 0 sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config systemctl enable --now kubelet

 

二、安装kubelt  kubeadm kubectl

yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes

 

三、启动

systemctl enable --now kubelet

 

其他

#如果防火墙启动的话,可能需要开启下面:
cat <<EOF > /etc/sysctl.d/k8s.conf net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 EOF sysctl --system

 

转载于:https://www.cnblogs.com/kevincaptain/p/10454817.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值