Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate more of the Kubernetes hosting experience #8426

Merged

Conversation

ReubenBond
Copy link
Member

@ReubenBond ReubenBond commented May 9, 2023

This PR simplifies the procedure of using the Microsoft.Orleans.Hosting.Kubernetes package by automating more of the process. With this PR, users will no longer need to specify labels or environment variables in their pod specs.

It manages this by:

  • Inferring pod name from Environment.MachineName if not configured via env vars
  • Inferring pod namespace from /var/run/secrets/kubernetes.io/serviceaccount/namespace if not configured via env vars
  • Updating labels on the pod spec during startup to match the internally configured (eg, default) ServiceId & ClusterId if they are not configured via labels
  • Selecting the most appropriate PodIp based on the IANA private IPv4 address ranges if not configured via env vars

Additionally, it filters out non-Active members when performing the on-start purge of unmatched silos. This prevents a race that exists today.

It adds retries to initialization and demotes the Error-level log when Kubernetes drops a watch to Debug (it's not actionable, is common/normal, and is retried indefinitely)

Patching the pod resource (to update labels for discovery) requires the patch verb on the pod's role binding. The package will spit out a log line with an example binding if it receives a permissions error trying to list/get/patch pods

Microsoft Reviewers: Open in CodeFlow

@ReubenBond ReubenBond merged commit a2746fa into dotnet:main May 18, 2023
@ReubenBond ReubenBond deleted the feature/kubernetes-hosting-improvements/1 branch May 18, 2023 15:06
@github-actions github-actions bot locked and limited conversation to collaborators Dec 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant