Documentation ¶
Overview ¶
Description: This file has the package kube.
Package kube has helpers for kubernetes client.
Index ¶
- func CreatePortForward(ctx context.Context, r rest.Interface, rc *rest.Config, p *corev1.Pod, ...) (*portforward.PortForwarder, error)
- func FindControllersForService(log logrus.FieldLogger, s *corev1.Service) ([]interface{}, error)
- func GetKubeClient(contextName string) (*rest.Config, kubernetes.Interface, error)
- type ResolvedServicePort
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePortForward ¶
func FindControllersForService ¶
func FindControllersForService(log logrus.FieldLogger, s *corev1.Service) ([]interface{}, error)
FindControllersForService returns the controllers for a given service. Controllers are deployments/statefulsets that match the service's selector in their pod templates.
func GetKubeClient ¶
GetKubeClient returns a kubernetes client, and the config used by it, based on a given context. If no context is provided then the default will be used
Types ¶
type ResolvedServicePort ¶
type ResolvedServicePort struct { corev1.ServicePort // OriginalTargetPort is set if the ServicePort // was modified OriginalTargetPort string // MappedPort is the locally mapped port that this should have // defaults to the targetPort MappedPort uint }
func ResolveServicePorts ¶
func ResolveServicePorts(log logrus.FieldLogger, s *corev1.Service) ([]ResolvedServicePort, error)
ResolveServicePorts converts named ports into their true format. TargetPort's that have are named become their integer equivalents
func ResolveServicePortsFromControllers ¶
func ResolveServicePortsFromControllers(log logrus.FieldLogger, s *corev1.Service) ([]ResolvedServicePort, error)
ResolveServicePortsFromControllers looks up the controllers of a given service and uses their containerPort declarations to resolve named endpoints of a service