Leveraging Azure Kubernetes hosting
The Microsoft.Orleans.Hosting.Kubernetes
NuGet package provides support for hosting a Microsoft Orleans application in Azure Kubernetes. ISiloBuilder.UseKubernetesHosting
is the extension method provided by the NuGet package. You can add this NuGet Package to the Distel.WebHost
project and update Program.cs
to use siloBuilder.UseKubernetesHosting()
instead of siloBuilder.UseLocalhostClustering()
, as shown here:
<<Code removed for brevity>> builder.Host.UseOrleans(siloBuilder => { // In Kubernetes, we use environment variables and the pod manifest siloBuilder.UseKubernetesHosting(); }); <<Code removed for brevity>>
The siloBuilder.UseKubernetesHosting()
method will take care of the following steps and hosting an Orleans application in a Kubernetes cluster:
- Setting the
SiloOptions.SiloName
property with the pod name. - Setting the
EndpointOptions...