Giter Club home page Giter Club logo

l2-k3d-multi's Introduction

Linkerd2 Multi-Cluster Demo

This demo uses Linkerd's new multicluster functionality to demonstrate failover & traffic-splitting in a multi-cluster mesh of Kubernetes clusters.

./create.sh initializes a set of clusters in k3d: dev, east, and west.

./install.sh creates a temporary CA and installs Linkerd into these clusters.

We can then deploy the app into the east and west clusters:

:; kubectl --context=k3d-east apply -k east
:; kubectl --context=k3d-west apply -k west

These clusters operate independently by default.

./link.sh configures linkerd-multicluster gateways & service mirrors on each cluster. east and west are configured to discover services from each other. dev is only configured run the web and vote-bot components, and it discovers other services from both east and west.

At this point, we can start our dev setup which uses the voting and emoji services in the east and west clusters:

:; kubectl --context=k3d-dev apply -k dev

We can also route traffic between the east and west clusters. See the commented sections in ./east/kustomization.yml and ./west/kustomization.yml. These configurations can be modified to reroute traffic between clusters!

l2-k3d-multi's People

Contributors

hongbo-miao avatar olix0r avatar zaharidichev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

l2-k3d-multi's Issues

Running on Mac

Hi,

I was able to get the example running on mac using PR #3, but I'm seeing a failure on the link step.

the linkerd mc check command returns this

x remote cluster access credentials are valid
            * failed to connect to API for cluster: [west]: Get "https://172.18.0.6:6443/version?timeout=30s": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
    see https://linkerd.io/checks/#l5d-smc-target-clusters-access for hints
W0511 09:19:44.728000   75418 transport.go:260] Unable to cancel request for promhttp.RoundTripperFunc

x clusters share trust anchors
    Problematic clusters:
    * west: unable to fetch anchors: Get "https://172.18.0.6:6443/api/v1/namespaces/linkerd/configmaps/linkerd-config?timeout=30s": context deadline exceeded
    see https://linkerd.io/checks/#l5d-multicluster-clusters-share-anchors for hints

I see this in the service-mirror logs

time="2021-05-11T15:17:40Z" level=info msg="Received: RepairEndpoints" apiAddress="https://172.18.0.6:6443" cluster=remote
time="2021-05-11T15:17:43Z" level=warning msg="Gateway returned unexpected status 503. Marking as unhealthy" probe-key=west

I'm able to curl between the clusters, so I'm not sure why there is a timeout. Do you have any ideas on what could be causing this?

Errors when kubectl apply

Got these error when kubectl apply

➜ kubectl --context=k3d-east apply -k east
error: map[string]interface {}(nil): yaml: unmarshal errors:
  line 17: mapping key "apiVersion" already defined at line 1
  line 18: mapping key "kind" already defined at line 2
  line 19: mapping key "metadata" already defined at line 3
  line 23: mapping key "spec" already defined at line 7

Here is my kubectl and k3d version if helps.

➜ kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:59:11Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2+k3s1", GitCommit:"5a67e8dc473f8945e8e181f6f0b0dbbc387f6fca", GitTreeState:"clean", BuildDate:"2021-06-21T20:52:44Z", GoVersion:"go1.16.4", Compiler:"gc", Platform:"linux/amd64"}

➜ k3d version
k3d version v4.4.7
k3s version latest (default)

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.