kubernetes

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package kubernetes implements onexmesh registry.Discovery by discovering Pods through Kubernetes EndpointSlices. Registration is a no-op because Pod membership is declared via a Service selector and maintained by the endpoint controller, following cloud-native practice.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDiscovery

func NewDiscovery(opts Options) (registry.Discovery, error)

NewDiscovery creates a Kubernetes Discovery. When Kubeconfig is empty it uses in-cluster configuration (requires RBAC for list/watch endpointslices).

func NewRegistrar

func NewRegistrar(opts Options) (registry.Registrar, error)

NewRegistrar creates a no-op Kubernetes Registrar.

Types

type Options

type Options struct {
	// Namespace is the default namespace for service lookups.
	Namespace string
	// PortName is the default endpoint port name (e.g. "grpc"); empty means
	// the first ready port.
	PortName string
	// Kubeconfig is a path to a kubeconfig file; empty uses in-cluster config.
	Kubeconfig string
	// Services is the explicit mapping from onexmesh service name to a K8s
	// Service/namespace pair. A missing entry yields an error rather than an
	// implicit (and ambiguous) name conversion.
	Services map[string]ServiceRef
}

Options configures the Kubernetes backend.

type ServiceRef

type ServiceRef struct {
	// Namespace overrides Options.Namespace for this service.
	Namespace string
	// Service is the Kubernetes Service name (a DNS-1035 label, no dots).
	Service string
	// PortName selects the endpoint port by name; empty inherits
	// Options.PortName.
	PortName string
}

ServiceRef maps a onexmesh service name to a concrete Kubernetes Service/namespace pair.

Jump to

Keyboard shortcuts

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