Documentation ¶
Index ¶
- func MakeService(name string, tweaks ...Tweak) *api.Service
- func MakeServicePort(name string, port int, tgtPort intstr.IntOrString, proto api.Protocol) api.ServicePort
- func SetTypeClusterIP(svc *api.Service)
- func SetTypeExternalName(svc *api.Service)
- func SetTypeLoadBalancer(svc *api.Service)
- func SetTypeNodePort(svc *api.Service)
- type Tweak
- func SetAllocateLoadBalancerNodePorts(val bool) Tweak
- func SetClusterIPs(ips ...string) Tweak
- func SetExternalTrafficPolicy(policy api.ServiceExternalTrafficPolicyType) Tweak
- func SetHealthCheckNodePort(value int32) Tweak
- func SetIPFamilies(families ...api.IPFamily) Tweak
- func SetIPFamilyPolicy(policy api.IPFamilyPolicyType) Tweak
- func SetInternalTrafficPolicy(policy api.ServiceInternalTrafficPolicyType) Tweak
- func SetNodePorts(values ...int) Tweak
- func SetPorts(ports ...api.ServicePort) Tweak
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeService ¶
MakeService helps construct Service objects (which pass API validation) more legibly and tersely than a Go struct definition. By default this produces a ClusterIP service with a single port and a trivial selector. The caller can pass any number of tweak functions to further modify the result.
func MakeServicePort ¶
func MakeServicePort(name string, port int, tgtPort intstr.IntOrString, proto api.Protocol) api.ServicePort
MakeServicePort helps construct ServicePort objects which pass API validation.
func SetTypeClusterIP ¶
SetTypeClusterIP sets the service type to ClusterIP and clears other fields.
func SetTypeExternalName ¶
SetTypeExternalName sets the service type to ExternalName and clears other fields.
func SetTypeLoadBalancer ¶
SetTypeLoadBalancer sets the service type to LoadBalancer and clears other fields.
func SetTypeNodePort ¶
SetTypeNodePort sets the service type to NodePort and clears other fields.
Types ¶
type Tweak ¶
Tweak is a function that modifies a Service.
func SetAllocateLoadBalancerNodePorts ¶
SetAllocateLoadBalancerNodePorts sets the allocate LB node port field.
func SetClusterIPs ¶
SetClusterIPs sets the service ClusterIP and ClusterIPs fields.
func SetExternalTrafficPolicy ¶
func SetExternalTrafficPolicy(policy api.ServiceExternalTrafficPolicyType) Tweak
SetExternalTrafficPolicy sets the externalTrafficPolicy field for a Service.
func SetHealthCheckNodePort ¶
SetHealthCheckNodePort sets the healthCheckNodePort field for a Service.
func SetIPFamilies ¶
SetIPFamilies sets the service IPFamilies field.
func SetIPFamilyPolicy ¶
func SetIPFamilyPolicy(policy api.IPFamilyPolicyType) Tweak
SetIPFamilyPolicy sets the service IPFamilyPolicy field.
func SetInternalTrafficPolicy ¶ added in v1.21.5
func SetInternalTrafficPolicy(policy api.ServiceInternalTrafficPolicyType) Tweak
SetInternalTrafficPolicy sets the internalTrafficPolicy field for a Service.
func SetNodePorts ¶
SetNodePorts sets the values for each node port, in order. If less values are specified than there are ports, the rest are untouched.