adminapi

package
v2.4.0-rapid.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMTLSClient

func NewMTLSClient(address, serverName string, certPEM, keyPEM, caPEM []byte) (*kong.Client, error)

NewMTLSClient returns a Kong Admin API client for the given address, verifying the server certificate against the provided CA certificate (PEM) using serverName as the TLS SNI, and authenticating with the provided client certificate and key (PEM). It is used to push configuration to Admin APIs secured with mTLS, e.g. the Admin API of the AIGatewayDataPlanes referenced by an OnPremAIGateway.

Types

type DiscoveredAdminAPI

type DiscoveredAdminAPI struct {
	// Address format is https://10.68.0.5:8444.
	Address string
	// TLSServerName format is pod.dataplane-admin-kong-rqwr9-sc49t.default.svc.
	TLSServerName string
	// PodRef is the reference to the Pod with the above IP address.
	PodRef k8stypes.NamespacedName
}

DiscoveredAdminAPI represents an Admin API discovered from a Kubernetes Service. For field Address use format https://<podIP>:<port>, and for field TLSServerName use format pod.<serviceName>.<namespace>.svc.

type Discoverer

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

Discoverer discovers Admin API endpoints from Kubernetes EndpointSlices belonging to Admin API Services.

func NewDiscoverer

func NewDiscoverer(
	adminAPIPortNames sets.Set[string],
) (*Discoverer, error)

NewDiscoverer creates a new Discoverer. adminAPIPortNames is the set of port names that Admin API Service ports will be matched against.

func (*Discoverer) AdminAPIsFromEndpointSlice

func (d *Discoverer) AdminAPIsFromEndpointSlice(
	endpoints discoveryv1.EndpointSlice,
) (sets.Set[DiscoveredAdminAPI], error)

AdminAPIsFromEndpointSlice returns a list of Admin APIs when given an EndpointSlice.

func (*Discoverer) GetAdminAPIsForService

func (d *Discoverer) GetAdminAPIsForService(
	ctx context.Context,
	kubeClient client.Client,
	service k8stypes.NamespacedName,
) (sets.Set[DiscoveredAdminAPI], error)

GetAdminAPIsForService performs an endpoint lookup, using provided kubeClient to list provided Admin API Service EndpointSlices. The retrieved EndpointSlices' ports are compared with the provided portNames set.

The list is not paginated: the label selector scopes it to a single Service's EndpointSlices, and pagination options (Limit/Continue) are not supported by controller-runtime's cache-backed clients, which this is also called with.

Jump to

Keyboard shortcuts

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