首页 > 其他分享 >k8s集群安装KubeSphere3.0

k8s集群安装KubeSphere3.0

时间:2023-12-18 10:00:57浏览次数:44  
标签:kube kubesphere controller system ks Running 集群 KubeSphere3.0 k8s

架构:

k8s集群安装KubeSphere3.0_无法登录

前提条件:
k8s集群版本必须是1.15.x, 1.16.x, 1.17.x, or 1.18.x
必须有默认的storageclass
内存和cpu最低要求:CPU > 1 Core, Memory > 2 G

安装并设置默认storageclass略过,可以看之前的我发过的博客

1.安装yaml文件 (先安装第一个,再安装第二个)

kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/kubesphere-installer.yaml
   
kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/cluster-configuration.yaml

2.查看安装日志 (其实不看日志也行,只要所有pod都是running状态就行,如果网络慢,可能就慢点。)

kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f

3.查看所有pod

kubectl get pods -A
NAMESPACE                      NAME                                               READY   STATUS    RESTARTS   AGE
default                        nfs-client-provisioner-6d4469b5b5-bh6t9            1/1     Running   0          31m
kube-system                    coredns-66bff467f8-rkb9n                           1/1     Running   0          73m
kube-system                    coredns-66bff467f8-rtbnt                           1/1     Running   0          73m
kube-system                    etcd-master1                                       1/1     Running   0          74m
kube-system                    etcd-master2                                       1/1     Running   0          66m
kube-system                    etcd-master3                                       1/1     Running   0          65m
kube-system                    kube-apiserver-master1                             1/1     Running   0          74m
kube-system                    kube-apiserver-master2                             1/1     Running   0          67m
kube-system                    kube-apiserver-master3                             1/1     Running   1          64m
kube-system                    kube-controller-manager-master1                    1/1     Running   1          74m
kube-system                    kube-controller-manager-master2                    1/1     Running   0          67m
kube-system                    kube-controller-manager-master3                    1/1     Running   0          65m
kube-system                    kube-flannel-ds-6hnzh                              1/1     Running   0          64m
kube-system                    kube-flannel-ds-88kl4                              1/1     Running   0          64m
kube-system                    kube-flannel-ds-p79jk                              1/1     Running   0          64m
kube-system                    kube-flannel-ds-vkbjw                              1/1     Running   0          64m
kube-system                    kube-proxy-9bjb5                                   1/1     Running   0          73m
kube-system                    kube-proxy-9smdl                                   1/1     Running   0          67m
kube-system                    kube-proxy-hdgrp                                   1/1     Running   0          66m
kube-system                    kube-proxy-vxm96                                   1/1     Running   0          65m
kube-system                    kube-scheduler-master1                             1/1     Running   1          74m
kube-system                    kube-scheduler-master2                             1/1     Running   0          67m
kube-system                    kube-scheduler-master3                             1/1     Running   0          65m
kube-system                    snapshot-controller-0                              1/1     Running   0          18m
kubesphere-controls-system     default-http-backend-857d7b6856-jpdfk              1/1     Running   0          18m
kubesphere-controls-system     kubectl-admin-58f985d8f6-b6v8d                     1/1     Running   0          10m
kubesphere-monitoring-system   alertmanager-main-0                                2/2     Running   0          15m
kubesphere-monitoring-system   alertmanager-main-1                                2/2     Running   0          15m
kubesphere-monitoring-system   alertmanager-main-2                                2/2     Running   0          15m
kubesphere-monitoring-system   kube-state-metrics-95c974544-qxvmn                 3/3     Running   0          16m
kubesphere-monitoring-system   node-exporter-6rsh2                                2/2     Running   0          16m
kubesphere-monitoring-system   node-exporter-fzccb                                2/2     Running   0          16m
kubesphere-monitoring-system   node-exporter-jjw99                                2/2     Running   0          16m
kubesphere-monitoring-system   node-exporter-lnk9f                                2/2     Running   0          16m
kubesphere-monitoring-system   notification-manager-deployment-7c8df68d94-r2rrf   1/1     Running   0          3m57s
kubesphere-monitoring-system   notification-manager-deployment-7c8df68d94-wzv5h   1/1     Running   0          3m57s
kubesphere-monitoring-system   notification-manager-operator-6958786cd6-msgn7     2/2     Running   0          16m
kubesphere-monitoring-system   prometheus-k8s-0                                   3/3     Running   1          15m
kubesphere-monitoring-system   prometheus-k8s-1                                   0/3     Pending   0          15m
kubesphere-monitoring-system   prometheus-operator-84d58bf775-q7h5h               2/2     Running   0          16m
kubesphere-system              ks-apiserver-7769cf4cd9-95rwh                      1/1     Running   0          9m32s
kubesphere-system              ks-apiserver-7769cf4cd9-v5k6q                      1/1     Running   0          13m
kubesphere-system              ks-apiserver-7769cf4cd9-zpnk2                      1/1     Running   0          16m
kubesphere-system              ks-console-786b9846d4-6g6rm                        1/1     Running   0          17m
kubesphere-system              ks-console-786b9846d4-ctqqc                        1/1     Running   0          17m
kubesphere-system              ks-console-786b9846d4-grrcx                        1/1     Running   0          17m
kubesphere-system              ks-controller-manager-7b4b88b75-2lhv4              1/1     Running   0          16m
kubesphere-system              ks-controller-manager-7b4b88b75-7h57t              1/1     Running   0          8m50s
kubesphere-system              ks-controller-manager-7b4b88b75-xncc9              1/1     Running   0          4m26s
kubesphere-system              ks-installer-7cb866bd-c9v9t                        1/1     Running   0          19m
kubesphere-system              openldap-0                                         1/1     Running   0          18m
kubesphere-system              openldap-1                                         1/1     Running   0          11m
kubesphere-system              redis-ha-haproxy-5c6559d588-78xlz                  1/1     Running   4          18m
kubesphere-system              redis-ha-haproxy-5c6559d588-qcrtf                  1/1     Running   4          18m
kubesphere-system              redis-ha-haproxy-5c6559d588-vxhkg                  1/1     Running   5          18m
kubesphere-system              redis-ha-server-0                                  2/2     Running   0          18m
kubesphere-system              redis-ha-server-1                                  2/2     Running   0          14m
kubesphere-system              redis-ha-server-2                                  2/2     Running   0          10m

