赞
踩
内存 | 磁盘 | 角色 | hostname | 系统 |
---|---|---|---|---|
16G | 146G | worker | node1 | Ubuntu 20.04.6 |
16G | 146G | master control plane | master | Ubuntu 20.04.6 |
16G | 146G | worker | node2 | Ubuntu 20.04.6 |
ubuntu@ubuntu:ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa Your public key has been saved in /root/.ssh/id_rsa.pub The key fingerprint is: SHA256:GMAPyMbxDKEWjEBIh7Hb4BF4DvTGQs2o29wzCtRO7D4 root@newstart-205 The key's randomart image is: +---[RSA 3072]----+ |@@X*. | |*=&*o. | |o@o+oo. | |+.O+ .o | |.*+o . S | |o oo+ | | ... o | | .E | | . | +----[SHA256]-----+ ubuntu@ubuntu:/usr/local/soft$ ll /home/ubuntu/.ssh/ total 24 drwx------ 2 ubuntu ubuntu 4096 Jan 17 15:58 ./ drwxr-xr-x 4 ubuntu ubuntu 4096 Jan 18 10:01 ../ -rw------- 1 ubuntu ubuntu 1701 Jan 17 15:50 authorized_keys -rw------- 1 ubuntu ubuntu 2602 Jan 17 15:48 id_rsa -rw-r--r-- 1 ubuntu ubuntu 567 Jan 17 15:48 id_rsa.pub -rw-r--r-- 1 ubuntu ubuntu 444 Jan 17 17:10 known_hosts
三台服务器都分别操作:将当前服务器公钥拷贝到目标服务器~/.ssh/authorized_keys文件中
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
ubuntu@ubuntu:/usr/local/soft$ sudo systemctl restart sshd
ubuntu@master:~$ ssh node1
The authenticity of host 'node1 (10.192.**.**)' can't be established.
ECDSA key fingerprint is SHA256:MBfaid9cyaidvbb3e1r5HG6Ea+MI74XEWTc9edhMaJ4.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'node1' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-172-generic x86_64)
*** System restart required ***
Last login: Fri Mar 15 17:11:36 2024 from 10.192.41.45
ubuntu@node1:~$
官方文档中命令下载KubeKey命令
curl -sfL https://get-kk.kubesphere.io | VERSION=v3.0.13 sh -
需要翻墙,服务器无法直接下载。翻墙后手动下载再上传到服务器。
下载地址:https://github.com/kubesphere/kubekey/tags
下载时需选择处理器架构ARM/AMD,通过命令查看服务器处理器架构
ubuntu@ubuntu:~$ sudo uname -a | grep "x86_64" && echo "该系统为AMD架构" || (echo "该系统为ARM架构")
[sudo] password for ubuntu:
Linux ubuntu 5.4.0-154-generic #171-Ubuntu SMP Fri Jun 16 16:29:04 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
该系统为AMD架构
下载好的两个安装文件:
kubekey-v3.0.13-linux-amd64.tar.gz
kubekey-v3.0.13-linux-arm64.tar.gz
解压后得到kk后可以使用kk安装其它服务:
-rwxr-xr-x 1 ubuntu ubuntu 78973328 Oct 30 19:17 kk*
-rw-rw-r-- 1 ubuntu ubuntu 35796469 Jan 17 17:55 kubekey-v3.0.13-linux-amd64.tar.gz
ubuntu@ubuntu:/usr/local/soft$ ./kk version
kk version: &version.Info{Major:"3", Minor:"0", GitVersion:"v3.0.13", GitCommit:"ac75d3ef3c22e6a9d999dcea201234d6651b3e72", GitTreeState:"clean", BuildDate:"2023-10-30T11:15:14Z", GoVersion:"go1.19.2", Compiler:"gc", Platform:"linux/amd64"}
按照文档操作:https://www.kubesphere.io/zh/docs/v3.4/installing-on-linux/introduction/air-gapped-installation/
因服务器无法解析资源域名例如:https://storage.googleapis.com
所以离线安装包的制作在可以解析此类资源域名的服务器上进行。选用云服务器制作:
这里提供编译好的离线安装包:kubesphere在线安装遇到很多资源网站不能访问或访问超时。制作了一个离线安装包13G。耗时三天提供给需要的兄弟。制作日期2024年1月19日
--- apiVersion: kubekey.kubesphere.io/v1alpha2 kind: Manifest metadata: name: sample spec: arches: - amd64 operatingSystems: - arch: amd64 type: linux id: centos version: "7" repository: iso: localPath: url: https://github.com/kubesphere/kubekey/releases/download/v3.0.10/centos7-rpms-amd64.iso - arch: amd64 type: linux id: ubuntu version: "20.04" repository: iso: localPath: url: https://github.com/kubesphere/kubekey/releases/download/v3.0.10/ubuntu-20.04-debs-amd64.iso kubernetesDistributions: - type: kubernetes version: v1.23.15 components: helm: version: v3.9.0 cni: version: v1.2.0 etcd: version: v3.4.13 calicoctl: version: v3.23.2 ## For now, if your cluster container runtime is containerd, KubeKey will add a docker 20.10.8 container runtime in the below list. ## The reason is KubeKey creates a cluster with containerd by installing a docker first and making kubelet connect the socket file of containerd which docker contained. containerRuntimes: - type: docker version: 20.10.8 - type: containerd version: 1.6.4 crictl: version: v1.24.0 docker-registry: version: "2" harbor: version: v2.5.3 docker-compose: version: v2.2.2 images: - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-apiserver:v1.23.15 - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controller-manager:v1.23.15 - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-proxy:v1.23.15 - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-scheduler:v1.23.15 - registry.cn-beijing.aliyuncs.com/kubesphereio/pause:3.6 - registry.cn-beijing.aliyuncs.com/kubesphereio/coredns:1.8.6 - registry.cn-beijing.aliyuncs.com/kubesphereio/cni:v3.23.2 - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controllers:v3.23.2 - registry.cn-beijing.aliyuncs.com/kubesphereio/node:v3.23.2 - registry.cn-beijing.aliyuncs.com/kubesphereio/pod2daemon-flexvol:v3.23.2 - registry.cn-beijing.aliyuncs.com/kubesphereio/typha:v3.23.2 - registry.cn-beijing.aliyuncs.com/kubesphereio/flannel:v0.12.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/provisioner-localpv:3.3.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/linux-utils:3.3.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/haproxy:2.3 - registry.cn-beijing.aliyuncs.com/kubesphereio/nfs-subdir-external-provisioner:v4.0.2 - registry.cn-beijing.aliyuncs.com/kubesphereio/k8s-dns-node-cache:1.15.12 - registry.cn-beijing.aliyuncs.com/kubesphereio/ks-installer:v3.4.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/ks-apiserver:v3.4.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/ks-console:v3.4.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/ks-controller-manager:v3.4.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/kubectl:v1.22.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/kubectl:v1.21.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/kubectl:v1.20.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/kubefed:v0.8.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/tower:v0.2.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/minio:RELEASE.2019-08-07T01-59-21Z - registry.cn-beijing.aliyuncs.com/kubesphereio/mc:RELEASE.2019-08-07T23-14-43Z - registry.cn-beijing.aliyuncs.com/kubesphereio/snapshot-controller:v4.0.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/nginx-ingress-controller:v1.1.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/defaultbackend-amd64:1.4 - registry.cn-beijing.aliyuncs.com/kubesphereio/metrics-server:v0.4.2 - registry.cn-beijing.aliyuncs.com/kubesphereio/redis:5.0.14-alpine - registry.cn-beijing.aliyuncs.com/kubesphereio/haproxy:2.0.25-alpine - registry.cn-beijing.aliyuncs.com/kubesphereio/alpine:3.14 - registry.cn-beijing.aliyuncs.com/kubesphereio/openldap:1.3.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/netshoot:v1.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/cloudcore:v1.13.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/iptables-manager:v1.13.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/edgeservice:v0.3.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/gatekeeper:v3.5.2 - registry.cn-beijing.aliyuncs.com/kubesphereio/openpitrix-jobs:v3.3.2 - registry.cn-beijing.aliyuncs.com/kubesphereio/devops-apiserver:ks-v3.4.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/devops-controller:ks-v3.4.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/devops-tools:ks-v3.4.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/ks-jenkins:v3.4.0-2.319.3-1 - registry.cn-beijing.aliyuncs.com/kubesphereio/inbound-agent:4.10-2 - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-base:v3.2.2 - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-nodejs:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-maven:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-maven:v3.2.1-jdk11 - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-python:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.16 - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.17 - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.18 - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-base:v3.2.2-podman - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-nodejs:v3.2.0-podman - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-maven:v3.2.0-podman - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-maven:v3.2.1-jdk11-podman - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-python:v3.2.0-podman - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.0-podman - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.16-podman - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.17-podman - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.18-podman - registry.cn-beijing.aliyuncs.com/kubesphereio/s2ioperator:v3.2.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/s2irun:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/s2i-binary:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/tomcat85-java11-centos7:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/tomcat85-java11-runtime:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/tomcat85-java8-centos7:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/tomcat85-java8-runtime:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/java-11-centos7:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/java-8-centos7:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/java-8-runtime:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/java-11-runtime:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/nodejs-8-centos7:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/nodejs-6-centos7:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/nodejs-4-centos7:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/python-36-centos7:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/python-35-centos7:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/python-34-centos7:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/python-27-centos7:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/argocd:v2.3.3 - registry.cn-beijing.aliyuncs.com/kubesphereio/argocd-applicationset:v0.4.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/dex:v2.30.2 - registry.cn-beijing.aliyuncs.com/kubesphereio/redis:6.2.6-alpine - registry.cn-beijing.aliyuncs.com/kubesphereio/configmap-reload:v0.7.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/prometheus:v2.39.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/prometheus-config-reloader:v0.55.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/prometheus-operator:v0.55.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-rbac-proxy:v0.11.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-state-metrics:v2.6.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/node-exporter:v1.3.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/alertmanager:v0.23.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/thanos:v0.31.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/grafana:8.3.3 - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-rbac-proxy:v0.11.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/notification-manager-operator:v2.3.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/notification-manager:v2.3.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/notification-tenant-sidecar:v3.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/elasticsearch-curator:v5.7.6 - registry.cn-beijing.aliyuncs.com/kubesphereio/elasticsearch-oss:6.8.22 - registry.cn-beijing.aliyuncs.com/kubesphereio/opensearch:2.6.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/opensearch-dashboards:2.6.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/opensearch-curator:v0.0.5 - registry.cn-beijing.aliyuncs.com/kubesphereio/fluentbit-operator:v0.14.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/docker:19.03 - registry.cn-beijing.aliyuncs.com/kubesphereio/fluent-bit:v1.9.4 - registry.cn-beijing.aliyuncs.com/kubesphereio/log-sidecar-injector:v1.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/filebeat:6.7.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-events-operator:v0.6.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-events-exporter:v0.6.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-events-ruler:v0.6.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-auditing-operator:v0.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-auditing-webhook:v0.2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/pilot:1.14.6 - registry.cn-beijing.aliyuncs.com/kubesphereio/proxyv2:1.14.6 - registry.cn-beijing.aliyuncs.com/kubesphereio/jaeger-operator:1.29 - registry.cn-beijing.aliyuncs.com/kubesphereio/jaeger-agent:1.29 - registry.cn-beijing.aliyuncs.com/kubesphereio/jaeger-collector:1.29 - registry.cn-beijing.aliyuncs.com/kubesphereio/jaeger-query:1.29 - registry.cn-beijing.aliyuncs.com/kubesphereio/jaeger-es-index-cleaner:1.29 - registry.cn-beijing.aliyuncs.com/kubesphereio/kiali-operator:v1.50.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/kiali:v1.50 - registry.cn-beijing.aliyuncs.com/kubesphereio/busybox:1.31.1 - registry.cn-beijing.aliyuncs.com/kubesphereio/nginx:1.14-alpine - registry.cn-beijing.aliyuncs.com/kubesphereio/wget:1.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/hello:plain-text - registry.cn-beijing.aliyuncs.com/kubesphereio/wordpress:4.8-apache - registry.cn-beijing.aliyuncs.com/kubesphereio/hpa-example:latest - registry.cn-beijing.aliyuncs.com/kubesphereio/fluentd:v1.4.2-2.0 - registry.cn-beijing.aliyuncs.com/kubesphereio/perl:latest - registry.cn-beijing.aliyuncs.com/kubesphereio/examples-bookinfo-productpage-v1:1.16.2 - registry.cn-beijing.aliyuncs.com/kubesphereio/examples-bookinfo-reviews-v1:1.16.2 - registry.cn-beijing.aliyuncs.com/kubesphereio/examples-bookinfo-reviews-v2:1.16.2 - registry.cn-beijing.aliyuncs.com/kubesphereio/examples-bookinfo-details-v1:1.16.2 - registry.cn-beijing.aliyuncs.com/kubesphereio/examples-bookinfo-ratings-v1:1.16.3 - registry.cn-beijing.aliyuncs.com/kubesphereio/scope:1.13.0
ubuntu@master:/usr/local/soft$ ./kk create config --with-kubesphere v3.4.1 --with-kubernetes v1.23.15 -f config-sample.yaml Generate KubeKey config file successfully ubuntu@master:/usr/local/soft$ cat config-sample.yaml.normal apiVersion: kubekey.kubesphere.io/v1alpha2 kind: Cluster metadata: name: sample spec: hosts: - {name: master, address: 10.192.52.93, internalAddress: 10.192.52.93, user: ubuntu, password: ****} - {name: node1, address: 10.192.41.117, internalAddress: 10.192.41.117,user: ubuntu, password: ****} - {name: node2, address: 10.192.41.108, internalAddress: 10.192.41.108, user: ubuntu, password: ****} roleGroups: etcd: - master control-plane: - master worker: - node1 - node2 controlPlaneEndpoint: ## Internal loadbalancer for apiservers # internalLoadbalancer: haproxy domain: lb.kubesphere.local address: "10.192.52.93" port: 6443 kubernetes: version: --with-kubesphere clusterName: cluster.local autoRenewCerts: true containerManager: etcd: type: kubekey network: plugin: calico kubePodsCIDR: 10.233.64.0/18 kubeServiceCIDR: 10.233.0.0/18 ## multus support. https://github.com/k8snetworkplumbingwg/multus-cni multusCNI: enabled: false registry: privateRegistry: "" namespaceOverride: "" registryMirrors: [] insecureRegistries: [] addons: []
ubuntu@master:./kk init registry -f config-sample.yaml -a kubesphere.tar.gz
14:21:37 CST success: [node2]
14:21:37 CST [ChownWorkerModule] Chown ./kubekey dir
14:21:37 CST success: [LocalHost]
14:21:37 CST Pipeline[InitRegistryPipeline] execute successfully
ubuntu@master:./kk create cluster -f config-sample.yaml -a kubesphere.tar.gz --with-packages 组件安装情况: +--------+------+------+---------+----------+-------+-------+---------+-----------+--------+--------+------------+------------+-------------+------------------+--------------+ | 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 | 24.0.7 | 1.6.27 | | | | CST 15:25:33 | | node2 | y | y | y | y | y | y | y | y | y | 24.0.7 | 1.6.27 | | | | CST 15:25:31 | | node1 | y | y | y | y | y | y | y | y | y | 24.0.7 | 1.6.27 | | | | CST 15:25:31 | +--------+------+------+---------+----------+-------+-------+---------+-----------+--------+--------+------------+------------+-------------+------------------+--------------+
安装成功标识:
##################################################### ### Welcome to KubeSphere! ### ##################################################### Console: http://10.192.52.93:30880 Account: admin Password: ******* NOTES: 1. After you log into the console, please check the monitoring status of service components in "Cluster Management". If any service is not ready, please wait patiently until all components are up and running. 2. Please change the default password after login. ##################################################### https://kubesphere.io 2024-01-21 13:26:54 ##################################################### 13:26:57 CST success: [master] 13:26:57 CST Pipeline[CreateClusterPipeline] execute successfully Installation is complete. Please check the result using the command: 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
执行命令可以看到登录kubeSphere地址和账号:
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
Console: http://10.192.52.93:30880
Account: admin
Password: *******
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。