选择cluster01作为KubeFed的主集群,将cluster02作为成员集群加入集群联邦。
首先,需要在主集群中安装并部署KubeFed,使用Helm Chart进行部署,需要安装Helm3客户端,命令如下。
$ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11213 100 11213 0 0 110k 0 --:--:-- --:--:-- --:--:-- 110k
Downloading https://get.helm.sh/helm-v3.4.1-linux-amd64.tar.gz
Verifying checksum... Done.
Preparing to install helm into /usr/local/bin
helm installed into /usr/local/bin/helm
添加KubeFed的chart repo,命令如下。
$ helm repo add kubefed-charts https://raw.githubusercontent.com/kubernetes-sigs/kubefed/master/charts
$ helm repo list
NAME URL
kubefed-charts https://raw.githubusercontent.com/kubernetes-sigs/kubefed/master/charts
chart repo添加完毕后,可以使用下面的命令查看有哪些可用的chart及对应的版本号。
$ helm search repo kubefed
NAME CHART VERSION APP VERSION DESCRIPTION
kubefed-charts/kubefed 0.5.0 KubeFed helm chart
安装KubeFed,命令如下。
$ helm --namespace kube-federation-system upgrade -i kubefed kubefed-charts/kubefed --version=0.5.0 --create-namespace
Release "kubefed" does not exist. Installing it now.
NAME: kubefed
LAST DEPLOYED: Fri Nov 13 16:43:58 2020
NAMESPACE: kube-federation-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
安装完毕后,检查命名空间kube-federation-system下的kubefed-admission-webhook和kubefed-controller-manager组件是否运行正常。
$ kubectl -n kube-federation-system get deploy
NAME READY UP-TO-DATE AVAILABLE AGE
kubefed-admission-webhook 1/1 1 1 3m
kubefed-controller-manager 2/2 2 2 3m
至此,KubeFed在主集群中的安装过程执行完毕。
标签:--,Chart,charts,repo,helm,Helm,KubeFed,kubefed From: https://www.cnblogs.com/muzinan110/p/17066805.html