--在 Kubernetes 上最小化安装 KubeSphere
--https://kubesphere.io/zh/docs/v3.3/quick-start/minimal-kubesphere-on-k8s/
kubesphere v3.3.2 install
https://github.com/kubesphere/ks-installer/releases/download/v3.3.2/kubesphere-installer.yaml
https://github.com/kubesphere/ks-installer/releases/download/v3.3.2/cluster-configuration.yaml
kubectl apply -f kubesphere-installer.yaml
kubectl apply -f cluster-configuration.yaml
检查安装日志:
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l 'app in (ks-install, ks-installer)' -o jsonpath='{.items[0].metadata.name}') -f
[root@master ~]# kubectl get svc/ks-console -n kubesphere-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ks-console NodePort 10.111.186.1
验证:
http://you ip address:30880/
使用默认帐户和密码 (admin/P@88w0rd) 访问 Web 控制台。
--报错
request to http://ks-apiserver/oauth/token failed, reason: getaddrinfo EAI_AGAIN ks-apiserver
问题解决方法:https://github.com/kubesphere/website/issues/1896
kubectl -n kube-system edit cm coredns -o yaml
解决:注释掉 forward,关闭转发
--查看日志
kubectl logs ks-console-f4549b894-fhs4z -n kubesphere-system |less
通常情况下,vm.dirty_ratio的值要大于vm.dirty_background_ratio的值。
# sysctl -w vm.dirty_background_ratio=5
# sysctl -w vm.dirty_ratio=10
# sysctl -a | grep "dirty"
--启用应用商店
使用 admin 用户登录控制台,点击左上角的平台管理,选择集群管理。
点击定制资源定义,在搜索栏中输入 clusterconfiguration,点击结果查看其详细页面。
在该 YAML 文件中,搜索 openpitrix,将 enabled 的 false 改为 true。完成后,点击右下角的确定,保存配置。
在 kubectl 中执行以下命令检查安装过程:
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l 'app in (ks-install, ks-installer)' -o jsonpath='{.items[0].metadata.name}') -f
验证:
http://you ip address:30880/apps
--https://kubesphere.io/zh/docs/v3.3/quick-start/all-in-one-on-linux/
--在 Linux 上以 All-in-One 模式安装 KubeSphere 3.3.2 kubernetes 1.25.5
-- down kk
curl -sfL https://get-kk.kubesphere.io | VERSION=v3.0.7 sh -
chmod +x kk
--可以运行 ./kk version --show-supported-k8s,查看能使用 KubeKey 安装的所有受支持的 Kubernetes 版本。
--若要同时安装 Kubernetes 和 KubeSphere,可参考以下示例命令:
# ./kk create cluster --with-kubernetes v1.25.5 --with-kubesphere v3.3.2
# ./kk create cluster --with-kubernetes v1.25.5 --with-kubesphere v3.3.2 --container-manager containerd
[root@master ~]# ./kk create cluster --with-kubernetes v1.25.5 --with-kubesphere v3.3.2 --container-manager containerd
_ __ _ _ __
| | / / | | | | / /
| |/ / _ _| |__ ___| |/ / ___ _ _
| \| | | | '_ \ / _ \ \ / _ \ | | |
| |\ \ |_| | |_) | __/ |\ \ __/ |_| |
\_| \_/\__,_|_.__/ \___\_| \_/\___|\__, |
__/ |
|___/
17:20:25 CST [GreetingsModule] Greetings
17:20:26 CST message: [master]
Greetings, KubeKey!
17:20:26 CST success: [master]
17:20:26 CST [NodePreCheckModule] A pre-check on nodes
17:20:29 CST success: [master]
17:20:29 CST [ConfirmModule] Display confirmation form
+--------+------+------+---------+----------+-------+-------+---------+-----------+--------+--------+------------+------------+-------------+------------------+--------------+
| name | sudo | curl | openssl | ebtables | socat | ipset | ipvsadm | conntrack | chrony | docker | containerd | nfs client | ceph client | glusterfs client | time |
+--------+------+------+---------+----------+-------+-------+---------+-----------+--------+--------+------------+------------+-------------+------------------+--------------+
| master | y | y | y | y | y | y | y | y | y | | 1.6.20 | y | | | CST 17:20:29 |
+--------+------+------+---------+----------+-------+-------+---------+-----------+--------+--------+------------+------------+-------------+------------------+--------------+
This is a simple check of your environment.
Before installation, ensure that your machines meet all requirements specified at
https://github.com/kubesphere/kubekey#requirements-and-recommendations
Continue this installation? [yes/no]: yes
17:20:30 CST success: [LocalHost]
17:20:30 CST [NodeBinariesModule] Download installation binaries
17:20:30 CST message: [localhost]
downloading amd64 kubeadm v1.25.5 ...
17:20:31 CST message: [localhost]
kubeadm is existed
17:20:31 CST message: [localhost]
downloading amd64 kubelet v1.25.5 ...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 108M 100 108M 0 0 1020k 0 0:01:49 0:01:49 --:--:-- 1039k
17:22:23 CST message: [localhost]
downloading amd64 kubectl v1.25.5 ...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 42.9M 100 42.9M 0 0 1018k 0 0:00:43 0:00:43 --:--:-- 1052k
17:23:06 CST message: [localhost]
downloading amd64 helm v3.9.0 ...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 44.0M 100 44.0M 0 0 1018k 0 0:00:44 0:00:44 --:--:-- 1055k
17:23:51 CST message: [localhost]
downloading amd64 kubecni v0.9.1 ...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 37.9M 100 37.9M 0 0 1020k 0 0:00:38 0:00:38 --:--:-- 1059k
17:24:30 CST message: [localhost]
downloading amd64 crictl v1.24.0 ...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 13.8M 100 13.8M 0 0 1017k 0 0:00:13 0:00:13 --:--:-- 1041k
17:24:44 CST message: [localhost]
downloading amd64 etcd v3.4.13 ...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 16.5M 100 16.5M 0 0 1025k 0 0:00:16 0:00:16 --:--:-- 1068k
17:25:00 CST message: [localhost]
downloading amd64 containerd 1.6.4 ...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 42.3M 100 42.3M 0 0 1018k 0 0:00:42 0:00:42 --:--:-- 1045k
17:25:43 CST message: [localhost]
downloading amd64 runc v1.1.1 ...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9194k 100 9194k 0 0 1022k 0 0:00:08 0:00:08 --:--:-- 1055k
17:25:53 CST success: [LocalHost]
17:25:53 CST [ConfigureOSModule] Get OS release
17:25:53 CST success: [master]
17:25:53 CST [ConfigureOSModule] Prepare to init OS
17:25:56 CST success: [master]
17:25:56 CST [ConfigureOSModule] Generate init os script
17:25:57 CST success: [master]
17:25:57 CST [ConfigureOSModule] Exec init os script
17:25:58 CST stdout: [master]
setenforce: SELinux is disabled
Disabled
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-arptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_local_reserved_ports = 30000-32767
vm.max_map_count = 262144
vm.swappiness = 1
fs.inotify.max_user_instances = 524288
kernel.pid_max = 65535
17:25:58 CST success: [master]
17:25:58 CST [ConfigureOSModule] configure the ntp server for each node
17:25:58 CST skipped: [master]
17:25:59 CST [KubernetesStatusModule] Get kubernetes cluster status
17:26:00 CST stdout: [master]
v1.25.9
17:26:00 CST stdout: [master]
master v1.25.9 [map[address:192.168.100.121 type:InternalIP] map[address:master type:Hostname]]
node01 v1.25.9 [map[address:192.168.100.122 type:InternalIP] map[address:node01 type:Hostname]]
17:31:23 CST stdout: [master]
I0424 17:31:21.005144 29255 version.go:256] remote version is much newer: v1.27.1; falling back to: stable-1.25
[upload-certs] Storing the certificates in Secret "kubeadm-certs" in the "kube-system" Namespace
[upload-certs] Using certificate key:
165b64d8fac9a69f3db048c96a6ba2b980e3664112fefc6ef2b28c0292d30fce
17:31:23 CST stdout: [master]
secret/kubeadm-certs patched
17:31:24 CST stdout: [master]
secret/kubeadm-certs patched
17:31:24 CST stdout: [master]
secret/kubeadm-certs patched
17:31:24 CST stdout: [master]
yntin0.6x8rcx3oh1ottk45
17:31:24 CST success: [master]
17:31:24 CST [InstallContainerModule] Sync containerd binaries
17:31:24 CST skipped: [master]
17:31:24 CST [InstallContainerModule] Sync crictl binaries
17:31:24 CST skipped: [master]
17:31:24 CST [InstallContainerModule] Generate containerd service
17:31:24 CST skipped: [master]
17:31:24 CST [InstallContainerModule] Generate containerd config
17:31:24 CST skipped: [master]
17:31:24 CST [InstallContainerModule] Generate crictl config
17:31:24 CST skipped: [master]
17:31:24 CST [InstallContainerModule] Enable containerd
17:31:24 CST skipped: [master]
17:31:24 CST [PullModule] Start to pull images on all nodes
17:31:24 CST message: [master]
downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/pause:3.8
17:31:26 CST message: [master]
downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/kube-apiserver:v1.25.5
17:31:48 CST message: [master]
downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controller-manager:v1.25.5
17:32:08 CST message: [master]
downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/kube-scheduler:v1.25.5
17:32:18 CST message: [master]
downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/kube-proxy:v1.25.5
17:32:28 CST message: [master]
downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/coredns:1.9.3
17:32:29 CST message: [master]
downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/k8s-dns-node-cache:1.15.12
17:32:57 CST message: [master]
downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controllers:v3.23.2
17:33:35 CST message: [master]
downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/cni:v3.23.2
17:34:38 CST message: [master]
downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/node:v3.23.2