Documentation ¶
Index ¶
- Constants
- func ServicePort(svc api_v1.Service, port v1.ServiceBackendPort) *api_v1.ServicePort
- type Translator
- func (t *Translator) GatherEndpointPorts(svcPorts []utils.ServicePort) []string
- func (t *Translator) GetProbe(port utils.ServicePort) (*api_v1.Probe, error)
- func (t *Translator) GetService(namespace, name string) (*api_v1.Service, error)
- func (t *Translator) GetZoneForNode(name string) (string, error)
- func (t *Translator) ListZones(predicate utils.NodeConditionPredicate) ([]string, error)
- func (t *Translator) TranslateIngress(ing *v1.Ingress, systemDefaultBackend utils.ServicePortID, ...) (*utils.GCEURLMap, []error, bool)
Constants ¶
View Source
const ( // DefaultHost is the host used if none is specified. It is a valid value // for the "Host" field recognized by GCE. DefaultHost = "*" // DefaultPath is the path used if none is specified. It is a valid path // recognized by GCE. DefaultPath = "/*" )
Variables ¶
This section is empty.
Functions ¶
func ServicePort ¶ added in v1.2.2
func ServicePort(svc api_v1.Service, port v1.ServiceBackendPort) *api_v1.ServicePort
ServicePort is a helper function that retrieves a port of a Service.
Types ¶
type Translator ¶ added in v1.2.2
type Translator struct { ServiceInformer cache.SharedIndexInformer BackendConfigInformer cache.SharedIndexInformer NodeInformer cache.SharedIndexInformer PodInformer cache.SharedIndexInformer EndpointSliceInformer cache.SharedIndexInformer KubeClient kubernetes.Interface // contains filtered or unexported fields }
Translator helps with kubernetes -> gce api conversion.
func NewTranslator ¶ added in v1.2.2
func NewTranslator(serviceInformer cache.SharedIndexInformer, backendConfigInformer cache.SharedIndexInformer, nodeInformer cache.SharedIndexInformer, podInformer cache.SharedIndexInformer, endpointSliceInformer cache.SharedIndexInformer, kubeClient kubernetes.Interface, recorderGetter healthchecks.RecorderGetter, enableTHC, enableL7XLBRegional bool, ) *Translator
NewTranslator returns a new Translator.
func (*Translator) GatherEndpointPorts ¶ added in v1.2.2
func (t *Translator) GatherEndpointPorts(svcPorts []utils.ServicePort) []string
GatherEndpointPorts returns all ports needed to open NEG endpoints.
func (*Translator) GetProbe ¶ added in v1.2.2
func (t *Translator) GetProbe(port utils.ServicePort) (*api_v1.Probe, error)
GetProbe returns a probe that's used for the given nodeport
func (*Translator) GetService ¶ added in v1.24.0
func (t *Translator) GetService(namespace, name string) (*api_v1.Service, error)
GetService Implements ServiceGetter interface.
func (*Translator) GetZoneForNode ¶ added in v1.2.2
func (t *Translator) GetZoneForNode(name string) (string, error)
GetZoneForNode returns the zone for a given node by looking up its zone label.
func (*Translator) ListZones ¶ added in v1.2.2
func (t *Translator) ListZones(predicate utils.NodeConditionPredicate) ([]string, error)
ListZones returns a list of zones containing nodes that satisfy the given predicate.
func (*Translator) TranslateIngress ¶ added in v1.2.2
func (t *Translator) TranslateIngress(ing *v1.Ingress, systemDefaultBackend utils.ServicePortID, namer namer_util.BackendNamer) (*utils.GCEURLMap, []error, bool)
TranslateIngress converts an Ingress into our internal UrlMap representation. The returned bool is for warnings (there is one type of warnings currently possible).
Click to show internal directories.
Click to hide internal directories.