From bd92d6ca1fbabf5610b2cec783df8f137a783e7b Mon Sep 17 00:00:00 2001 From: RainbowMango Date: Sat, 28 May 2022 15:39:01 +0800 Subject: [PATCH] Move install development environment to installation docs Signed-off-by: RainbowMango --- docs/installation/installation.md | 73 +++++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 3 deletions(-) diff --git a/docs/installation/installation.md b/docs/installation/installation.md index b18979ea9..b0f49d609 100644 --- a/docs/installation/installation.md +++ b/docs/installation/installation.md @@ -6,11 +6,13 @@ - [Prerequisites](#prerequisites) - [Karmada kubectl plugin](#karmada-kubectl-plugin) - [Install Karmada by Karmada command-line tool](#install-karmada-by-karmada-command-line-tool) - - [Install Karmada in Kubernetes](#install-karmada-in-kubernetes) + - [Install Karmada on your own cluster](#install-karmada-on-your-own-cluster) - [Offline installation](#offline-installation) - [Deploy HA](#deploy-ha) + - [Install Karmada in Kind cluster](#install-karmada-in-kind-cluster) - [Install Karmada by Helm Chart Deployment](#install-karmada-by-helm-chart-deployment) - [Install Karmada from source](#install-karmada-from-source) + - [Install Karmada for development environment](#install-karmada-for-development-environment) @@ -25,7 +27,7 @@ For installation instructions see [installing kubectl-karmada](./install-kubectl ## Install Karmada by Karmada command-line tool -### Install Karmada in Kubernetes +### Install Karmada on your own cluster Assume you have put your cluster's `kubeconfig` file to `$HOME/.kube/config` or specify the path with `KUBECONFIG` environment variable. Otherwise, you should specify the configuration file by @@ -166,4 +168,69 @@ Please refer to [installing by Helm](https://github.com/karmada-io/karmada/tree/ Please refer to [installing from source](./fromsource.md). -[1]: https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/ \ No newline at end of file +[1]: https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/ + +## Install Karmada for development environment + +If you want to try Karmada, we recommend that build a development environment by +`hack/local-up-karmada.sh` which will do following tasks for you: +- Start a Kubernetes cluster by [kind](https://kind.sigs.k8s.io/) to run the Karmada control plane, aka. the `host cluster`. +- Build Karmada control plane components based on a current codebase. +- Deploy Karmada control plane components on the `host cluster`. +- Create member clusters and join Karmada. + +**1. Clone Karmada repo to your machine:** +``` +git clone https://github.com/karmada-io/karmada +``` +or use your fork repo by replacing your `GitHub ID`: +``` +git clone https://github.com//karmada +``` + +**2. Change to the karmada directory:** +``` +cd karmada +``` + +**3. Deploy and run Karmada control plane:** + +run the following script: + +``` +hack/local-up-karmada.sh +``` +This script will do following tasks for you: +- Start a Kubernetes cluster to run the Karmada control plane, aka. the `host cluster`. +- Build Karmada control plane components based on a current codebase. +- Deploy Karmada control plane components on the `host cluster`. +- Create member clusters and join Karmada. + +If everything goes well, at the end of the script output, you will see similar messages as follows: +``` +Local Karmada is running. + +To start using your Karmada environment, run: + export KUBECONFIG="$HOME/.kube/karmada.config" +Please use 'kubectl config use-context karmada-host/karmada-apiserver' to switch the host and control plane cluster. + +To manage your member clusters, run: + export KUBECONFIG="$HOME/.kube/members.config" +Please use 'kubectl config use-context member1/member2/member3' to switch to the different member cluster. +``` + +**4. Check registered cluster** + +``` +kubectl get clusters --kubeconfig=/$HOME/.kube/karmada.config +``` + +You will get similar output as follows: +``` +NAME VERSION MODE READY AGE +member1 v1.23.4 Push True 7m38s +member2 v1.23.4 Push True 7m35s +member3 v1.23.4 Pull True 7m27s +``` + +There are 3 clusters named `member1`, `member2` and `member3` have registered with `Push` or `Pull` mode.