ambient

package
v0.0.0-...-af99183 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Overview

nolint: gocritic

nolint: gocritic

nolint: gocritic

nolint: gocritic

nolint: gocritic

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendNonNil

func AppendNonNil[T any](data []T, i *T) []T

func FindPortName

func FindPortName(pod *v1.Pod, name string) (int32, bool)

func GetPodCondition

func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)

func GetPodConditionFromList

func GetPodConditionFromList(conditions []v1.PodCondition, conditionType v1.PodConditionType) (int, *v1.PodCondition)

GetPodConditionFromList extracts the provided condition from the given list of condition and returns the index of the condition and the condition. Returns -1 and nil if the condition is not present.

func GetPodReadyCondition

func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition

func IsPodPending

func IsPodPending(pod *v1.Pod) bool

func IsPodReady

func IsPodReady(pod *v1.Pod) bool

IsPodReady is copied from kubernetes/pkg/api/v1/pod/utils.go

func IsPodReadyConditionTrue

func IsPodReadyConditionTrue(status v1.PodStatus) bool

IsPodReadyConditionTrue returns true if a pod is ready; false otherwise.

func IsPodRunning

func IsPodRunning(pod *v1.Pod) bool

func MeshConfigCollection

func MeshConfigCollection(ConfigMaps krt.Collection[*v1.ConfigMap], options Options) krt.Singleton[MeshConfig]

func PushXds

func PushXds[T any](xds model.XDSUpdater, f func(T) model.ConfigKey) func(events []krt.Event[T], initialSync bool)

func WaypointsCollection

func WaypointsCollection(
	Gateways krt.Collection[*v1beta1.Gateway],
	GatewayClasses krt.Collection[*v1beta1.GatewayClass],
	Pods krt.Collection[*v1.Pod],
) krt.Collection[Waypoint]

Types

type InboundBinding

type InboundBinding struct {
	Port     uint32
	Protocol workloadapi.ApplicationTunnel_Protocol
}

type Index

type Index interface {
	Lookup(key string) []model.AddressInfo
	All() []model.AddressInfo
	WorkloadsForWaypoint(key model.WaypointKey) []model.WorkloadInfo
	ServicesForWaypoint(key model.WaypointKey) []model.ServiceInfo
	SyncAll()
	HasSynced() bool
	model.AmbientIndexes
}

func New

func New(options Options) Index

type LookupNetwork

type LookupNetwork func(endpointIP string, labels labels.Instance) network.ID

type MeshConfig

type MeshConfig struct {
	*meshapi.MeshConfig
}

func (MeshConfig) Equals

func (m MeshConfig) Equals(other MeshConfig) bool

func (MeshConfig) ResourceName

func (m MeshConfig) ResourceName() string

type Options

type Options struct {
	Client kubeclient.Client

	Revision        string
	SystemNamespace string
	DomainSuffix    string
	ClusterID       cluster.ID
	XDSUpdater      model.XDSUpdater
	LookupNetwork   LookupNetwork
}

type Waypoint

type Waypoint struct {
	krt.Named

	// Addresses this Waypoint is reachable by. For stock Istio waypoints, this
	// is is usually the VIP. Tere will always be at least one address in this
	// list.
	Addresses []netip.Addr

	// DefaultBinding for an inbound zTunnel to use to connect to a Waypoint it captures.
	// This is applied to the Workloads that are instances of the current Waypoint.
	DefaultBinding InboundBinding

	// TrafficType controls whether Service or Workload can reference this
	// waypoint. Must be one of "all", "service", "workload".
	TrafficType string

	// ServiceAccounts from instances of the waypoint.
	// This only handles Pods. If we wish to support non-pod waypoints, we'll
	// want to index ServiceEntry/WorkloadEntry or possibly allow specifying
	// the ServiceAccounts directly on a Gateway resource.
	ServiceAccounts []string
}

func (Waypoint) ResourceName

func (w Waypoint) ResourceName() string

Jump to

Keyboard shortcuts

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