type Tweak … // 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 MakeService(name string, tweaks ...Tweak) *api.Service { … } // SetTypeClusterIP sets the service type to ClusterIP and clears other fields. func SetTypeClusterIP(svc *api.Service) { … } // SetTypeNodePort sets the service type to NodePort and clears other fields. func SetTypeNodePort(svc *api.Service) { … } // SetTypeLoadBalancer sets the service type to LoadBalancer and clears other fields. func SetTypeLoadBalancer(svc *api.Service) { … } // SetTypeExternalName sets the service type to ExternalName and clears other fields. func SetTypeExternalName(svc *api.Service) { … } // SetPorts sets the service ports list. func SetPorts(ports ...api.ServicePort) Tweak { … } // MakeServicePort helps construct ServicePort objects which pass API // validation. func MakeServicePort(name string, port int, tgtPort intstr.IntOrString, proto api.Protocol) api.ServicePort { … } // SetHeadless sets the service as headless and clears other fields. func SetHeadless(svc *api.Service) { … } // SetSelector sets the service selector. func SetSelector(sel map[string]string) Tweak { … } // SetClusterIP sets the service ClusterIP fields. func SetClusterIP(ip string) Tweak { … } // SetClusterIPs sets the service ClusterIP and ClusterIPs fields. func SetClusterIPs(ips ...string) Tweak { … } // SetIPFamilies sets the service IPFamilies field. func SetIPFamilies(families ...api.IPFamily) Tweak { … } // SetIPFamilyPolicy sets the service IPFamilyPolicy field. func SetIPFamilyPolicy(policy api.IPFamilyPolicy) Tweak { … } // SetNodePorts sets the values for each node port, in order. If less values // are specified than there are ports, the rest are untouched. func SetNodePorts(values ...int) Tweak { … } // SetInternalTrafficPolicy sets the internalTrafficPolicy field for a Service. func SetInternalTrafficPolicy(policy api.ServiceInternalTrafficPolicy) Tweak { … } // SetExternalTrafficPolicy sets the externalTrafficPolicy field for a Service. func SetExternalTrafficPolicy(policy api.ServiceExternalTrafficPolicy) Tweak { … } // SetAllocateLoadBalancerNodePorts sets the allocate LB node port field. func SetAllocateLoadBalancerNodePorts(val bool) Tweak { … } // SetUniqueNodePorts sets all nodeports to unique values. func SetUniqueNodePorts(svc *api.Service) { … } // SetHealthCheckNodePort sets the healthCheckNodePort field for a Service. func SetHealthCheckNodePort(value int32) Tweak { … } // SetSessionAffinity sets the SessionAffinity field. func SetSessionAffinity(affinity api.ServiceAffinity) Tweak { … } // SetExternalName sets the ExternalName field. func SetExternalName(val string) Tweak { … }