(Jin Qing’s Column, Nov. 3, 2021)
When deployed to a cluster of nodes,
Orleans internally implements a protocol to manage it’s silos,
including discovery, failure and reconfigure,
which is called cluster membership management.
Orleans has clustering membership providers for: Azure, SQL server, Zookeeper.
Clustering provider is one of key aspects of silo configuration.
OrleansContrib/Orleans.Clustering.Kubernetes
is a clustering provider for running Orleans cluster on Kubernetes.
Tell silo to use Kubernetes as the Cluster Membership Provider:
var silo = new SiloBuilder()
...
.UseKubeMembership()
...
.Build();
UseKubeMembership()
instantiates a KubeMembershipTable
which implements
IMembershipTable
.
public interface IMembershipTable
{
Task InitializeMembershipTable(bool tryInitTableVersion);
Task DeleteMembershipTableEntries(string clusterId);
Task CleanupDefunctSiloEntries(DateTimeOffset beforeDate);
Task<MembershipTableData> ReadRow(SiloAddress key);
Task<MembershipTableData> ReadAll();
Task<bool> InsertRow(MembershipEntry entry, TableVersion tableVersion);
Task<bool> UpdateRow(MembershipEntry entry, string etag, TableVersion tableVersion);
Task UpdateIAmAlive(MembershipEntry entry);
}
KubeMembershipTable
access Kubernetes API server to read and write silo entry CRD.
The operators to NamespacedCustomObject are:
Two CRDs, ClusterVersion
and Silo
are defined in files:
Custom resource objects are stored in etcd of Kubernetes.