Git Product home page Git Product logo

multi-cluster-networking's Introduction

Multi Cluster Networking (MCN) Operator for Azure

A multi-cluster networking operator for Kubernetes on Azure. The project is still under DRAFT status, and please do not use it in production.

How to deploy the operator

Pre-requisites

  • All member clusters should support service annotation service.beta.kubernetes.io/azure-additional-public-ips (requires out-of-tree cloud provider Azure v0.7.5+, v1.0.2+ or above).

Setup secrets

Create Azure service principal, assign Contributor role to LoadBalancer and Public IP Address for all member clusters, and then create the following cloud-config file:

{
  "cloud": "AzurePublicCloud",
  "tenantId": "<tenantId>",
  "subscriptionId": "<subscriptionId>",
  "aadClientId": "<aadClientId>",
  "aadClientSecret": "<aadClientSecret>",
  "globalLoadBalancerName": "<glbName>",
  "globalVIPLocation": "<region>",
  "globalLoadBalancerResourceGroup": "<resourceGroup>"
}

Finally, create a secret in MCN cluster (it could be any Kubernetes cluster) based on above config file:

kubectl create secret generic azure-mcn-config --from-file=cloud-config --namespace mcn-system

Deploy the operator

After secret setup, build the image and deploy the MCN operator in the same MCN cluster:

IMG=<your-image-registry/image-name> make docker-build docker-push
IMG=<your-image-registry/image-name> make deploy

Cluster Management

Create AKSCluster from existing kubeconfig file and ClusterSet:

kubectl create secret generic aks-cluster --from-file=kubeconfig

# create AKSCluster
cat <<EOF | kubectl apply -f -
apiVersion: networking.aks.io/v1alpha1
kind: AKSCluster
metadata:
  name: aks-cluster
  namespace: default
spec:
  kubeConfigSecret: aks-cluster
EOF

# create ClusterSet
cat <<EOF | kubectl apply -f -
apiVersion: networking.aks.io/v1alpha1
kind: ClusterSet
metadata:
  name: clusterset-sample
spec:
  clusters: ["aks-cluster"]
EOF

GlobalService

Create a GlobalService and bound it to the above ClusterSet:

cat <<EOF | kubectl apply -f -
apiVersion: networking.aks.io/v1alpha1
kind: GlobalService
metadata:
  name: nginx
  namespace: default
spec:
  clusterSet: clusterset-sample
  ports:
  - name: http
    port: 80
    targetPort: 80
    protocol: TCP
EOF

Then create nginx service in member clusters (the MCN operator assumes the service names and namespaces are same by default in all member clusters):

kubectx aks-cluster
kubectl create deployment nginx --image nginx --save-config
kubectl expose deploy nginx --port=80 --type=LoadBalancer
kubectl get service nginx

Switch kubeconfig back to MCN cluster and then verify the VIP for the global service:

$ kubectl get globalservice
NAME    PORTS   VIP            STATE
nginx   80      x.x.x.x        ACTIVE

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

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.