membership

package
v1.801.307 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package membership is the LIVE writer-membership source: the K8s Endpoints poll that plugs into internal/org's Source seam so the horizontally-scaled cloud tracks its CHANGING pod set instead of a static list.

It lives OUT of package cloud on purpose. Every subsystem imports cloud for Deps, so cloud's import graph is the floor under all of them; the k8s client pulls 263 packages that only this one file needed. cloud declares the seam (cloud.SetLiveSource) and apps/ installs K8s into it, so a subsystem — and cloud's own tests — compile without the Kubernetes client present at all.

It is the fix for the rolling-upgrade outage: with a static peer set, ha.Owner keeps electing a pod that is draining or already gone, and the shard router forwards an org's requests to a dead pod; a live, READY-gated set drops that pod the moment it starts terminating, so ha.Owner re-elects a live successor and the org stays served.

It is a bounded LIST poll driven by internal/org.Membership's existing refresh loop (which retains the last-good set on a transient error and serves the hot-path AmOwner check lock-free from an atomic snapshot). Each poll re-lists, so a dropped connection self-heals on the next tick — no watch state to wedge.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func K8s

func K8s(selector, port string) (org.Source, string, error)

K8s returns a live membership Source for the given label selector, plus the namespace it is watching. A non-nil error means "not in a cluster" (dev, native-Go) and the caller falls back to its static peer set.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL