All Projects → OrleansContrib → Orleans.clustering.kubernetes

OrleansContrib / Orleans.clustering.kubernetes

Licence: mit
Orleans Membership provider for Kubernetes

Projects that are alternatives of or similar to Orleans.clustering.kubernetes

Minecase
Minecraft server based on Orleans
Stars: ✭ 581 (+315%)
Mutual labels:  orleans, actor-model, dotnet-core, distributed-systems
Gosiris
An actor framework for Go
Stars: ✭ 222 (+58.57%)
Mutual labels:  actor-model, distributed-systems, distributed-computing
tutorial
Tutorials to help you build your first Swim app
Stars: ✭ 27 (-80.71%)
Mutual labels:  distributed-systems, actor-model, distributed-computing
Dasync
Every developer deserves the right of creating microservices without using any framework 🤍
Stars: ✭ 154 (+10%)
Mutual labels:  azure, actor-model, distributed-systems
ripple
Simple shared surface streaming application
Stars: ✭ 17 (-87.86%)
Mutual labels:  distributed-systems, actor-model, distributed-computing
protoactor-go
Proto Actor - Ultra fast distributed actors for Go, C# and Java/Kotlin
Stars: ✭ 4,138 (+2855.71%)
Mutual labels:  distributed-systems, actor-model, distributed-computing
Orleans.CosmosDB
Orleans providers for Azure Cosmos DB
Stars: ✭ 36 (-74.29%)
Mutual labels:  actor-model, distributed-computing, orleans
road-to-orleans
This repository illustrates the road to orleans with practical, real-life examples. From most basic, to more advanced techniques.
Stars: ✭ 55 (-60.71%)
Mutual labels:  distributed-systems, actor-model, orleans
Orleans
Orleans is a cross-platform framework for building distributed applications with .NET
Stars: ✭ 8,131 (+5707.86%)
Mutual labels:  orleans, actor-model, distributed-systems
Developing Solutions Azure Exam
This repository contains resources for the Exam AZ-203: Developing Solutions for Microsoft Azure. You can find direct links to resources and and practice resources to test yourself ☁️🎓📚
Stars: ✭ 59 (-57.86%)
Mutual labels:  azure, dotnet-core
Aspnetboilerplate Core Ng
Tutorial for ASP.NET Boilerplate Core + Angular
Stars: ✭ 61 (-56.43%)
Mutual labels:  azure, dotnet-core
Private Aks Cluster
This sample shows how to create a private AKS cluster in a virtual network along with a jumpbox virtual machine.
Stars: ✭ 63 (-55%)
Mutual labels:  azure, kubernetes-cluster
Distributedsystem Series
📚 深入浅出分布式基础架构,Linux 与操作系统篇 | 分布式系统篇 | 分布式计算篇 | 数据库篇 | 网络篇 | 虚拟化与编排篇 | 大数据与云计算篇
Stars: ✭ 1,092 (+680%)
Mutual labels:  distributed-systems, distributed-computing
Protoactor Dotnet
Proto Actor - Ultra fast distributed actors for Go, C# and Java/Kotlin
Stars: ✭ 1,070 (+664.29%)
Mutual labels:  distributed-systems, distributed-computing
Orleans.activities
Workflow Foundation (.Net 4.x System.Activities workflows) over Microsoft Orleans framework, providing stable, long-running, extremely scalable processes with XAML designer support.
Stars: ✭ 61 (-56.43%)
Mutual labels:  orleans, actor-model
Orleanstestkit
Unit Test Toolkit for Microsoft Orleans
Stars: ✭ 42 (-70%)
Mutual labels:  orleans, dotnet-core
Microdot
Microdot: An open source .NET microservices framework
Stars: ✭ 1,222 (+772.86%)
Mutual labels:  orleans, distributed-systems
Azurestorageexplorer
☁💾 Manage your Azure Storage blobs, tables, queues and file shares from this simple and intuitive web application.
Stars: ✭ 88 (-37.14%)
Mutual labels:  azure, dotnet-core
Maximerouiller.azure.appservice.easyauth
.NET Core integration of Azure AppService EasyAuth
Stars: ✭ 38 (-72.86%)
Mutual labels:  azure, dotnet-core
Distributedsystems
My Distributed Systems references
Stars: ✭ 67 (-52.14%)
Mutual labels:  distributed-systems, distributed-computing

