Code Monkey home page Code Monkey logo

rancher-k3s-fleet-examples's Introduction

Code examples for Talk about Multi-Cluster Kubernetes Management with Rancher, K3S and Fleet

Installation steps

  1. Setup infrastructure

Fill out terraform-setup/terraform.tfvars with aws and digital ocean credentials.

make step_01
  1. Create 3 Node HA Cluster for Rancher
make step_02
  1. Install cert-manager and Rancher
make step_03
  1. Create 3 single-node downstream k3s clusters
make step_04

Configure Rancher

Go to https://rancher-demo.plgrnd.be/login and set up admin password and server url.

Add 3 downstream clusters to Rancher

"Add Cluster" -> "Register an existing Kubernetes cluster" => "Other Cluster"

Add "group" label with values "amd" and "arm".

To register every cluster run

./run_on.sh [3-5] kubectl apply ....

Wait until all clusters are read.

Configure Fleet

Go to "Cluster Explorer" of local cluster -> "Continuous Delivery"

Add arm and amd Cluster Groups matching the cluster labels from above in "fleet-default".

Use fleet

Get Download Kubeconfig from all clusters.

Commands to watch clusters

watch kubectl --kubeconfig kubeconfig_cluster_one --insecure-skip-tls-verify get nodes,pods -A
watch kubectl --kubeconfig kubeconfig_cluster_two --insecure-skip-tls-verify get nodes,pods -A
watch kubectl --kubeconfig kubeconfig_cluster_three --insecure-skip-tls-verify get nodes,pods -A

Upgrade all clusters

Add Git repo to deploy system-upgrade-controller Repo: https://github.com/rancher/system-upgrade-controller Path: manifests All clusters.

Add Git Repo to deploy upgrade Plan Repo: https://github.com/bashofmann/rancher-k3s-fleet-examples Path: fleet-upgrades Only amd clusters

  • Deploy upgrade plan

Add Git Repo to deploy rest Repo: https://github.com/bashofmann/rancher-k3s-fleet-examples Path: fleet-examples All clusters

Deploy applications

  • Add hello-world example
  • Open webapp on nodeports
  • Update hello-world example with overlays
  • Show that on arm cluster the color changed
  • Deploy netdata
  • Change gitrepo cluster selector

Cleanup

To remove everything

make destroy

rancher-k3s-fleet-examples's People

Contributors

bashofmann avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.