Orleans.Clustering.Kubernetes
8.2.0
dotnet add package Orleans.Clustering.Kubernetes --version 8.2.0
NuGet\Install-Package Orleans.Clustering.Kubernetes -Version 8.2.0
<PackageReference Include="Orleans.Clustering.Kubernetes" Version="8.2.0" />
paket add Orleans.Clustering.Kubernetes --version 8.2.0
#r "nuget: Orleans.Clustering.Kubernetes, 8.2.0"
// Install Orleans.Clustering.Kubernetes as a Cake Addin #addin nuget:?package=Orleans.Clustering.Kubernetes&version=8.2.0 // Install Orleans.Clustering.Kubernetes as a Cake Tool #tool nuget:?package=Orleans.Clustering.Kubernetes&version=8.2.0
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:
- 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); - The service account on the Client pod must be able to access the Kubernetes API server to read objects (
GET
andLIST
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.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- KubernetesClient (>= 15.0.1)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Options (>= 8.0.2)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Orleans.Clustering.Kubernetes:
Package | Downloads |
---|---|
Orleans.Contrib.UniversalSilo
This library provides primitives to set up a configurable, application-agnostic Orleans silo and clients. Use it with the Orleans.Contrib.UniversalSilo.Templates to get started with Orleans. |
|
iotsecurityinfra
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
8.2.0 | 4,776 | 10/17/2024 |
8.0.2 | 14,250 | 8/9/2024 |
8.0.1 | 92,402 | 12/13/2023 |
8.0.0 | 2,121 | 12/12/2023 |
7.1.1 | 148,293 | 3/2/2023 |
7.1.0 | 2,101 | 2/17/2023 |
7.0.0 | 2,725 | 1/19/2023 |
2.1.0 | 393,986 | 12/12/2021 |
2.0.0 | 221,750 | 6/11/2020 |
1.2.2 | 41,081 | 3/22/2020 |
1.2.1 | 28,505 | 2/9/2020 |
1.2.0 | 2,120 | 1/25/2020 |
1.1.1 | 72,392 | 7/9/2019 |
1.1.0 | 8,725 | 3/21/2019 |
1.0.20 | 19,645 | 10/23/2018 |
1.0.19 | 11,383 | 7/10/2018 |
1.0.18 | 4,633 | 3/28/2018 |
1.0.0-rc2-15 | 1,008 | 3/13/2018 |
1.0.0-rc1-13 | 913 | 3/6/2018 |
1.0.0-rc1-11 | 841 | 2/27/2018 |
1.0.0-preview-7 | 1,024 | 2/9/2018 |
1.0.0-preview-5 | 892 | 2/9/2018 |