Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lreimer/hands-on-karmada
Demo repository for Karmada showcase and conference talk.
https://github.com/lreimer/hands-on-karmada
fluxcd karmada kubernetes qaware showcase
Last synced: 2 months ago
JSON representation
Demo repository for Karmada showcase and conference talk.
- Host: GitHub
- URL: https://github.com/lreimer/hands-on-karmada
- Owner: lreimer
- License: mit
- Created: 2024-11-11T16:48:13.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-12T13:46:42.000Z (2 months ago)
- Last Synced: 2024-11-12T14:21:47.029Z (2 months ago)
- Topics: fluxcd, karmada, kubernetes, qaware, showcase
- Language: Makefile
- Homepage:
- Size: 60.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hands-on Karmada
Demo repository for Karmada showcase and conference talk.
## Demo Instructions
### Infrastructure Provisioning
```bash
# we need some CLI tools
brew install --cask google-cloud-sdk
brew install eksctl# create member-01 cluster on GCP
make create-gke-member-01
make bootstrap-flux2-member-01# create member-02 cluster on AWS
make create-eks-member-02
make bootstrap-flux2-member-02# create member-03 cluster on GCP
make create-gke-member-03
make bootstrap-flux2-member-03# create member-04 cluster on AWS
make create-eks-member-04
make bootstrap-flux2-member-04# create member-05 cluster on GCP
make create-gke-member-05
make bootstrap-flux2-member-05```
### Bootstrapping Karmada Fleet
```bash
# make sure the Karmada kubectl CLI is present
k krew install karmada
k karmada --help# bootstrap the Karmada control plane
k ctx rancher-desktop
k karmada init --karmada-data=$PWD/.karmada --karmada-pki=$PWD/.karmada/pki --karmada-apiserver-advertise-address=127.0.0.1 --etcd-storage-mode=emptyDir --cert-external-ip=127.0.0.1
cat examples/kubectl-karmada-init.log# check all components are running and control plane is up
k get all -n karmada-system
k --kubeconfig $PWD/.karmada/karmada-apiserver.config get all
k --kubeconfig $PWD/.karmada/karmada-apiserver.config get clusters# join the member clusters
k karmada --kubeconfig $PWD/.karmada/karmada-apiserver.config join gke-member-01 \
--cluster-kubeconfig=$HOME/.kube/config \
--cluster-context=gke_cloud-native-experience-lab_europe-north1_gke-member-01 \
--cluster-provider=gcp --cluster-region=europe-north1k karmada --kubeconfig $PWD/.karmada/karmada-apiserver.config join eks-member-02 \
--cluster-kubeconfig=$HOME/.kube/config \
--cluster-context=mario-leander.reimer@eks-member-02.eu-north-1.eksctl.io \
--cluster-provider=aws --cluster-region=eu-north-1k karmada --kubeconfig $PWD/.karmada/karmada-apiserver.config join gke-member-03 \
--cluster-kubeconfig=$HOME/.kube/config \
--cluster-context=gke_cloud-native-experience-lab_europe-west1_gke-member-03 \
--cluster-provider=gcp --cluster-region=europe-west1k karmada --kubeconfig $PWD/.karmada/karmada-apiserver.config join eks-member-04 \
--cluster-kubeconfig=$HOME/.kube/config \
--cluster-context=mario-leander.reimer@eks-member-04.eu-central-1.eksctl.io \
--cluster-provider=aws --cluster-region=eu-central-1k --kubeconfig $PWD/.karmada/karmada-apiserver.config get clusters
k --kubeconfig $PWD/.karmada/karmada-apiserver.config get cluster gke-member-01 -o yaml
k --kubeconfig $PWD/.karmada/karmada-apiserver.config get cluster eks-member-02 -o yaml
k --kubeconfig $PWD/.karmada/karmada-apiserver.config get cluster gke-member-03 -o yaml
k --kubeconfig $PWD/.karmada/karmada-apiserver.config get cluster eks-member-04 -o yamlk karmada --kubeconfig $PWD/.karmada/karmada-apiserver.config join gke-member-05 \
--cluster-kubeconfig=$HOME/.kube/config \
--cluster-context=gke_cloud-native-experience-lab_us-east1_gke-member-05 \
--cluster-provider=gcp --cluster-region=us-east1k --kubeconfig $PWD/.karmada/karmada-apiserver.config get clusters
k --kubeconfig $PWD/.karmada/karmada-apiserver.config get cluster gke-member-05 -o yaml
```### Hello Karmada Nginx
```bash
# create deployment in Karmada control plane only
KUBECONFIG=$PWD/.karmada/karmada-apiserver.config k apply -f examples/nginx-deployment.yaml
KUBECONFIG=$PWD/.karmada/karmada-apiserver.config k get all
KUBECONFIG=$PWD/.karmada/karmada-apiserver.config k karmada get deployKUBECONFIG=$PWD/.karmada/karmada-apiserver.config k apply -f examples/propagationpolicy-static-weight.yaml
KUBECONFIG=$PWD/.karmada/karmada-apiserver.config k karmada get deploy
KUBECONFIG=$PWD/.kube/gke-member-01.config k get pods
KUBECONFIG=$PWD/.kube/gke-member-03.config k get podsKUBECONFIG=$PWD/.karmada/karmada-apiserver.config k apply -f examples/nginx-overridepolicy-weight.yaml
KUBECONFIG=$PWD/.karmada/karmada-apiserver.config k karmada get deploy
KUBECONFIG=$PWD/.kube/gke-member-01.config k get pods
KUBECONFIG=$PWD/.kube/gke-member-01.config k describe deploy nginx# more demos
KUBECONFIG=$PWD/.karmada/karmada-apiserver.config k apply -f examples/propagationpolicy-dynamic-weight.yaml
KUBECONFIG=$PWD/.karmada/karmada-apiserver.config k apply -f examples/propagationpolicy-region-field.yaml
```### Cluster Failover and Workload Rebalancer
```bash
# make sure to enable the karmada-descheduler
k karmada addons enable karmada-descheduler --karmada-kubeconfig=$PWD/.karmada/karmada-apiserver.configexport KUBECONFIG=$PWD/.karmada/karmada-apiserver.config
k apply -f examples/nginx-deployment.yaml
k apply -f examples/propagationpolicy-dynamic-weight.yaml
k karmada get deploy# taint cluster to simulate cluster fail-over
k karmada taint clusters gke-member-03 workload-rebalancer-test:NoExecute
k karmada taint clusters gke-member-03 workload-rebalancer-test:NoExecute-k apply -f examples/nginx-workload-rebalancer.yaml
k get workloadrebalancers.apps.karmada.io nginx-rebalancer -o yaml
```### Karmada and Flux
```bash
# first we need to apply the Flux2 CRDs to the Karmada control plane
k apply -k github.com/fluxcd/flux2/manifests/crds\?ref=main --kubeconfig $PWD/.karmada/karmada-apiserver.config# Helm release propagation
k apply -f examples/helmrelease-podinfo.yaml
k apply -f examples/helmrelease-propagation.yaml
k apply -f examples/helmrelease-override.yamlKUBECONFIG=$PWD/.kube/gke-member-01.config k get pods
KUBECONFIG=$PWD/.kube/eks-member-02.config k get pods# Kustomize propagation
k apply -f examples/kustomize-podinfo.yaml
k apply -f examples/kustomize-propagation.yamlKUBECONFIG=$PWD/.kube/gke-member-03.config k get pods
KUBECONFIG=$PWD/.kube/eks-member-04.config k get pods
```### Federated HPA
```bash
# make sure to enable the metrics adapter addon to collect metrics
# from all member clusters
k karmada addons enable karmada-metrics-adapter --karmada-kubeconfig=$PWD/.karmada/karmada-apiserver.configexport KUBECONFIG=$PWD/.karmada/karmada-apiserver.config
k apply -f examples/nginx-deployment.yaml
k apply -f examples/propagation-static-weight.yamlk apply -f examples/nginx-federated-hpa.yaml
k apply -f examples/nginx-federated-cron.yaml# TODO load test demo
# see https://karmada.io/docs/userguide/network/working-with-submariner
# see https://karmada.io/docs/userguide/service/multi-cluster-ingress
```## Maintainer
M.-Leander Reimer (@lreimer),
## License
This software is provided under the MIT open source license, read the `LICENSE`
file for details.