From 3dd45927b15700367674ebe7918479e8469726ac Mon Sep 17 00:00:00 2001 From: Marco <marco.lorini@garr.it> Date: Tue, 6 Oct 2020 17:43:32 +0200 Subject: [PATCH] 2020-10-06 ML: add readme installation section --- README.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/README.md b/README.md index 5f3412d..80453a6 100644 --- a/README.md +++ b/README.md @@ -75,3 +75,64 @@ switch context: ``` $ kubectl config use-context <context-name> ``` + +## Installation + +### KubeFed client (kubefedctl) + +To install the KubeFed client follow the below command in your local machine: + +``` +$ VERSION=0.2.0-alpha.1 +$ OS=linux +$ ARCH=amd64 +$ curl -LO https://github.com/kubernetes-sigs/kubefed/releases/download/v${VERSION}/kubefedctl-${VERSION}-${OS}-${ARCH}.tgz +$ tar -zxvf kubefedctl-*.tgz +$ chmod u+x kubefedctl +$ sudo mv kubefedctl /usr/local/bin/ # make sure the location is in the PATH +``` + +**N.B.**: the versions we tested are: 0.1.0-rc6 and 0.2.0-alpha.1, you can try the latest version. + +### KubeFed server (Control Plane) + +To install the Controll Plane, switch to the host context and configuring the RBAC role for Helm (in this case we use Helm v2): + +``` +$ cat << EOF | kubectl apply -f - + apiVersion: v1 + kind: ServiceAccount + metadata: + name: tiller + namespace: kube-system + --- + apiVersion: rbac.authorization.k8s.io/v1 + kind: ClusterRoleBinding + metadata: + name: tiller + roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: cluster-admin + subjects: + - kind: ServiceAccount + name: tiller + namespace: kube-system + EOF +``` + +helm init command: +``` +$ helm init --service-account tiller +``` + +Now it is possible install the Control Plane on the Host Cluster: + +``` +$ helm repo add kubefed-charts https://raw.githubusercontent.com/kubernetes-sigs/kubefed/master/charts +$ helm install kubefed-charts/kubefed --name kubefed --version=0.2.0-alpha.1 --namespace kube-federation-system +``` + +**N.B.**: use the same version for client and server. + +**N.B.**: in this way the Control Plane can find Federated resources in each namespace, to limit this action in a specific namespace add the parameter `--set global.scope=Namespaced`. -- GitLab