Kubernetes/部署文档/Kubeadm/Kubeadm初始化安装Kubernetes节点.md
offends 7a2f41e7d6
All checks were successful
continuous-integration/drone Build is passing
synchronization
2024-08-07 18:54:39 +08:00

36 lines
1016 B
Markdown

> 本文作者:丁辉
## Kubeadm初始化安装Kubernetes节点
1. Kubernetes安装
```bash
kubeadm init \
--image-repository=registry.aliyuncs.com/google_containers \
--apiserver-advertise-address=192.168.1.10 \
--pod-network-cidr=10.244.0.0/16 \
--service-cidr=10.96.0.0/12
```
2. 根据提示配置文件
```bash
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
export KUBECONFIG=/etc/kubernetes/admin.conf
```
> 永久生效
>
> ```bash
> echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile
> source ~/.bash_profile
> ```
3. 安装网络插件
请跳转此文档
- [Flannel网络插件安装](https://gitee.com/offends/Kubernetes/blob/main/部署文档/网络插件安装/Flannel网络插件安装.md)
- [Calico网络插件安装](https://gitee.com/offends/Kubernetes/blob/main/部署文档/网络插件安装/Calico网络插件安装.md)