青云安装k8s和kubesphere
1.购买服务器
https://console.qingcloud.com/gd2/instances
购买至少两台服务器,一台master节点,一台作为worker节点
参考文档
2.安装所需要的依赖
yum install conntrack-toolsy
3. 下载KubeKey
# 使用下面命令下载
curl -sfL https://get-kk.kubesphere.io | VERSION=v1.1.1 sh -
注:执行以上命令会下载最新版 KubeKey (v1.1.1),您可以修改命令中的版本号下载指定版本。
为 kk
文件添加可执行权限。
chmod +x kk
2.更改hostname
hostnamectl set-hostname master1
hostnamectl set-hostname worker1
hostnamectl set-hostname worker2
查看hostname
hostname
## 4.安装kubernetes
1.安装kubernetes
./kk create cluster -f config-sample.yaml
config-sample.yaml文档
apiVersion: kubekey.kubesphere.io/v1alpha1
kind: Cluster
metadata:
name: config-sample
spec:
hosts:
- {name: master1, address: 139.198.116.77, internalAddress: 10.190.7.125, user: root, password: Tie951028.}
- {name: worker1, address: 139.198.117.84, internalAddress: 10.190.0.233, user: root, password: Tie951028.}
roleGroups:
etcd:
- master1
master:
- master1
worker:
- worker1
controlPlaneEndpoint:
domain: lb.kubesphere.local
address: ""
port: 6443
2.安装kubesphere
./kk create cluster --with-kubesphere v3.1.1
## 5.启用商城
安装后启用如下
在**集群管理**-**自定义资源crd**-搜素**clusterconfiguration**,编辑配置文件,打开应用商城
openpitrix:
store:
enabled: true # 默认False,这里更改为True
使用下列命令检查安装过程
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f
直至安装成功,重新启动即可
评论区