Skip to content

服务器托管,北京服务器托管,服务器租用-价格及机房咨询

Menu
  • 首页
  • 关于我们
  • 新闻资讯
  • 数据中心
  • 服务器托管
  • 服务器租用
  • 机房租用
  • 支持中心
  • 解决方案
  • 联系我们
Menu

Kubernetes(K8S) kubesphere 安装

Posted on 2023年5月6日 by hackdl

安装KubeSphere最好的方法就是参考官方文档,而且官方文档是中文的。
官网地址:https://kubesphere.com.cn/

https://github.com/kubesphere/kubesphere/blob/master/README_zh.md
Kubernetes(K8S) kubesphere 介绍
安装提前条件:
使用 Kubeadm 部署 Kubernetes(K8S) 安装–附K8S架构图
使用 Kubeadm 部署 Kubernetes(K8S) 安装 — 持久化存储(NFS网络存储)
Kubernetes(K8S) 安装 Metrics-Server

# 检查 K8S 版本,低版本需要升级
[root@k8smaster kubesphere]# kubectl version

安装

[root@k8smaster ~]# cd /opt/k8s/kubesphere
# 创建文件storageclass.yaml
[root@k8smaster kubesphere]# vi storageclass.yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer 

# persistentVolumeClaim.yaml
[root@k8smaster kubesphere]# vi persistentVolumeClaim.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: local-pve
spec:
  accessModes:
     - ReadWriteOnce
  resources:
    requests:
      storage: 20Gi
  storageClassName: local-storage

# 下载核心文件(可以讯雷下载好传到 服务器)
[root@k8smaster kubesphere]# wget https://github.com/kubesphere/ks-installer/releases/download/v3.1.1/kubesphere-installer.yaml
[root@k8smaster kubesphere]# wget https://github.com/kubesphere/ks-installer/releases/download/v3.1.1/cluster-configuration.yaml
[root@k8smaster kubesphere]# ll
总用量 12
-rwxrwxrwx 1 root root 7663 4月  23 09:41 cluster-configuration.yaml
-rwxrwxrwx 1 root root 4064 4月  23 09:41 kubesphere-installer.yaml

# 安装
[root@k8smaster kubesphere]# kubectl apply -f storageclass.yaml
storageclass.storage.k8s.io/local-storage created
[root@k8smaster kubesphere]# kubectl apply -f persistentVolumeClaim.yaml
persistentvolumeclaim/local-pve created

[root@k8smaster kubesphere]# kubectl apply -f kubesphere-installer.yaml
customresourcedefinition.apiextensions.k8s.io/clusterconfigurations.installer.kubesphere.io created
namespace/kubesphere-system created
serviceaccount/ks-installer created
clusterrole.rbac.authorization.k8s.io/ks-installer created
clusterrolebinding.rbac.authorization.k8s.io/ks-installer created
deployment.apps/ks-installer created

[root@k8smaster kubesphere]# kubectl apply -f cluster-configuration.yaml
clusterconfiguration.installer.kubesphere.io/ks-installer created

#解决找不到证书的问题
[root@k8smaster kubesphere]# kubectl -n kubesphere-system create secret generic kube-etcd-client-certs  --from-file=etcd-client-ca.crt=/etc/kubernetes/pki/etcd/ca.crt  --from-file=etcd-client.crt=/etc/kubernetes/pki/apiserver-etcd-client.crt  --from-file=etcd-client.key=/etc/kubernetes/pki/apiserver-etcd-client.key
secret/kube-etcd-client-certs created


# 查看 POD 详情
[root@k8smaster kubesphere]# kubectl describe pod -n kubesphere-system
Events:
  Type    Reason     Age   From               Message
  ----    ------     ----  ----               -------
  Normal  Scheduled  12m   default-scheduler  Successfully assigned kubesphere-system/ks-installer-7bd6b699df-9lnlc to k8snode1
  Normal  Pulling    12m   kubelet            Pulling image "kubesphere/ks-installer:v3.1.1"
  Normal  Pulled     11m   kubelet            Successfully pulled image "kubesphere/ks-installer:v3.1.1"
  Normal  Created    11m   kubelet            Created container installer
  Normal  Started    11m   kubelet            Started container installer
[root@k8smaster kubesphere]#

# 使用命令查看进度
[root@k8smaster kubesphere]# kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f 

如果出现下面错误,需要安装 storageclass、persistentVolumeClaim

TASK [preinstall : KubeSphere | Stopping if default StorageClass was not found] ***
fatal: [localhost]: FAILED! => {
    "assertion": ""(default)" in default_storage_class_check.stdout",
    "changed": false,
    "evaluated_to": false,
    "msg": "Default StorageClass was not found !"
}
# 删除
[root@k8smaster kubesphere]# kubectl delete -f kubesphere-installer.yaml
[root@k8smaster kubesphere]# kubectl delete -f cluster-configuration.yaml
# 安装完 storageclass  后,重新安装
[root@k8smaster kubesphere]# kubectl apply -f storageclass.yaml
[root@k8smaster kubesphere]# kubectl apply -f persistentVolumeClaim.yaml
[root@k8smaster kubesphere]# kubectl apply -f kubesphere-installer.yaml
[root@k8smaster kubesphere]# kubectl apply -f cluster-configuration.yaml

服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.e1idc.net

Related posts:

  1. 一台还是多台?1U服务器托管方式探析
  2. 服务器托管费用详解:多少钱是合理的?
  3. 北京网通idc
  4. 江苏虚拟主机托管:高效、稳定、安全
  5. 高效稳定的万达广场云服务器托管服务

服务器托管,北京服务器托管,服务器租用,机房机柜带宽租用

服务器托管

咨询:董先生

电话13051898268 QQ/微信93663045!

上一篇: 服务器出现了一个新软件,一帮大佬吵起来了!
下一篇: pwnable passcode 10pt

最新更新

  • 管理价值
  • 【每日一题】工作计划的最低难度
  • angular-devkit 中 build-angular 包的作用
  • 使用 ABAP 代码删除指定 SAP CRM 系统里 Opportunity 订单的文本
  • 使用 SAP fiori-tools-proxy 时遇到的错误消息 – invalid version

随机推荐

  • 智慧水利:河湖水库生态流量监测预警系统
  • CS144 计算机网络 Lab1:Stream R
  • 如何为服务器安装SSL证书?
  • 福建网站托管服务器:稳定可靠的服务
  • 服务器托管费用分析与解读

客服咨询

  • 董先生
  • 微信/QQ:93663045
  • 电话:13051898268
  • 邮箱:dongli@hhisp.com
  • 地址:北京市石景山区重聚园甲18号2层

友情链接

  • 服务器托管
  • 服务器租用
  • 机房租用托管
  • 服务器租用托管
©2023 服务器托管,北京服务器托管,服务器租用-价格及机房咨询 京ICP备13047091号-8