Skip to content

Commit 206330c

Browse files
authored
Merge pull request #26 from Krishiv-Mahajan/failover-tutorial
Update failover example scenario with detailed steps and dividing the setup into small interactive steps
2 parents d1808fc + d28ec31 commit 206330c

26 files changed

Lines changed: 264 additions & 63 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You can enjoy tutorial experience about Karmada with following platforms.
1515
* Try [Installing Karmada on Kubernetes through the Karmada CLI](https://killercoda.com/karmada/scenario/karmada-CLI-installation-example).
1616
* Try [Propagate workload through karmada duplicated mode](https://killercoda.com/karmada/scenario/karmada-HA-Duplicated-Scheduling).
1717
* Try [Propagate workload through karmada divided mode](https://killercoda.com/karmada/scenario/karmada-HA-workload-staticweight).
18-
* Try [Simulate multitype cluster failover through Karmada](https://killercoda.com/karmada/scenario/karmada-Failover-example).
18+
* Try [Simulate multitype cluster failover through Karmada](https://killercoda.com/karmada/scenario/karmada-Cluster-Failover-example).
1919

2020

2121
## Contribution
File renamed without changes.

karmada-Failover-example/foreground.sh renamed to karmada-Cluster-Failover-example/foreground.sh

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -136,23 +136,5 @@ cd nginx
136136
nginxDeployment
137137
propagationPolicy
138138

139-
# create cluster in node01 machine
140-
ssh -o StrictHostKeyChecking=no root@${member_cluster_ip} "bash ~/installKind.sh" &
141-
sleep 10
142-
ssh -o StrictHostKeyChecking=no root@${member_cluster_ip} "bash ~/createCluster.sh" &
143-
sleep 90
144-
145-
# install karmadactl
146-
curl -s https://raw.githubusercontent.com/karmada-io/karmada/master/hack/install-cli.sh | sudo bash
147-
148-
# init karmada, and enable Failover feature gate and eviction feature
149-
karmadactl init --karmada-controller-manager-extra-args="--feature-gates=Failover=true,--enable-no-execute-taint-eviction=true"
150-
151-
# join member clusters
152-
MEMBER_CLUSTER_NAME=kind-member1
153-
karmadactl --kubeconfig /etc/karmada/karmada-apiserver.config join ${MEMBER_CLUSTER_NAME} --cluster-kubeconfig=$HOME/.kube/config-member1 --cluster-context=kind-member1
154-
MEMBER_CLUSTER_NAME=kind-member2
155-
karmadactl --kubeconfig /etc/karmada/karmada-apiserver.config join ${MEMBER_CLUSTER_NAME} --cluster-kubeconfig=$HOME/.kube/config-member2 --cluster-context=kind-member2
156-
157139
# clean screen
158140
clear
File renamed without changes.

karmada-Failover-example/index.json renamed to karmada-Cluster-Failover-example/index.json

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,44 @@
88
},
99
"steps": [
1010
{
11-
"title": "Check member cluster has been joined",
11+
"title": "Environment overview",
1212
"text": "step1/text.md",
1313
"verify": "step1/verify.sh"
1414
},
1515
{
16-
"title": "Check workloads has been deployed",
16+
"title": "Install karmadactl",
1717
"text": "step2/text.md",
1818
"verify": "step2/verify.sh"
1919
},
2020
{
21-
"title": "Simulate cluster failure",
21+
"title": "Initialize Karmada control plane",
2222
"text": "step3/text.md",
2323
"verify": "step3/verify.sh"
2424
},
25+
{
26+
"title": "Prepare member clusters",
27+
"text": "step4/text.md",
28+
"verify": "step4/verify.sh"
29+
},
30+
{
31+
"title": "Join member clusters to the host cluster",
32+
"text": "step5/text.md",
33+
"verify": "step5/verify.sh"
34+
},
35+
{
36+
"title": "Create deployment",
37+
"text": "step6/text.md",
38+
"verify": "step6/verify.sh"
39+
},
40+
{
41+
"title": "Simulate cluster failure",
42+
"text": "step7/text.md",
43+
"verify": "step7/verify.sh"
44+
},
2545
{
2646
"title": "Check the status and quantity distribution of pods and deployments",
27-
"text": "step4/text.md"
47+
"text": "step8/text.md",
48+
"verify": "step8/verify.sh"
2849
}
2950
],
3051
"finish": {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### Environment overview
2+
3+
The environment consists of two hosts:
4+
5+
1. `controlplane`: The host Kubernetes cluster where Karmada runs. The kubeconfig files for the host cluster are located in the `$HOME/.kube` directory.
6+
2. `node01`: Used to create member clusters.
7+
8+
| HostName | Host IP |
9+
| --- | --- |
10+
| controlplane | 172.30.1.2 |
11+
| node01 | 172.30.2.2 |
12+
13+
Note: The current terminal is on the host `controlplane`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
test -f "$HOME/.kube/config"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### Install karmadactl
2+
3+
**Install `karmadactl`:**
4+
5+
RUN `curl -s https://raw.githubusercontent.com/karmada-io/karmada/master/hack/install-cli.sh | sudo bash`{{exec}}
6+
7+
This downloads and installs the `karmadactl` CLI tool from the official Karmada repository.
8+
9+
**Verify installation:**
10+
11+
RUN `karmadactl version`{{exec}}
12+
13+
This confirms that `karmadactl` is installed correctly and shows the installed version.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
karmadactl version

0 commit comments

Comments
 (0)