Documentation ¶
Index ¶
- Constants
- func CopyStringMap(in map[string]string) map[string]string
- func FindContainerStatus(pod *kube_core.Pod, containerName string) *kube_core.ContainerStatus
- func FindPort(pod *kube_core.Pod, svcPort *kube_core.ServicePort) (int, *kube_core.Container, error)
- func FindServices(svcs *kube_core.ServiceList, predicates ...ServicePredicate) []*kube_core.Service
- func MeshOf(obj kube_meta.Object, namespace *kube_core.Namespace) string
- func ServiceTagFor(svc *kube_core.Service, svcPort *int32) string
- type ServicePredicate
Constants ¶
const ( KumaSidecarContainerName = "kuma-sidecar" KumaGatewayContainerName = "kuma-gateway" KumaInitContainerName = "kuma-init" )
Variables ¶
This section is empty.
Functions ¶
func FindContainerStatus ¶
func FindContainerStatus(pod *kube_core.Pod, containerName string) *kube_core.ContainerStatus
func FindPort ¶
func FindPort(pod *kube_core.Pod, svcPort *kube_core.ServicePort) (int, *kube_core.Container, error)
FindPort locates the container port for the given pod and portName. If the targetPort is a number, use that. If the targetPort is a string, look that string up in all named ports in all containers in the target pod. If no match is found, fail.
func FindServices ¶
func FindServices(svcs *kube_core.ServiceList, predicates ...ServicePredicate) []*kube_core.Service
Types ¶
type ServicePredicate ¶
func AnySelector ¶
func AnySelector() ServicePredicate
According to K8S docs about Service#selector: Route service traffic to pods with label keys and values matching this selector. If empty or not present, the service is assumed to have an external process managing its endpoints, which Kubernetes will not modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/
When converting Pod to Dataplane, we don't want to take into account Services that has no Selector, otherwise any Pod will match this service and since we just take any int target port in #util.FindPort every Dataplane in the same namespace as this service would get an extra inbound for it.
func Ignored ¶ added in v1.8.1
func Ignored() ServicePredicate
func MatchServiceThatSelectsPod ¶
func MatchServiceThatSelectsPod(pod *kube_core.Pod) ServicePredicate
func Not ¶ added in v1.8.1
func Not(predicate ServicePredicate) ServicePredicate