当前位置: 首页 > news >正文

RKE部署k8s

移除docker(非必要)

rm -rf /etc/docker
rm -rf /run/docker
rm -rf /var/lib/dockershim
rm -rf /var/lib/docker
yum list installed | grep docker
yum remove ***

rke部署k8s集群

cat > /etc/sysctl.conf << EFO
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EFO
modprobe br_netfilter
sysctl -p
yum-config-manager  --add-repo  http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install -y docker-ce-20.10.9-3.el7
useradd rke && usermod -aG docker rke
./rke_linux-amd64 config --name cluster.yml
./rke_linux-amd64 up

如果需要增加node节点或者etcd节点,只需要更改cluster.yml后rke up --update-only即可
安装kubectl

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

安装成功之后会在当前目录生成kube_config_cluster.yml文件,此为k8s的kube_config文件,需要配置kubectl默认读取文件才可执行kubectl命令进行查询

kubectl --kubeconfig kube_config_cluster.yml get node
yum install -y kubectl
kubectl get node

安装helm

wget https://get.helm.sh/helm-v3.11.3-linux-amd64.tar.gz
cd linux-amd64
cp helm /usr/bin/

新增节点

更改文件并只更新即可
./rke_linux-amd64 up --update-only

安装rancher

helm repo add rancher-latest https://releases.rancher.com/server-charts/latestkubectl create namespace cattle-systemkubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.11.0/cert-manager.crds.yamlhelm repo add jetstack https://charts.jetstack.iohelm repo updatehelm install cert-manager jetstack/cert-manager \--namespace cert-manager \--create-namespace \--version v1.11.0
helm install rancher rancher-latest/rancher \--namespace cattle-system \--set hostname=<IP_OF_LINUX_NODE>.sslip.io \--set replicas=1 \--set bootstrapPassword=<PASSWORD_FOR_RANCHER_ADMIN>

此处密码最少12个字符

FAQ

如果出现错误Error: INSTALLATION FAILED: execution error at (rancher/templates/validate-psp-install.yaml:4:5): The target cluster does not have the PodSecurityPolicy API resource. Please disable PSPs in this chart before proceeding.
则在install的时候加上--set global.cattle.psp.enabled=false选项

FATA[0001] Cluster must have at least one etcd plane host: failed to connect to the following etcd host(s) []

yum update openssh -y
vim /etc/ssh/sshd_configAllowTcpForwarding yes
http://www.lryc.cn/news/404424.html

相关文章:

  • 从0开始的STM32HAL库学习8
  • 微信小程序数组绑定使用案例(一)
  • Kudu节点数规划
  • flutter 充电气泡
  • 【C++】deque以及优先级队列
  • 手机如何播放电脑的声音?
  • 系统架构设计师教程 第3章 信息系统基础知识-3.6 办公自动化系统(OAS)-解读
  • 解决Element UI 表格组件懒加载数据刷新问题
  • 【系统架构设计 每日一问】二 MySql主从复制延迟可能是什么原因,怎么解决
  • Ubuntu Grub引导优化
  • 第3关 -- Git 基础知识
  • AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_xpath‘
  • 题解:小S与机房里的电脑 Computer_C++算法竞赛_贪心_二分答案_模拟_数据结构
  • Python @staticmethod、super().__init__()和self
  • Linux网络:应用层协议HTTP(一)
  • Tomcat底层原理
  • 【Linux】Linux环境设置环境变量操作步骤
  • C语言:键盘录入案例
  • Nginx 中如何实现请求的排队机制?
  • synergy配置
  • Qt开发网络嗅探器03
  • 抖音短视频seo矩阵系统源码开发技术分享(二)--SaaS开源
  • git-常用基础指令
  • Inconsistent Query Results Based on Output Fields Selection in Milvus Dashboard
  • 视觉巡线小车——STM32+OpenMV
  • 升级TrinityCore 服务器硬件
  • NVidia 的 gpu 开源 Linux Kernel Module Driver 编译 安装 使用
  • win7显卡驱动更新后msvcp140.dll丢失的解决方法
  • (11)Python引领金融前沿:投资组合优化实战案例
  • git删除本地远程分支