Documentation ¶
Overview ¶
nolint: gocritic
nolint: gocritic
nolint: gocritic
nolint: gocritic
nolint: gocritic
nolint: gocritic
Index ¶
- func AppendNonNil[T any](data []T, i *T) []T
- func FindPortName(pod *v1.Pod, name string) (int32, bool)
- func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodConditionFromList(conditions []v1.PodCondition, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
- func IsPodReady(pod *v1.Pod) bool
- func IsPodReadyConditionTrue(status v1.PodStatus) bool
- func MakeSource(o controllers.Object) model.TypedObject
- func MeshConfigCollection(configMaps krt.Collection[*v1.ConfigMap], options Options, ...) krt.Singleton[MeshConfig]
- func PolicyCollections(authzPolicies krt.Collection[*securityclient.AuthorizationPolicy], ...) (krt.Collection[model.WorkloadAuthorization], ...)
- func PushXds[T any](xds model.XDSUpdater, f func(T) model.ConfigKey) func(events []krt.Event[T], initialSync bool)
- func RegisterEdsShim(xdsUpdater model.XDSUpdater, Workloads krt.Collection[model.WorkloadInfo], ...)
- func ReportWaypointAttachmentDenied(waypoint string) *model.StatusMessage
- func ReportWaypointIsNotReady(waypoint string) *model.StatusMessage
- func ReportWaypointUnsupportedTrafficType(waypoint string, ttype string) *model.StatusMessage
- func WaypointPolicyStatusCollection(authzPolicies krt.Collection[*securityclient.AuthorizationPolicy], ...) krt.Collection[model.WaypointPolicyStatus]
- type InboundBinding
- type Index
- type LookupNetwork
- type LookupNetworkGateways
- type MeshConfig
- type NamespaceHostname
- type Options
- type TargetRef
- type Waypoint
- func (w Waypoint) AllowsAttachmentFromNamespace(namespace *v1.Namespace) bool
- func (w Waypoint) AllowsAttachmentFromNamespaceOrLookup(ctx krt.HandlerContext, Namespaces krt.Collection[*v1.Namespace], ...) bool
- func (w Waypoint) Equals(other Waypoint) bool
- func (w *Waypoint) GetAddress() *workloadapi.GatewayAddress
- func (w Waypoint) ResourceName() string
- type WaypointSelector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendNonNil ¶
func AppendNonNil[T any](data []T, i *T) []T
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 IsPodReady ¶
IsPodReady is copied from kubernetes/pkg/api/v1/pod/utils.go
func IsPodReadyConditionTrue ¶
IsPodReadyConditionTrue returns true if a pod is ready; false otherwise.
func MakeSource ¶
func MakeSource(o controllers.Object) model.TypedObject
MakeSource is a helper to turn an Object into a model.TypedObject.
func MeshConfigCollection ¶
func MeshConfigCollection(configMaps krt.Collection[*v1.ConfigMap], options Options, withDebug krt.CollectionOption) krt.Singleton[MeshConfig]
func PolicyCollections ¶
func PolicyCollections( authzPolicies krt.Collection[*securityclient.AuthorizationPolicy], peerAuths krt.Collection[*securityclient.PeerAuthentication], meshConfig krt.Singleton[MeshConfig], waypoints krt.Collection[Waypoint], withDebug krt.CollectionOption, ) (krt.Collection[model.WorkloadAuthorization], krt.Collection[model.WorkloadAuthorization])
func RegisterEdsShim ¶
func RegisterEdsShim( xdsUpdater model.XDSUpdater, Workloads krt.Collection[model.WorkloadInfo], WorkloadsByServiceKey krt.Index[string, model.WorkloadInfo], Services krt.Collection[model.ServiceInfo], ServicesByAddress krt.Index[networkAddress, model.ServiceInfo], withDebug krt.CollectionOption, )
RegisterEdsShim handles triggering xDS events when Envoy EDS needs to change. Most of ambient index works to build `workloadapi` types - Workload, Service, etc. Envoy uses a different API, with different relationships between types. To ensure Envoy are updated properly on changes, we compute this information. Currently, this is only used to trigger events. Ideally, the information we are using in Envoy and the event trigger are using the same data directly.
func ReportWaypointAttachmentDenied ¶
func ReportWaypointAttachmentDenied(waypoint string) *model.StatusMessage
func ReportWaypointIsNotReady ¶
func ReportWaypointIsNotReady(waypoint string) *model.StatusMessage
func ReportWaypointUnsupportedTrafficType ¶
func ReportWaypointUnsupportedTrafficType(waypoint string, ttype string) *model.StatusMessage
func WaypointPolicyStatusCollection ¶
func WaypointPolicyStatusCollection( authzPolicies krt.Collection[*securityclient.AuthorizationPolicy], waypoints krt.Collection[Waypoint], services krt.Collection[*corev1.Service], serviceEntries krt.Collection[*networkingclient.ServiceEntry], namespaces krt.Collection[*corev1.Namespace], withDebug krt.CollectionOption, ) krt.Collection[model.WaypointPolicyStatus]
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() NetworksSynced() Run(stop <-chan struct{}) HasSynced() bool model.AmbientIndexes }
type LookupNetworkGateways ¶
type LookupNetworkGateways func() []model.NetworkGateway
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 NamespaceHostname ¶
func (NamespaceHostname) String ¶
func (n NamespaceHostname) String() string
type Options ¶
type Options struct { Client kubeclient.Client Revision string SystemNamespace string DomainSuffix string ClusterID cluster.ID XDSUpdater model.XDSUpdater LookupNetwork LookupNetwork LookupNetworkGateways LookupNetworkGateways StatusNotifier *activenotifier.ActiveNotifier Debugger *krt.DebugHandler }
type TargetRef ¶
TargetRef is a subset of the Kubernetes ObjectReference which has some fields we don't care about
type Waypoint ¶
type Waypoint struct { krt.Named // Addresses this Waypoint is reachable by. For stock Istio waypoints, this // is usually the hostname. There will always be at least one address in this // list. Address *workloadapi.GatewayAddress // 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 AllowedRoutes WaypointSelector }
func (Waypoint) AllowsAttachmentFromNamespace ¶
func (Waypoint) AllowsAttachmentFromNamespaceOrLookup ¶
func (w Waypoint) AllowsAttachmentFromNamespaceOrLookup(ctx krt.HandlerContext, Namespaces krt.Collection[*v1.Namespace], namespace string) bool
func (*Waypoint) GetAddress ¶
func (w *Waypoint) GetAddress() *workloadapi.GatewayAddress
GetAddress is a nil-safe traversal method for Waypoint
func (Waypoint) ResourceName ¶
type WaypointSelector ¶
type WaypointSelector struct { FromNamespaces v1beta1.FromNamespaces Selector labels.Selector }
func (WaypointSelector) Equals ¶
func (w WaypointSelector) Equals(other WaypointSelector) bool