Deploying Applications to Multiple Clusters with Static Weight Scheduling
This tutorial will walk you through how to deploy applications to multiple clusters with static weight scheduling. It is
different from replication scheduling. When using static weight scheduling, the replicas of an application will be split
based on cluster weights. For example, if you want to deploy a Deployment
with 6 replicas to 2 clusters (“cluster-01”
with weight 1, “cluster-02” with weight 2), then “cluster-01” will run such a Deployment
with 2 replicas, “cluster-02”
runs the other 4 replicas.
Defining Your Applications
Let’s see an example using static weight scheduling. Below Subscription
“static-dividing-scheduling-demo” defines the
target child clusters to be distributed to, and the resources to be deployed with.
The Deployment
bar/my-nginx above will run in two clusters with a total of 6 replicas, while 2 replicas run in cluster
with ID dc91021d-2361-4f6d-a404-7c33b9e01118
, 4 replicas in cluster with ID 5f9da921-0437-4fea-a89d-42aa1ede9b25
.
You can get the scheduling result by checking the status of Subscription static-dividing-scheduling-demo
.
Before applying this Subscription
, please
modify examples/static-dividing-scheduling/subscription.yaml
with your clusterID.
If you want to apply overrides per cluster, please follow How to Set Overrides in Clusternet.
Applying Your Applications
After installing kubectl plugin kubectl-clusternet, you could run commands below to distribute this application to child clusters.
You can check aggregated status of feeds/resources running in each child clusters.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.