4.登陆kubesphere

ip:30880

用户名:admin

默认密码:P@88w0rd

k8s集群安装KubeSphere3.0_github_02

5、如果提示account is not active执行下面命令即可解决问题

k8s集群安装KubeSphere3.0_无法登录_03

kubectl apply -f https://raw.githubusercontent.com/kubesphere/ks-installer/2c4b479ec65110f7910f913734b3d069409d72a8/roles/ks-core/prepare/files/ks-init/users.iam.kubesphere.io.yaml

kubectl apply -f https://raw.githubusercontent.com/kubesphere/ks-installer/2c4b479ec65110f7910f913734b3d069409d72a8/roles/ks-core/prepare/files/ks-init/webhook-secret.yaml

kubectl -n kubesphere-system rollout restart deploy ks-controller-manager

详解:
1、kubesphere 安装完成后会创建默认账户admin/P@88w0rd,待ks-controller-manager启动就绪,user controller 会将 user CRD中定义的password加密,user会被转换为active状态,至此账户才可以正常登录。

2、当安装完成后遇到默认账户无法登录,看到account is not active相关错误提示时,需要检查ks-controller-manager的运行状态和日志。

存储、网络问题:
1、user controller 依赖的外部服务有openldap和jenkins,在依赖服务不正常的情况下controller会一直reconcile,user CRD状态无法正常维护,导致账户无法登录。