Orleans.Clustering.Kubernetes

Orleans Clustering Provider for Kubernetes

CI NuGet

Orleans is a framework that provides a straight-forward approach to building distributed high-scale computing applications, without the need to learn and apply complex concurrency or other scaling patterns.

Kubernetes (a.k.a. Kube or just K8s) is an open-source system for automating deployment, scaling, and management of containerized applications. In other words, it is one of the most popular container orchestrators out there.

Orleans.Clustering.Kubernetes is a package that use Kubernetes as a backend for Cluster Membership, making it easy to run Orleans clusters on top of Kubernetes.

TL;DR

If you want to quickly test it, clone this repo and go to the Samples Directory for instructions on how to run a sample cluster.

Overview

Kubernetes has multiple ways to extend its API and one of those ways allow you to easily add custom data structures to it so it can be consumed later on by applications. Those objects are called Custom Resources (CRD). The objects created based on CRDs are backed by the internal etcd instance part of every Kubernetes deployment.

Two CRDs are created by this provider in order to store the Cluster Membership objects to comply with Orleans Extended Cluster Membership Protocol. ClusterVersion and Silo. Examples on how to install each CRD can be found under the samples folder.

Those objects can be created at startup of the first silo in the cluster or, manually created by regular .yaml files. The package includes the two files with the required specs for each one. They must be deployed into the cluster before any Orleans application is deployed with this provider.

This provider uses only Kubernetes API Server to create/read those objects. By default, it uses the In Cluster API endpoint which is available on each pod.

From the security perspective, the provider uses whatever serviceaccount configured for the Kubernetes Deployment object by reading the API credentials from the pod itself.

Installation

Installation is performed via NuGet

From Package Manager:

PS> Install-Package Orleans.Clustering.Kubernetes

.Net CLI:

# dotnet add package Orleans.Clustering.Kubernetes

Paket:

# paket add Orleans.Clustering.Kubernetes

Configuration

A functional Kubernetes cluster is required for this provider to work. If you don't have one yet, there are multiple (and mostly complicated) ways to deploy Kubernetes for production use and it is out of scope of this provider as there are many articles around the web on how to do it. However, if you are playing with Docker and Kubernetes for the first time or you want to build a development box, Scott Hanselman has a nice article showing how to easily setup Docker for Windows with Kubernetes on your machine. Although it shows Windows 10, it can be easily adopted to Mac OSX as well.

Custom Resource Definitions

You need to apply both .yaml files from the package before starting the silo. It must be done once per Kubernetes cluster.

Note: You can also deploy the CRDs from the files on the Definitions directory on this repo.

Silo

Tell Orleans runtime that we are going to use Kubernetes as our Cluster Membership Provider:

var silo = new SiloBuilder()
        ...
        .UseKubeMembership()
        ...
        .Build();

Client

Now that our silo is up and running, the Orleans client needs to connect to the Kubernetes to look for Orleans Gateways.

var client = new ClientBuilder()
        ...
        .UseKubeGatewayListProvider() // Optionally use the configure delegate to specify the namespace where you cluster is running.
        ...
        .Build();

The provider will discover the cluster based on the kubernetes namespace the silo pod is running. In the case of the client, if a configure delegate with the Namespace property set to a non-null value is specified, it will ignore the current running pod namespace and will try to use that namespace instead.

Great! Now enjoy your Orleans application running within a Kubernetes cluster without needing an external membership provider!

Security considerations

This provider behaves like any regular application being hosted on Kubernetes. That means it doesn't care about the underlying kubernetes security model. In this particular provider however, it expects the pod to have access to the API server. Usually this access is granted to the service account being used by the POD (for more on that check Kubernetes docs for service accounts) by enabling RBAC or whatever other authorization plugin your cluster is using.

Regardless of the authorization plugin being used, ensure the following:

  1. The service account on the Silo pod has access to the Kubernetes API server to read and write objects (essentially GET, LIST, PUT, DELETE, POST permissions);
  2. The service account on the Client pod must be able to access the Kubernetes API server to read objects (GETand LIST permissions).

Contributions

PRs and feedback are very welcome! This repo follows the same contributions guideline as Orleans does and github issues will have help-wanted topics as they are coming.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].