kubernetes

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: Apache-2.0 Imports: 64 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QPS   = 50
	BURST = 100
)

Variables

View Source
var ErrSecretExists = errors.New("skipped creating secret since it already exists")

Functions

func CertsToSecret

func CertsToSecret(namespace string, certs *crypto.Certificates) []corev1.Secret

CertsToSecret creates secrets in the provided namespace, in compact form, from the provided certs.

func CreateOrUpdateSecrets

func CreateOrUpdateSecrets(ctx context.Context, client client.Client, secrets []corev1.Secret, update bool) ([]corev1.Secret, error)

CreateOrUpdateSecrets creates the provided secrets if they don't exist or updates them if they do.

func KindOf added in v1.4.0

func KindOf(obj interface{}) string

KindOf returns the known kind string for the given Kubernetes object, returns Unknown for the unsupported object.

Supported objects:

GatewayClasses
Gateway
HTTPRoute
TLSRoute
TCPRoute
UDPRoute
GRPCRoute
EnvoyPatchPolicy
ClientTrafficPolicy
BackendTrafficPolicy
SecurityPolicy
BackendTLSPolicy
EnvoyExtensionPolicy
Unstructured (for Extension Policies)

func NewWatchAndReconcileSource added in v1.1.0

func NewWatchAndReconcileSource(cond <-chan struct{}, obj client.Object, eh handler.EventHandler) source.Source

Types

type Mutator added in v1.1.0

type Mutator interface {
	Mutate(obj client.Object) client.Object
}

Mutator is an interface to hold mutator functions for status updates.

type MutatorFunc added in v1.1.0

type MutatorFunc func(client.Object) client.Object

MutatorFunc is a function adaptor for Mutators.

func (MutatorFunc) Mutate added in v1.1.0

func (m MutatorFunc) Mutate(old client.Object) client.Object

Mutate adapts the MutatorFunc to fit through the Mutator interface.

type NamespaceGetter added in v0.6.0

type NamespaceGetter interface {
	GetNamespace() string
}

type ObjectKindNamespacedName

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

type OfflineGatewayAPIReconciler added in v1.4.0

type OfflineGatewayAPIReconciler struct {
	Client client.Client
	// contains filtered or unexported fields
}

OfflineGatewayAPIReconciler can be used for non-kuberetes provider. It can let other providers to have the same reconcile logic without rely on apiserver.

func NewOfflineGatewayAPIController added in v1.4.0

func NewOfflineGatewayAPIController(
	ctx context.Context, cfg *config.Server, su Updater, resources *message.ProviderResources,
) (*OfflineGatewayAPIReconciler, error)

func (*OfflineGatewayAPIReconciler) Reconcile added in v1.4.0

Reconcile calls reconcile method in gateway-api controller, this method should be called manually.

type Provider

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

Provider is the scaffolding for the Kubernetes provider. It sets up dependencies and defines the topology of the provider and its managed components, wiring them together.

func New

func New(ctx context.Context, restCfg *rest.Config, svrCfg *ec.Server, resources *message.ProviderResources) (*Provider, error)

New creates a new Provider from the provided EnvoyGateway.

func (*Provider) Start

func (p *Provider) Start(ctx context.Context) error

Start starts the Provider synchronously until a message is received from ctx.

func (*Provider) Type added in v1.2.0

func (p *Provider) Type() egv1a1.ProviderType

type ProxyTopologyInjector added in v1.4.0

type ProxyTopologyInjector struct {
	client.Client
	Decoder admission.Decoder
}

func (*ProxyTopologyInjector) Handle added in v1.4.0

type Update added in v1.1.0

type Update struct {
	NamespacedName types.NamespacedName
	Resource       client.Object
	Mutator        Mutator
}

Update contains an all the information needed to update an object's status. Send down a channel to the goroutine that actually writes the changes back.

type UpdateHandler added in v1.1.0

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

UpdateHandler holds the details required to actually write an Update back to the referenced object.

func NewUpdateHandler added in v1.1.0

func NewUpdateHandler(log logr.Logger, client client.Client) *UpdateHandler

func (*UpdateHandler) NeedLeaderElection added in v1.1.0

func (u *UpdateHandler) NeedLeaderElection() bool

func (*UpdateHandler) Start added in v1.1.0

func (u *UpdateHandler) Start(ctx context.Context) error

Start runs the goroutine to perform status writes.

func (*UpdateHandler) Writer added in v1.1.0

func (u *UpdateHandler) Writer() Updater

Writer retrieves the interface that should be used to write to the UpdateHandler.

type UpdateWriter added in v1.1.0

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

UpdateWriter takes status updates and sends these to the UpdateHandler via a channel.

func (*UpdateWriter) Send added in v1.1.0

func (u *UpdateWriter) Send(update Update)

Send sends the given Update off to the update channel for writing by the UpdateHandler.

type Updater added in v1.1.0

type Updater interface {
	Send(u Update)
}

Updater describes an interface to send status updates somewhere.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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