下载KubeKeyKubeKey是新一代Kubernetes和KubeSphere安装程序,可帮助您以简单、快速和灵活的方式安装Kubernetes和KubeSphere。exportKKZONE=cncurl-sfLhttps://get-kk.kubesphere.io|VERSION=v1.0.1sh-准备镜像如果想加快安装速度或者你的机房没有外网,可以使用公司内部私有仓库预装镜像Push到私有仓库。我这里的仓库使用harbor下载离线安装工具。我只是用这个脚本下载并推送镜像curl-L-Ohttps://github.com/kubesphere/ks-installer/releases/download/v3.0.0/offline-installation-tool.shcurl-L-Ohttps://github.com/kubesphere/ks-installer/releases/download/v3.0.0/images-list.txt拉取镜像./offline-installation-tool.sh-s-limages-list.txt-d./kubesphere-images即可在./kubesphere-images目录下看到如下压缩包#lltotal8606088-rw-r--r--1rootroot454465957Feb215:37csi-images.tar.gz-rw-r--r--1rootroot1231853258Feb215:33example-images.tar。gz-rw-r--r--1rootroot445244294Feb214:50istio-images.tar.gz-rw-r--r--1rootroot762326634Feb214:27k8s-images.tar.gz-rw-r--r--1rootroot1297767607Feb214:40ks-core-images.tar.gz-rw-r--r--1rootroot3439146357Feb215:19ks-devops-images.tar.gz-rw-r--r--1rootroot733165078Feb214:46ks-logging-images.tar.gz-rw-r--r--1rootroot448651153Feb215:23openpitrix-images.tar.gz将镜像推送到私有仓库,等待脚本完成。/offline-installation-tool.sh-limages-list.txt-d./kubesphere-images-rhub.evbj.easou.com创建多节点集群可以使用KubeKey同时安装Kubernetes和KubeSphere,通过自定义配置文件参数创建多节点集群创建安装了KubeSphere的Kubernetes集群(例如--with-kubespherev3.0.0)./kkcreateconfig--with-kubernetesv1.17.9--with-kubespherev3.0.0系统将创建一个默认的config-sample.yaml文件。您可以根据您的环境修改此文件。apiVersion:kubekey.kubesphere.io/v1alpha1kind:Clustermetadata:name:ESCloudspec:hosts:-{name:kubesphere001,address:10.26.31.34,internalAddress:10.26.31.34,privateKeyPath:"~/.ssh/id_dsa",port:20755}-{name:kubesphere002,address:10.26.31.36,internalAddress:10.26.31.36,privateKeyPath:"~/.ssh/id_dsa",port:20755}-{name:kubesphere003,address:10.26.31.42,internalAddress:10.26.31.42,privateKeyPath:"~/.ssh/id_dsa",port:20755}-{name:kubesphere004,address:10.26.31.46,internalAddress:10.26.31.46,privateKeyPath:"~/.ssh/id_dsa",port:20755}-{name:kubesphere005,address:10.26.31.118,internalAddress:10.26.31.118,privateKeyPath:"~/.ssh/id_dsa",port:20755}-{name:kubesphere006,address:10.26.31.119,internalAddress:10.26.31.119,privateKeyPath:"~/.ssh/id_dsa",port:20755}-{name:kubesphere007,address:10.26.31.120,internalAddress:10.26.31.120,privateKeyPath:"~/.ssh/id_dsa",port:20755}-{名称:kubesphere008,a地址:10.26.31.121,内部地址:10.26.31.121,privateKeyPath:“~/.ssh/id_dsa”,端口:20755}角色组:etcd:-kubesphere001-kubesphere002-kubesphere003master:-kubesphere001-kubesphere002-kubesphere003worker:-kubesphere004-kubespherekubesphere006-kubesphere007-kubesphere008controlPlaneEndpoint:domain:lb.kubesphere.localaddress:""port:"6443"kubernetes:version:v1.17.9imageRepo:kubesphereclusterName:cluster.localnetwork:plugin:calicokubePodsCIDR:10.233.64.0/18kubeServiceCIDR:10.0/233.18re??gistry:registryMirrors:[]insecureRegistries:["hub.kubeops.net"]privateRegistry:"hub.kubeops.net"addons:[]---apiVersion:installer.kubesphere.io/v1alpha1kind:ClusterConfigurationmetadata:name:ks-installernamespace:kubesphere-systemlabels:version:v3.0.0spec:local_registry:"hub.kubeops.net"persistence:storageClass:""authentication:jwtSecret:""etcd:monitoring:trueendpointIps:localhostport:2379tlsEnable:truecommon:es:elasticsearchDataVolumeSize:20GielasticsearchMasterVolumeSize:4GielkPrefix:logstashlogMaxAge:7mysqlVolumeSize:20GiminioVolumeSize:20GietcdVolumeSize:20GiopenldapVolumeSize:2GiredisVolumSize:2Giconsole:enableMultiLogin:true#enable/disablemultiloginport:30880alerting:enabled:falseauditing:enabled:falsedevops:enabled:falsejenkinsMemoryLim:2GijenkinsMemoryReq:1500MijenkinsVolumeSize:8GijenkinsJavaOpts_Xms:512mjenkinsJavaOpts_Xmx:512mjenkinsJavaOpts_MaxRAM:2gevents:enabled:falseruler:enabled:truereplicas:2logging:enabled:falselogsidecarReplicas:2metrics_server:enabled:truemonitoring:prometheusMemoryRequest:400MiprometheusVolumeSize:20Gimulticluster:clusterRole:none#host|member|nonenetworkpolicy:enabled:falsenotification:enabled:falseopenpitrix:enabled:falseservicemesh:enabled:false环境初始化./kkinitos-fconfig-sample.yamlINFO[14:04:19CST]InitoperatingsystemINFO[14:04:20CST]Startinitializingkubesphere008[10.26.31.121]node=10.26.31.121INFO[14:04:20CST]Startinitializingkubesphere001[10.26.31.34]node=10.26.31.34INFO[14:04:20CST]Startinitializingkubesphere003[10.26.31.42]node=10.26.31.42INFO[14:04:20CST10CST10CST]Startinitializing[14:04:20CST10CST2065].31.118]node=10.26.31.118INFO[14:04:20CST]Startinitializingkubesphere006[10.26.31.119]node=10.26.31.119INFO[14:04:20CST]Startinitializingkubesphere004[10.26.31.46]node=10.26.INFO[31.46]04:20CST]Startinitializingkubesphere007[10.26.31.120]node=10.26.31.120INFO[14:04:20CST]Startinitializingkubesphere002[10.26.31.36]node=10.26.31.36INFO[14:06:34CST]Completeinitializing10.10.120INFO[34:06:34CST]完成节点初始化10.10.1085[310.26.31.118INFO[14:06:56CST]Completeinitializationkubesphere002[10.26.31.36]node=10.26.31.36INFO[14:07:04CST]Completeinitializationkubesphere006[10.26.31.119]node=10.26.31.119Completekubesphere7:04C:0[10.26.31.120]node=10.26.31.120INFO[14:07:07CST]Completeinitializationkubesphere003[10.26.31.42]node=10.26.31.42INFO[14:07:11CST]完成初始化kubesphere004[10.26.31.46]node=10.26.31.46INFO[14:08:23CST]完成初始化kubesphere001[10.26.31.34]node=10.26.31.34INFO[14:10:57CST]完成初始化110.31.201.3node.061.3=10.26.31.121INFO[14:10:57CST]初始化操作系统成功。部署完成以上准备工作并再次检查配置文件后,执行安装./kkcreatecluster-fconfig-sample.yaml+------------------------+------+------+-------+------------+--------+--------+------------+--------+------------+------------+----------------+----------------+|name|sudo|curl|openssl|ebtables|socat|ipset|conntrack|docker|nfsclient|cephclient|glusterfsclient|time|+----------------------+-----+-----+--------+----------+--------+--------+----------+--------+------------+------------+----------------+--------------+|kubesphere005|y|y|y|y|y|y|y|y|y|y|y|CST14:16:55||kubesphere006|y|y|y|y|y|y|y|y|y|y|y|CST14:16:55||kubesphere007|y|y|y|y|y|y|y|y|y|y|y|CST14:16:55||kubesphere004|y|y|y|y|y|y|y|y|y|y|y|CST14:16:55||kubesphere001|y|y|y|y|y|y|y|y|y|y|y|CST14:16:55||kubesphere003|y|y|y|y|y|y|y|y|y|y|y|CST14:16:55||kubesphere002|y|y|y|y|y|y|y|y|y|y|y|CST14:16:55||kubesphere008|y|y|y|y|y|y|y|y|y|y|y|CST14:16:55|+------------------------+------+------+---------+------------+--------+--------+------------+-------+------------+------------+----------------+--------------+这是对您的环境的简单检查。在安装之前,您应该确保您的机器满足https://github.com/kubesphere/kubekey#requirements-and-recommendations中指定的所有要求是否继续此安装?[是/否]:yesINFO[14:17:25CST]正在下载安装文件信息[14:17:25CST]正在下载.loadingkubeadm.****************************************************#######################################################欢迎使用KubeSphere!########################################################控制台:http://10.26.31.34:30880账号:admin密码:P@88w0rd注意事项:1.登录控制台后,请在“集群管理”中查看服务组件的监控状态。如果有服务未就绪,请耐心等待,直到所有组件就绪。2.请修改登录后的默认密码。#####################################################https://kubesphere.io2021-02-0515:47:21###################################################至此kubesphere安装成功,可以通过浏览器访问http://10.26.31.34:30880验证是否可以使用默认账号和密码admin/P@88w0rd登录KubeSphere控制台,开始使用KubeSphere登录后请修改默认密码,登录后如下图,就可以开始你的kubesphere之旅了。详情请参考官网。
