k8s

package
v0.14.9 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MLSecretKeyName = "secretkey"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ForceSync        func()
	BGPEventCallback func(interface{})
	// contains filtered or unexported fields
}

Client watches a Kubernetes cluster and translates events into Controller method calls.

func New added in v0.4.0

func New(cfg *Config) (*Client, error)

New connects to masterAddr, using kubeconfig to authenticate.

The client uses processName to identify itself to the cluster (e.g. when logging events).

func (*Client) CreateMlSecret added in v0.10.0

func (c *Client) CreateMlSecret(namespace, controllerDeploymentName, secretName string) error

CreateMlSecret create the memberlist secret.

func (*Client) Errorf

func (c *Client) Errorf(svc *corev1.Service, kind, msg string, args ...interface{})

Errorf logs an error event about svc to the Kubernetes cluster.

func (*Client) Infof

func (c *Client) Infof(svc *corev1.Service, kind, msg string, args ...interface{})

Infof logs an informational event about svc to the Kubernetes cluster.

func (*Client) PodIPs added in v0.9.4

func (c *Client) PodIPs(namespace, labels string) ([]string, error)

PodIPs returns the IPs of all the pods matched by the labels string.

func (*Client) Run

func (c *Client) Run(stopCh <-chan struct{}) error

Run watches for events on the Kubernetes cluster, and dispatches calls to the Controller.

func (*Client) UpdateStatus

func (c *Client) UpdateStatus(svc *corev1.Service) error

UpdateStatus writes the protected "status" field of svc back into the Kubernetes cluster.

type Config added in v0.6.0

type Config struct {
	ProcessName         string
	NodeName            string
	PodName             string
	MetricsHost         string
	MetricsPort         int
	EnablePprof         bool
	ReadEndpoints       bool
	Logger              log.Logger
	Namespace           string
	ValidateConfig      config.Validate
	EnableWebhook       bool
	WebHookMinVersion   uint16
	WebHookCipherSuites []uint16
	DisableCertRotation bool
	WebhookSecretName   string
	CertDir             string
	CertServiceName     string
	LoadBalancerClass   string
	WebhookWithHTTP2    bool
	WithFRRK8s          bool
	FRRK8sNamespace     string
	Listener
	Layer2StatusChan    <-chan event.GenericEvent
	Layer2StatusFetcher controllers.StatusFetcher
}

Config specifies the configuration of the Kubernetes client/watcher.

type Listener added in v0.13.0

type Listener struct {
	sync.Mutex
	ServiceChanged func(log.Logger, string, *v1.Service, []discovery.EndpointSlice) controllers.SyncState
	ConfigChanged  func(log.Logger, *config.Config) controllers.SyncState
	PoolChanged    func(log.Logger, *config.Pools) controllers.SyncState
	NodeChanged    func(log.Logger, *v1.Node) controllers.SyncState
}

func (*Listener) ConfigHandler added in v0.13.0

func (l *Listener) ConfigHandler(logger log.Logger, config *config.Config) controllers.SyncState

func (*Listener) NodeHandler added in v0.13.0

func (l *Listener) NodeHandler(logger log.Logger, node *v1.Node) controllers.SyncState

func (*Listener) PoolHandler added in v0.13.0

func (l *Listener) PoolHandler(logger log.Logger, pools *config.Pools) controllers.SyncState

func (*Listener) ServiceHandler added in v0.13.0

func (l *Listener) ServiceHandler(logger log.Logger, serviceName string, svc *v1.Service, epSlices []discovery.EndpointSlice) controllers.SyncState

Directories

Path Synopsis
webhooks

Jump to

Keyboard shortcuts

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