使用kubeKey安装kubeSphere

编程入门 行业动态 更新时间:2024-10-22 17:24:49

使用<a href=https://www.elefans.com/category/jswz/34/1683260.html style=kubeKey安装kubeSphere"/>

使用kubeKey安装kubeSphere

使用kubeKey安装kubeSphere

使用kubeKey安装kubeSphere。如果你和作者一样在部署时下载遇到了约束可用参考该文章,该文档主要使用代理方案将包给提前下载了有些脚本更改了代理路径,希望对您有所帮助!

下载安装工具kubeKey

下载脚本

wget 

编辑脚本替换成代理URL

#!/bin/sh# Copyright 2020 The KubeSphere Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     .0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.ISLINUX=true
OSTYPE="linux"if [ "x$(uname)" != "xLinux" ]; thenecho ""echo 'Warning: Non-Linux operating systems are not supported! After downloading, please copy the tar.gz file to linux.'  ISLINUX=false
fi# Fetch latest version
if [ "x${VERSION}" = "x" ]; thenVERSION="$(curl -sL ://api.github/repos/kubesphere/kubekey/releases |grep -o 'download/v[0-9]*.[0-9]*.[0-9]*/' |sort --version-sort |tail -1 | awk -F'/' '{ print $2}')"VERSION="${VERSION##*/}"
fiif [ -z "${ARCH}" ]; thencase "$(uname -m)" inx86_64)ARCH=amd64;;armv8*)ARCH=arm64;;aarch64*)ARCH=arm64;;*)echo "${ARCH}, isn't supported"exit 1;;esac
fiif [ "x${VERSION}" = "x" ]; thenecho "Unable to get latest Kubekey version. Set VERSION env var and re-run. For example: export VERSION=v1.0.0"echo ""exit
fiDOWNLOAD_URL="://github/kubesphere/kubekey/releases/download/${VERSION}/kubekey-${VERSION}-${OSTYPE}-${ARCH}.tar.gz"
if [ "x${KKZONE}" = "xcn" ]; thenDOWNLOAD_URL="://kubernetes.pek3b.qingstor/kubekey/releases/download/${VERSION}/kubekey-${VERSION}-${OSTYPE}-${ARCH}.tar.gz"
fiecho ""
echo "Downloading kubekey ${VERSION} from ${DOWNLOAD_URL} ..."
echo ""curl -fsLO "$DOWNLOAD_URL"
if [ $? -ne 0 ]; thenecho ""echo "Failed to download Kubekey ${VERSION} !"echo ""echo "Please verify the version you are trying to download."echo ""exit
fiif [ ${ISLINUX} = true ]; thenfilename="kubekey-${VERSION}-${OSTYPE}-${ARCH}.tar.gz"ret='0'command -v tar >/dev/null 2>&1 || { ret='1'; }if [ "$ret" -eq 0 ]; thentar -xzf "${filename}"elseecho "Kubekey ${VERSION} Download Complete!"echo ""echo "Try to unpack the ${filename} failed."echo "tar: command not found, please unpack the ${filename} manually."exitfi
fiecho ""
echo "Kubekey ${VERSION} Download Complete!"
echo ""

执行脚本

export VERSION=v1.1.1 & sh downloadKubekey.sh

使用kk安装k8s集群

./kk create config --with-kubernetes v1.20.4 --with-kubesphere v3.1.1
  • 手动下载
curl -L -o /opt/share/k8s/kubekey/kubekey/v1.20.4/amd64/cni-plugins-linux-amd64-v0.8.6.tgz ://github/containernetworking/plugins/releases/download/v0.8.6/cni-plugins-linux-amd64-v0.8.6.tgz
  • 手动下载nfs 配置类文件
 curl -L -o addons.md ://raw.githubusercontent/kubesphere/kubekey/master/docs/addons.md
  • 配置一下addons
