OrleansContrib/Orleans.Clustering.Kubernetes

Configuration in Samples

srberard opened this issue · 1 comments

I've been having issues getting the Orleans.Clustering.Kubernetes working in my k8s cluster. I've examined the samples but it is not clear how to properly configure this. To this end, I have three questions as follows:

  1. Is there any significance in having unique ports per Orleans silo instance?
    From what I can tell, there is no significance as each instance runs at a separate IP address. Further, the sample code always chooses ports 10025 and 20025 as the seed to Random is always '1':
   .ConfigureEndpoints(new Random(1).Next(10001, 10100), new Random(1).Next(20001, 20100))
  1. In the sample code, there are two projects: one with just silo host and another silo host with the gateway enabled. From what I can tell from the samples, it is not clear the difference between these two. According to the Orleans documentation link, to disable the gateway the port should be set to zero. However, in the silo-only sample the gateway is set to new Random(1).Next(20001, 20100) which is effectively 20025. This can be seen in the following code (from KubeSiloHost):
private static async Task<ISiloHost> StartSilo()
{
    var builder = new SiloHostBuilder()
         .Configure<ClusterOptions>(options =>  { options.ClusterId = "testcluster"; options.ServiceId = "testservice"; })
        .ConfigureEndpoints(new Random(1).Next(10001, 10100), new Random(1).Next(20001, 20100))
        .UseKubeMembership(opt =>
        {
            //opt.APIEndpoint = "http://localhost:8001";
            //opt.CertificateData = "test";
            //opt.APIToken = "test";
            opt.CanCreateResources = true;
            opt.DropResourcesOnInit = true;
        })
        .AddMemoryGrainStorageAsDefault()
        .ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(HelloGrain).Assembly).WithReferences())
        .ConfigureLogging(logging => logging.AddConsole());

    var host = builder.Build();
    await host.StartAsync();
    return host;
}
  1. What is the behavior of setting DropResourcesOnInit to true? Should this be set on all silo host instances? In examining the two silo host samples, KubeSiloHost has this set to true while KubeGatewayHost has this set to false.

Thank you for the assistance.

Please check the new v2.0.0 and the new sample instructions. It got way more simpler now. I'm closing the issue but feel free to re-open if you still have issues. Thanks!