单机 KubeSphere v3.0的安装

2024-04-09 07:08
文章标签 安装 kubesphere 单机 v3.0

本文主要是介绍单机 KubeSphere v3.0的安装,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

单机 KubeSphere v3.0的安装

我是在虚拟机环境中安装的,4C、32G、120GB
注意:平台之间依赖厂家经过测试的版本,千万不要选择未经测试的版本,否则会卡在哪里得不到解决。
选择CentOS 7.7 + docker 19.3.14 + kubernetes 1.18.6 + kubesphere 3.0.0

0、安装虚拟机

VMware workstations

1、安装Linux

CentOS 7.7,最小安装,然后配置网卡

2、安装Docker

参考如下,贴子很多

systemctl disable firewalld
systemctl status firewalld
sed -i 's/enforcing/disabled/' /etc/selinux/config
setenforce 0
cat /etc/selinux/config
swapoff -a
sed -ri 's/.*swap.*/#&/' /etc/fstab
free -l -h
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
echo "net.bridge.bridge-nf-call-ip6tables = 1" >> /etc/sysctl.conf
echo "net.bridge.bridge-nf-call-iptables = 1" >> /etc/sysctl.conf
echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf
echo "net.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf
echo "net.ipv6.conf.all.forwarding = 1"  >> /etc/sysctl.conf
sysctl -p
yum remove docker \docker-client \docker-client-latest \docker-common \docker-latest \docker-latest-logrotate \docker-logrotate \docker-engine
yum install -y yum-utils \device-mapper-persistent-data \lvm2
yum-config-manager \--add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repoyum install -y docker-ce-19.03.14 docker-ce-cli-19.03.14 containerd.io
systemctl enable docker
systemctl start docker
docker version

3、安装KubeSphere

export KKZONE=cn
curl -sfL https://get-kk.kubesphere.io | VERSION=v1.0.1 sh -

Downloading kubekey v1.0.1 from https://kubernetes.pek3b.qingstor.com/kubekey/releases/download/v1.0.1/kubekey-v1.0.1-linux-amd64.tar.gz …

Kubekey v1.0.1 Download Complete!

chmod +x kk
docker version
yum install -y socat conntrack

保证如下组件安装了:sudo curl openssl ebtables socat ipset conntrack docker,务必在开始下面命令前安装完这些相关必要的组件

./kk create cluster --with-kubernetes v1.18.6 --with-kubesphere v3.0.0

下面为这个命令的输出:
Continue this installation? [yes/no]: yes
INFO[13:04:49 CST] Downloading Installation Files
INFO[13:04:49 CST] Downloading kubeadm …
INFO[13:04:50 CST] Downloading kubelet …
INFO[13:04:51 CST] Downloading kubectl …
INFO[13:04:51 CST] Downloading helm …
INFO[13:04:51 CST] Downloading kubecni …
INFO[13:04:52 CST] Configurating operating system …

INFO[13:04:55 CST] Installing docker …
INFO[13:04:55 CST] Start to download images on all nodes
[k8s-kubesphere] Downloading image: kubesphere/etcd:v3.3.12
[k8s-kubesphere] Downloading image: kubesphere/pause:3.2

[k8s-kubesphere] Downloading image: coredns/coredns:1.6.9
[k8s-kubesphere] Downloading image: kubesphere/k8s-dns-node-cache:1.15.12
[k8s-kubesphere] Downloading image: calico/kube-controllers:v3.15.1

[k8s-kubesphere] Downloading image: calico/pod2daemon-flexvol:v3.15.1

Your Kubernetes control-plane has initialized successfully!

To start using your cluster, you need to run the following as a regular user:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown ( i d − u ) : (id -u): (idu):(id -g) $HOME/.kube/config

You should now deploy a pod network to the cluster.
Run “kubectl apply -f [podnetwork].yaml” with one of the options listed at:
https://kubernetes.io/docs/concepts/cluster-administration/addons/

You can now join any number of control-plane nodes by copying certificate authorities
and service account keys on each node and then running the following as root:
kubeadm join lb.kubesphere.local:6443 --token 7n691x.e88u2nmc7cy99plj
–discovery-token-ca-cert-hash sha256:f535950e23fbc39e1956e6f4c5ccecd29a9ffd1d432d2f157cbaad5bbdd873a8
–control-plane

Then you can join any number of worker nodes by running the following on each as root:
kubeadm join lb.kubesphere.local:6443 --token 7n691x.e88u2nmc7cy99plj
–discovery-token-ca-cert-hash sha256:f535950e23fbc39e1956e6f4c5ccecd29a9ffd1d432d2f157cbaad5bbdd873a8

NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
k8s-kubesphere NotReady master,worker 46s v1.18.6 8.1.3.151 CentOS Linux 7 (Core) 3.10.0-1062.el7.x86_64 docker://19.3.14
INFO[13:08:48 CST] Deploying KubeSphere …
v3.0.0

INFO[13:14:29 CST] Installation is complete.
注意:到这里基本是安装完成了,如果出错就从头排查,建议做好虚拟机的备份,以便知道改动了哪里!!!

Please check the result using the command:
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath=’{.items[0].metadata.name}’) -f

4、验证安装是否正常

执行下面命令

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

应该输出:

#####################################################
###              Welcome to KubeSphere!           ###
#####################################################Console: http://8.1.3.151:30880
Account: admin
Password: P@88w0rdNOTES:1. After logging into the console, please check themonitoring status of service components inthe "Cluster Management". If any service is notready, please wait patiently until all components are ready.2. Please modify the default password after login.#####################################################
https://kubesphere.io             2021-01-14 08:20:51
#####################################################

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

5、出现错误的情况

安装完成后,我都是重启了两遍虚拟机,然后才全部正常的

最常见的就是下载组件pod等时网络不通或者速度过慢,导致失败
一般就是反复尝试并切换到国内的镜像源上。

部署Kubernetes时出现ImagePullBackOff或ErrImagePull情况

参考:https://blog.csdn.net/lin_yx/article/details/111599937

第一步:查看那些pod不正常
kubectl get pod --all-namespaces

#kubectl get pod --all-namespaces
NAMESPACE                      NAME                                               READY   STATUS    RESTARTS   AGE
kube-system                    calico-kube-controllers-578894d4cd-jdsmt           1/1     Running   2          20h
kube-system                    calico-node-gpvlx                                  1/1     Running   2          20h
kube-system                    coredns-6b55b6764d-84mxp                           1/1     Running   2          20h
kube-system                    coredns-6b55b6764d-k6bzr                           1/1     Running   2          20h
kube-system                    kube-apiserver-k8s-kubesphere                      1/1     Running   2          20h
kube-system                    kube-controller-manager-k8s-kubesphere             1/1     Running   2          20h
kube-system                    kube-proxy-f7wrb                                   1/1     Running   4          20h
kube-system                    kube-scheduler-k8s-kubesphere                      1/1     Running   2          20h
kube-system                    metrics-server-f47758d8f-rswq5                     1/1     Running   2          18h
kube-system                    nodelocaldns-tfrlx                                 1/1     Running   2          20h
kube-system                    openebs-localpv-provisioner-84446d4bd7-b4hft       1/1     Running   1          20h
kube-system                    openebs-ndm-l9cp7                                  1/1     Running   3          20h
kube-system                    openebs-ndm-operator-6456dc9db-w2d6w               1/1     Running   2          20h
kube-system                    snapshot-controller-0                              1/1     Running   1          18h
kubesphere-controls-system     default-http-backend-857d7b6856-g8ljk              1/1     Running   1          18h
kubesphere-controls-system     kubectl-admin-58f985d8f6-jsshk                     1/1     Running   1          17h
kubesphere-monitoring-system   alertmanager-main-0                                2/2     Running   2          18h
kubesphere-monitoring-system   kube-state-metrics-95c974544-nw6vw                 3/3     Running   3          18h
kubesphere-monitoring-system   node-exporter-29zwp                                2/2     Running   2          18h
kubesphere-monitoring-system   notification-manager-deployment-7c8df68d94-6mk8m   1/1     Running   1          17h
kubesphere-monitoring-system   notification-manager-operator-6958786cd6-5hphl     2/2     Running   2          18h
kubesphere-monitoring-system   prometheus-k8s-0                                   3/3     Running   4          18h
kubesphere-monitoring-system   prometheus-operator-84d58bf775-kz29n               2/2     Running   2          18h
kubesphere-system              ks-apiserver-67c5fcfc66-xdlnw                      1/1     Running   0          91m
kubesphere-system              ks-console-b4df86d6f-vc8bl                         1/1     Running   1          18h
kubesphere-system              ks-controller-manager-57b966f8f4-b2p72             1/1     Running   0          91m
kubesphere-system              ks-installer-7cb866bd-bsfrt                        1/1     Running   1          20h
kubesphere-system              openldap-0                                         1/1     Running   1          18h
kubesphere-system              redis-644bc597b9-5kzsp                             1/1     Running   1          18h

