Propagate a deployment by Karmada
This guide will cover:
karmadacontrol plane components in a Kubernetes cluster which is known as
- Join a member cluster to
- Propagate an application by using
Install the Karmada control plane
1. Clone this repo to your machine:
git clone https://github.com/karmada-io/karmada
2. Change to the karmada directory:
3. Deploy and run Karmada control plane:
run the following script:
This script will do following tasks for you:
- Start a Kubernetes cluster to run the Karmada control plane, aka. the
- Build Karmada control plane components based on a current codebase.
- Deploy Karmada control plane components on the
- 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:
Please use 'kubectl config use-context karmada-host/karmada-apiserver' to switch the host and control plane cluster.
To manage your member clusters, run:
Please use 'kubectl config use-context member1/member2/member3' to switch to the different member cluster.
There are two contexts in Karmada:
kubectl config use-context karmada-apiserver
kubectl config use-context karmada-host
karmada-apiserver is the main kubeconfig to be used when interacting with the Karmada control plane, while
karmada-host is only used for debugging Karmada installation with the host cluster. You can check all clusters at any time by running:
kubectl config view. To switch cluster contexts, run
kubectl config use-context [CONTEXT_NAME]
In the following steps, we are going to propagate a deployment by Karmada.
1. Create nginx deployment in Karmada.
First, create a deployment named
kubectl create -f samples/nginx/deployment.yaml
2. Create PropagationPolicy that will propagate nginx to member cluster
Then, we need to create a policy to propagate the deployment to our member cluster.
kubectl create -f samples/nginx/propagationpolicy.yaml
3. Check the deployment status from Karmada
You can check deployment status from Karmada, don't need to access member cluster:
$ kubectl get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
nginx 2/2 2 2 20s