kubesphere一键部署k8s

目录

一、一键部署k8s(国内源)

二、 补充信息


一、一键部署k8s(国内源)

kubesphere官网: https://kubesphere.com.cn/docs/v3.3/quick-start/all-in-one-on-linux/

根据kubesphere官网说明一键部署k8s

1、创建一键部署k8s 安装脚本install-k8s.sh (复制粘贴脚本即可,不需要修改脚本内容)

cat > install-k8s.sh << eof

#!/bin/bash
# centos 7 阿里云yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all && yum makecache

# 设置中国时间
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

# 使用国内原安装
export KKZONE=cn

# 安装必须依赖
yum install -y socat conntrack 

# 下载可选依赖
# yum install -y ebtables ipset ipvsadm openssl chrony  nfs-utils

# 下载 kubekey
curl -sfL https://get-kk.kubesphere.io | VERSION=v2.3.0 sh -

chmod +x kk

# 安装 Kubernetes 和 KubeSphere,
# 若不指定 with-kubernetes 参数,则默认安装支持的最新版本kubernetes
# 若不指定 with-kubesphere 参数,则不安装 kubesphere 
# 若需要安装 local PV provisioner ,则需要指定参数: --with-local-storage
# ./kk create cluster --with-kubernetes v1.22.12 --with-kubesphere v3.3.1 --with-local-storage
# ./kk create cluster  --with-kubesphere v3.3.1


# 安装 Kubernetes
./kk create cluster --yes --with-local-storage


########################################################################################
# ./kk create cluster --with-kubernetes v1.22.12 --with-kubesphere v3.3.1
# kubectl logs -n kubesphere-system \$(kubectl get pod -n kubesphere-system -l 'app in (ks-install, ks-installer)' -o jsonpath='{.items[0].metadata.name}') -f

# 输出信息会显示 Web 控制台的 IP 地址和端口号,默认的 NodePort 是 30880。现在,您可以使用默认的帐户和密码 (admin/P@88w0rd) 通过 <NodeIP>:30880 访问控制台

########################################################################################

# 卸载 kubernetes 集群
# ./kk delete cluster

eof


2、执行安装脚本,等待安装完成即可(可能需要30到60分钟左右,实际情况以网速快慢为准)

## 脚本授权 并执行脚本
 chmod a+x install-k8s.sh

./install-k8s.sh

二、 补充信息

1、阿里云yum源参考地址:

https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.64d91b11EdqWEF

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

2、 yum源安装docker

docker yum源 参考地址:

https://developer.aliyun.com/mirror/docker-ce?spm=a2c6h.13651102.0.0.655e1b111jDTj7

  • 1
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值