kubectl get pods -n kube-system
第二步:查看这些不正常pod的原因
kubectl describe kubesphere-system/xxxxx --namespace kube-system
注意:一定要加上命名空间
第三步:手动下载pod,那个有问题就下载那个,一定要加上版本
docker pull kubesphere/xxxxx,卡在哪就下哪个,而且下载用describe看到的版本

这篇关于单机 KubeSphere v3.0的安装的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/887496

相关文章

MySQL9.0默认路径安装下重置root密码

《MySQL9.0默认路径安装下重置root密码》本文主要介绍了MySQL9.0默认路径安装下重置root密码,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们... 目录问题描述环境描述解决方法正常模式下修改密码报错原因问题描述mysqlChina编程采用默认安装路径,

Python使用国内镜像加速pip安装的方法讲解

《Python使用国内镜像加速pip安装的方法讲解》在Python开发中,pip是一个非常重要的工具,用于安装和管理Python的第三方库,然而,在国内使用pip安装依赖时,往往会因为网络问题而导致速... 目录一、pip 工具简介1. 什么是 pip?2. 什么是 -i 参数?二、国内镜像源的选择三、如何

Python安装时常见报错以及解决方案

《Python安装时常见报错以及解决方案》:本文主要介绍在安装Python、配置环境变量、使用pip以及运行Python脚本时常见的错误及其解决方案,文中介绍的非常详细,需要的朋友可以参考下... 目录一、安装 python 时常见报错及解决方案(一)安装包下载失败(二)权限不足二、配置环境变量时常见报错及

MySQL8.2.0安装教程分享

《MySQL8.2.0安装教程分享》这篇文章详细介绍了如何在Windows系统上安装MySQL数据库软件,包括下载、安装、配置和设置环境变量的步骤... 目录mysql的安装图文1.python访问网址2javascript.点击3.进入Downloads向下滑动4.选择Community Server5.

CentOS系统Maven安装教程分享

《CentOS系统Maven安装教程分享》本文介绍了如何在CentOS系统中安装Maven,并提供了一个简单的实际应用案例,安装Maven需要先安装Java和设置环境变量,Maven可以自动管理项目的... 目录准备工作下载并安装Maven常见问题及解决方法实际应用案例总结Maven是一个流行的项目管理工具

MySql9.1.0安装详细教程(最新推荐)

《MySql9.1.0安装详细教程(最新推荐)》MySQL是一个流行的关系型数据库管理系统,支持多线程和多种数据库连接途径,能够处理上千万条记录的大型数据库,本文介绍MySql9.1.0安装详细教程,... 目录mysql介绍:一、下载 Mysql 安装文件二、Mysql 安装教程三、环境配置1.右击此电脑

在 Windows 上安装 DeepSeek 的完整指南(最新推荐)

《在Windows上安装DeepSeek的完整指南(最新推荐)》在Windows上安装DeepSeek的完整指南,包括下载和安装Ollama、下载DeepSeekRXNUMX模型、运行Deep... 目录在www.chinasem.cn Windows 上安装 DeepSeek 的完整指南步骤 1:下载并安装

python管理工具之conda安装部署及使用详解

《python管理工具之conda安装部署及使用详解》这篇文章详细介绍了如何安装和使用conda来管理Python环境,它涵盖了从安装部署、镜像源配置到具体的conda使用方法,包括创建、激活、安装包... 目录pytpshheraerUhon管理工具:conda部署+使用一、安装部署1、 下载2、 安装3

龙蜥操作系统Anolis OS-23.x安装配置图解教程(保姆级)

《龙蜥操作系统AnolisOS-23.x安装配置图解教程(保姆级)》:本文主要介绍了安装和配置AnolisOS23.2系统,包括分区、软件选择、设置root密码、网络配置、主机名设置和禁用SELinux的步骤,详细内容请阅读本文,希望能对你有所帮助... ‌AnolisOS‌是由阿里云推出的开源操作系统,旨

Ubuntu系统怎么安装Warp? 新一代AI 终端神器安装使用方法

《Ubuntu系统怎么安装Warp?新一代AI终端神器安装使用方法》Warp是一款使用Rust开发的现代化AI终端工具,该怎么再Ubuntu系统中安装使用呢?下面我们就来看看详细教程... Warp Terminal 是一款使用 Rust 开发的现代化「AI 终端」工具。最初它只支持 MACOS,但在 20