Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMTLSClient ¶
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.