Giter Site home page Giter Site logo

iyersk / multi-cluster Goto Github PK

View Code? Open in Web Editor NEW

This project forked from learnk8s/multi-cluster

0.0 0.0 0.0 6.04 MB

Creating and connecting multiple Kubernetes clusters using Terraform, Karmada & Istio

Shell 0.08% JavaScript 0.23% HTML 99.32% HCL 0.37%

multi-cluster's Introduction

Multi-cluster, multi-region, multi-cloud Kubernetes

This project helps you bootstrap and orchestrate several Kubernetes clusters across different regions and clouds from a single control plane.

Scaling Kubernetes clusters across regions and clouds

The setup helps study:

  • High availability installation of Kubernetes.
  • Multi-region deployments.
  • Multi-cloud deployments.
  • Upgrading clusters and apps.

Getting started

You need to create a Linode token to access the API:

linode-cli profile token-create
export LINODE_TOKEN=<insert the token here>
# Create the clusters
terraform -chdir=01-clusters init
terraform -chdir=01-clusters apply -auto-approve

# Install Karmada in the cluster manager
terraform -chdir=02-karmada init
terraform -chdir=02-karmada apply -auto-approve

# Configure the Karmada workers and install Istio
terraform -chdir=03-workers init
terraform -chdir=03-workers apply -auto-approve

# Discover other Istio installations
terraform -chdir=04-discovery init
terraform -chdir=04-discovery apply -auto-approve

# Install Kiali
terraform -chdir=05-dashboards init
terraform -chdir=05-dashboards apply -auto-approve

# Clean up
terraform -chdir=05-dashboards destroy -auto-approve
terraform -chdir=04-discovery destroy -auto-approve
terraform -chdir=03-workers destroy -auto-approve
terraform -chdir=02-karmada destroy -auto-approve
terraform -chdir=01-clusters destroy -auto-approve

Accessing the Kiali dashboard

kubectl --kubeconfig=kubeconfig-ap port-forward svc/kiali 8081:20001 -n istio-system

Testing the code

./test.sh

The script will print the command you can use to launch the world map dashboard.

Creating new certs

$ git clone https://github.com/istio/istio

Create a certs folder and change to that directory:

$ mkdir certs
$ cd certs

Create the root certificate with:

$ make -f ../istio/tools/certs/Makefile.selfsigned.mk root-ca

The command generated the following files:

  • root-cert.pem: the generated root certificate.
  • root-key.pem: the generated root key.
  • root-ca.conf: the configuration for OpenSSL to generate the root certificate.
  • root-cert.csr: the generated CSR for the root certificate.

For each cluster, generate an intermediate certificate and key for the Istio Certificate Authority:

$ make -f ../istio/tools/certs/Makefile.selfsigned.mk cluster1-cacerts
$ make -f ../istio/tools/certs/Makefile.selfsigned.mk cluster2-cacerts
$ make -f ../istio/tools/certs/Makefile.selfsigned.mk cluster3-cacerts

Notes

  • Sometimes, the EastWest gateway cannot be created because of a validation admission webhook. Since this is sporadic, I think it's related to a race condition. More on this here.
  • This Terraform files use the null_resource and kubectl. You should have kubectl installed locally.

multi-cluster's People

Contributors

danielepolencic 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.