kind: Cluster
metadata:name: sample
spec:hosts:- {name: k8smaster, address: 192.168.122.110, internalAddress: 192.168.122.110, user: root, password:yourServerPassword}- {name: k8snode1, address: 192.168.122.111, internalAddress: 192.168.122.111, user: root, password: yourServerPassword}- {name: k8snode2, address: 192.168.122.112, internalAddress: 192.168.122.112, user: root, password: yourServerPassword}roleGroups:etcd:- k8smastermaster:- k8smasterworker:- k8snode1- k8snode2controlPlaneEndpoint:domain: lb.kubesphere.localaddress: ""port: 6443kubernetes:version: v1.20.4imageRepo: kubesphereclusterName: cluster.localnetwork:plugin: calicokubePodsCIDR: 10.233.64.0/18kubeServiceCIDR: 10.233.0.0/18registry:registryMirrors: []insecureRegistries: []addons:- name: nfs-clientnamespace: kube-systemsources:chart:name: nfs-client-provisionerrepo: : custom-nfs-client-values.yaml  # or .yaml# values also supports parameter listsvalues:- storageClass.defaultClass=true- nfs.server=192.168.122.1- nfs.path=/home/nfs/k8s---
apiVersion: installer.kubesphere.io/v1alpha1
kind: ClusterConfiguration
metadata:name: ks-installernamespace: kubesphere-systemlabels:version: v3.1.1
spec:persistence:storageClass: ""authentication:jwtSecret: ""zone: ""local_registry: ""etcd:monitoring: trueendpointIps: localhostport: 2379tlsEnable: truecommon:redis:enabled: trueredisVolumSize: 2Giopenldap:enabled: trueopenldapVolumeSize: 2GiminioVolumeSize: 20Gimonitoring:endpoint: :9090es:elasticsearchMasterVolumeSize: 4GielasticsearchDataVolumeSize: 20GilogMaxAge: 7elkPrefix: logstashbasicAuth:enabled: falseusername: ""password: ""externalElasticsearchUrl: ""externalElasticsearchPort: ""console:enableMultiLogin: trueport: 30880alerting:enabled: true# thanosruler:#   replicas: 1#   resources: {}auditing:enabled: truedevops:enabled: truejenkinsMemoryLim: 2GijenkinsMemoryReq: 1500MijenkinsVolumeSize: 8GijenkinsJavaOpts_Xms: 512mjenkinsJavaOpts_Xmx: 512mjenkinsJavaOpts_MaxRAM: 2gevents:enabled: trueruler:enabled: truereplicas: 2logging:enabled: truelogsidecar:enabled: truereplicas: 2metrics_server:enabled: truemonitoring:storageClass: ""prometheusMemoryRequest: 400MiprometheusVolumeSize: 20Gimulticluster:clusterRole: hostnetwork:networkpolicy:enabled: trueippool:type: nonetopology:type: noneopenpitrix:store:enabled: trueservicemesh:enabled: truekubeedge:enabled: truecloudCore:nodeSelector: {"node-role.kubernetes.io/worker": ""}tolerations: []cloudhubPort: "10000"cloudhubQuicPort: "10001"cloudhubHttpsPort: "10002"cloudstreamPort: "10003"tunnelPort: "10004"cloudHub:advertiseAddress:- ""nodeLimit: "100"service:cloudhubNodePort: "30000"cloudhubQuicNodePort: "30001"cloudhubHttpsNodePort: "30002"cloudstreamNodePort: "30003"tunnelNodePort: "30004"edgeWatcher:nodeSelector: {"node-role.kubernetes.io/worker": ""}tolerations: []edgeWatcherAgent:nodeSelector: {"node-role.kubernetes.io/worker": ""}tolerations: []
  • 部署k8s集群
./kk create cluster -f config-sample.yaml

更多推荐

使用kubeKey安装kubeSphere

本文发布于:2024-02-11 20:25:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1683259.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:kubeKey   kubeSphere

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!