侧边栏壁纸
博主头像
铁永杰的博客 博主等级

行动起来,活在当下

  • 累计撰写 30 篇文章
  • 累计创建 2 个标签
  • 累计收到 1 条评论

目 录CONTENT

文章目录

青云安装k8s和kubesphere

Administrator
2023-09-15 / 0 评论 / 0 点赞 / 143 阅读 / 0 字

青云安装k8s和kubesphere

1.购买服务器

https://console.qingcloud.com/gd2/instances

购买至少两台服务器,一台master节点,一台作为worker节点

参考文档

https://v3-1.docs.kubesphere.io/zh/docs/installing-on-linux/on-premises/install-kubesphere-on-bare-metal/

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.启用商城

安装后启用如下

https://v3-1.docs.kubesphere.io/zh/docs/pluggable-components/app-store/#%E5%9C%A8%E5%AE%89%E8%A3%85%E5%90%8E%E5%90%AF%E7%94%A8%E5%BA%94%E7%94%A8%E5%95%86%E5%BA%97

在**集群管理**-**自定义资源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

直至安装成功,重新启动即可

0

评论区