单机 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

相关文章

虚拟机Centos7安装MySQL数据库实践

《虚拟机Centos7安装MySQL数据库实践》用户分享在虚拟机安装MySQL的全过程及常见问题解决方案,包括处理GPG密钥、修改密码策略、配置远程访问权限及防火墙设置,最终通过关闭防火墙和停止Net... 目录安装mysql数据库下载wget命令下载MySQL安装包安装MySQL安装MySQL服务安装完成

JAVA中安装多个JDK的方法

《JAVA中安装多个JDK的方法》文章介绍了在Windows系统上安装多个JDK版本的方法,包括下载、安装路径修改、环境变量配置(JAVA_HOME和Path),并说明如何通过调整JAVA_HOME在... 首先去oracle官网下载好两个版本不同的jdk(需要登录Oracle账号,没有可以免费注册)下载完

Java JDK1.8 安装和环境配置教程详解

《JavaJDK1.8安装和环境配置教程详解》文章简要介绍了JDK1.8的安装流程,包括官网下载对应系统版本、安装时选择非系统盘路径、配置JAVA_HOME、CLASSPATH和Path环境变量,... 目录1.下载JDK2.安装JDK3.配置环境变量4.检验JDK官网下载地址:Java Downloads

SQL server数据库如何下载和安装

《SQLserver数据库如何下载和安装》本文指导如何下载安装SQLServer2022评估版及SSMS工具,涵盖安装配置、连接字符串设置、C#连接数据库方法和安全注意事项,如混合验证、参数化查... 目录第一步:打开官网下载对应文件第二步:程序安装配置第三部:安装工具SQL Server Manageme

Python中win32包的安装及常见用途介绍

《Python中win32包的安装及常见用途介绍》在Windows环境下,PythonWin32模块通常随Python安装包一起安装,:本文主要介绍Python中win32包的安装及常见用途的相关... 目录前言主要组件安装方法常见用途1. 操作Windows注册表2. 操作Windows服务3. 窗口操作

gitlab安装及邮箱配置和常用使用方式

《gitlab安装及邮箱配置和常用使用方式》:本文主要介绍gitlab安装及邮箱配置和常用使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1.安装GitLab2.配置GitLab邮件服务3.GitLab的账号注册邮箱验证及其分组4.gitlab分支和标签的

MySQL MCP 服务器安装配置最佳实践

《MySQLMCP服务器安装配置最佳实践》本文介绍MySQLMCP服务器的安装配置方法,本文结合实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下... 目录mysql MCP 服务器安装配置指南简介功能特点安装方法数据库配置使用MCP Inspector进行调试开发指

在Windows上使用qemu安装ubuntu24.04服务器的详细指南

《在Windows上使用qemu安装ubuntu24.04服务器的详细指南》本文介绍了在Windows上使用QEMU安装Ubuntu24.04的全流程:安装QEMU、准备ISO镜像、创建虚拟磁盘、配置... 目录1. 安装QEMU环境2. 准备Ubuntu 24.04镜像3. 启动QEMU安装Ubuntu4

Python UV安装、升级、卸载详细步骤记录

《PythonUV安装、升级、卸载详细步骤记录》:本文主要介绍PythonUV安装、升级、卸载的详细步骤,uv是Astral推出的下一代Python包与项目管理器,主打单一可执行文件、极致性能... 目录安装检查升级设置自动补全卸载UV 命令总结 官方文档详见:https://docs.astral.sh/

Nexus安装和启动的实现教程

《Nexus安装和启动的实现教程》:本文主要介绍Nexus安装和启动的实现教程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、Nexus下载二、Nexus安装和启动三、关闭Nexus总结一、Nexus下载官方下载链接:DownloadWindows系统根