agent

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 36 Imported by: 5

Documentation

Overview

Copyright 2024 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLeaseInformerWithMetrics added in v0.31.0

func NewLeaseInformerWithMetrics(client kubernetes.Interface, namespace string, resyncPeriod time.Duration) cache.SharedIndexInformer

Types

type Client added in v0.0.16

type Client struct {
	// contains filtered or unexported fields
}

Client runs on the node network side. It connects to proxy server and establishes a stream connection from which it sends and receives network traffic.

func (*Client) Close added in v0.0.16

func (a *Client) Close()

Close closes the Connect gRPC connection.

func (*Client) Connect added in v0.0.16

func (a *Client) Connect() (int, error)

Connect makes the grpc dial to the proxy server. It returns the serverID it connects to.

func (*Client) Recv added in v0.0.16

func (a *Client) Recv() (*client.Packet, error)

func (*Client) Send added in v0.0.16

func (a *Client) Send(pkt *client.Packet) error

func (*Client) Serve added in v0.0.16

func (a *Client) Serve()

Serve starts to serve proxied requests from proxy server over the gRPC stream. Successful Connect is required before Serve. The The requests include things like opening a connection to a server, streaming data and close the connection.

type ClientSet

type ClientSet struct {
	// contains filtered or unexported fields
}

ClientSet consists of clients connected to each instance of an HA proxy server.

func (*ClientSet) AddClient

func (cs *ClientSet) AddClient(serverID string, c *Client) error

func (*ClientSet) ClientsCount

func (cs *ClientSet) ClientsCount() int

func (*ClientSet) HasID

func (cs *ClientSet) HasID(serverID string) bool

func (*ClientSet) HealthyClientsCount

func (cs *ClientSet) HealthyClientsCount() int

func (*ClientSet) Ready added in v0.1.4

func (cs *ClientSet) Ready() bool

func (*ClientSet) RemoveClient

func (cs *ClientSet) RemoveClient(serverID string)

func (*ClientSet) Serve

func (cs *ClientSet) Serve()

func (*ClientSet) ServerCount added in v0.31.0

func (cs *ClientSet) ServerCount() int

type ClientSetConfig

type ClientSetConfig struct {
	Address                 string
	AgentID                 string
	AgentIdentifiers        string
	SyncInterval            time.Duration
	ProbeInterval           time.Duration
	SyncIntervalCap         time.Duration
	DialOptions             []grpc.DialOption
	ServiceAccountTokenPath string
	WarnOnChannelLimit      bool
	SyncForever             bool
	XfrChannelSize          int
	ServerLeaseCounter      ServerCounter
	ServerCountSource       string
}

func (*ClientSetConfig) NewAgentClientSet

func (cc *ClientSetConfig) NewAgentClientSet(drainCh, stopCh <-chan struct{}) *ClientSet

type DuplicateServerError added in v0.0.27

type DuplicateServerError struct {
	ServerID string
}

func (*DuplicateServerError) Error added in v0.0.27

func (dse *DuplicateServerError) Error() string

type HealthChecker added in v0.1.4

type HealthChecker interface {
	Name() string
	Check(req *http.Request) error
}

HealthChecker represents an entity capable of performing health checks.

var Ping HealthChecker = &ping{}
var ServerConnected HealthChecker = &serverConnected{}

func NewServerConnected added in v0.1.4

func NewServerConnected(cs ReadinessManager) HealthChecker

type ReadinessManager added in v0.1.4

type ReadinessManager interface {
	// Ready returns true the proxy server is ready.
	Ready() bool
}

ReadinessManager supports checking if the agent is ready.

type ServerCounter added in v0.31.1

type ServerCounter interface {
	Count() int
}

type ServerLeaseCounter added in v0.31.0

type ServerLeaseCounter struct {
	// contains filtered or unexported fields
}

A ServerLeaseCounter counts leases in the k8s apiserver to determine the current proxy server count.

func NewServerLeaseCounter added in v0.31.0

func NewServerLeaseCounter(pc clock.PassiveClock, leaseLister coordinationv1lister.LeaseLister, labelSelector labels.Selector) *ServerLeaseCounter

NewServerLeaseCounter creates a server counter that counts valid leases that match the label selector and provides the fallback count (initially 0) if this fails.

func (*ServerLeaseCounter) Count added in v0.31.0

func (lc *ServerLeaseCounter) Count() int

Count counts the number of leases in the apiserver matching the provided label selector.

In the event that no valid leases are found or lease listing fails, the fallback count is returned. This fallback count is updated upon successful discovery of valid leases.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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