2、可以通过 ks-controller-manager 日志和查询pod运行状态查找问题。

经常出现的错误:存储配置错误、数据丢失、集群网络不通。

标签:kube,kubesphere,controller,system,ks,Running,集群,KubeSphere3.0,k8s
From: https://blog.51cto.com/u_14620403/8868261

相关文章

  • k8s基于NFS部署storageclass实现pv并标记为一个默认的StorageClass
    架构:一.搭建storageclass1、master和node节点安装nfs服务yum-yinstallnfs-utilsrpcbind2、启动nfs并设为开机自启:systemctlstartnfs&&systemctlenablenfssystemctlstartrpcbind&&systemctlenablerpcbind3、master节点创建共享挂载目录(客户端不需要创建共享目录......
  • 理解K8S的CRD
    CRD本身是Kubernetes内置的资源类型,全称是CustomResourceDefinition,可以通过命令查看,kubectlget查看集群内定义的CRD资源。NAMECREATEDATapps.app.o0w0o.cn2019-07-25T07:02:47Zmicroservices.app.o0w0o.cn2019-07-25T07:02:47Z在与人......
  • k8s集群安装
    在三台机器上都执行如下命令操作:1、关闭防火墙systemctlstopfirewalldsystemctldisablefirewalld2、关闭selinuxsed-i's/enforceing/disabled/'/etc/selinux/config#永久关闭setenforce0#临时关闭3、关闭swapswapoff-a#临时关闭vim/etc/fst......
  • K8s - 容器编排引擎Kubernetes
     什么是Kubernetes?背景Kubernetes是开源的容器集群管理项目,诞生于2014年,由Google公司发起前身Borg系统在Google内部应用了十几年,积累了大量来自生产环境的实践经验试图为基于容器的应用部署和管理打造一套强大并且易用的管理平台该项目基于Go语言实现介绍一个基于容......
  • k8s labels过滤实现
    k8sv1.19.0staging\src\k8s.io\apiserver\pkg\registry\generic\registry\store.goList方法staging\src\k8s.io\apiserver\pkg\storage\etcd3\store.goList方法staging\src\k8s.io\apiserver\pkg\storage\etcd3\store.goappendListItem函数......
  • helm部署Kafka集群
    1.准备文件1.1.创建命令空间kubectlcreatenskafka1.1.helm包拉取本地#添加bitnami仓库helmrepoaddbitnamihttps://charts.bitnami.com/bitnami#查询charthelmsearchrepobitnami#拉取zookeeperhelmpullbitnami/zookeeper#解压tarzxvfzookeeper-12.0.......
  • SQL Server 2019 非域&非集群环境创建Always On “只读扩展”
     SQLServer2019开始支持“read-scaleforanAlwaysOnavailabilitygroup”,中文翻译的很别扭,是"读取缩放",繁体版翻译为“读取级别”,其特点不依赖于windows的cluster集群以及域,简化了搭建操作步骤和前置条件,与传统的availabilitygroups类似,缺点是无法实现自动故障转移,本质......
  • Storm 集群的搭建及其Java编程进行简单统计计算
    一、Storm集群构建编写storm与zookeeper的yml文件 stormyml文件的编写具体如下:version:'2'services:zookeeper1:image:registry.aliyuncs.com/denverdino/zookeeper:3.4.8container_name:zk1.cloudenvironment:-SERVER_ID=1......
  • MongoDB中的分布式集群架构
    MongoDB中的分布式集群架构前言ReplicaSet副本集模式副本集写和读的特性Sharding分片模式分片的优势MongoDB分片的组件分片键chunk是什么分片的算法哈希分片范围分片总结参考MongoDB中的分布式集群架构前言前面我们了解了MongoDB中的索引,......
  • k8s报错合集
    底层网络沙箱容器pause无法下载报错#如出现报错,是因为底层沙箱容器pause无法下载导致出现的问题Events:TypeReasonAgeFromMessage---------------------......