Documentation ¶
Index ¶
- func DefineServicePort(port, targetPort int32, protocol corev1.Protocol) (*corev1.ServicePort, error)
- func GetServiceGVR() schema.GroupVersionResource
- type AdditionalOptions
- type Builder
- func (builder *Builder) Create() (*Builder, error)
- func (builder *Builder) Delete() error
- func (builder *Builder) Exists() bool
- func (builder *Builder) WithAnnotation(annotation map[string]string) *Builder
- func (builder *Builder) WithExternalTrafficPolicy(policyType corev1.ServiceExternalTrafficPolicyType) *Builder
- func (builder *Builder) WithIPFamily(ipFamily []corev1.IPFamily, ipStackPolicy corev1.IPFamilyPolicyType) *Builder
- func (builder *Builder) WithNodePort() *Builder
- func (builder *Builder) WithOptions(options ...AdditionalOptions) *Builder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefineServicePort ¶
func DefineServicePort(port, targetPort int32, protocol corev1.Protocol) (*corev1.ServicePort, error)
DefineServicePort helper for creating a Service with a ServicePort.
func GetServiceGVR ¶
func GetServiceGVR() schema.GroupVersionResource
GetServiceGVR returns service's GroupVersionResource which could be used for Clean function.
Types ¶
type AdditionalOptions ¶
AdditionalOptions additional options for service object.
type Builder ¶
type Builder struct { // Service definition. Used to create a service object Definition *corev1.Service // Created service object Object *corev1.Service // contains filtered or unexported fields }
Builder provides struct for service object containing connection to the cluster and the service definitions.
func NewBuilder ¶
func NewBuilder( apiClient *clients.Settings, name string, nsname string, labels map[string]string, servicePort corev1.ServicePort) *Builder
NewBuilder creates a new instance of Builder Default type of service is ClusterIP Use WithNodePort() for setting the NodePort type.
func (*Builder) WithAnnotation ¶
WithAnnotation redefines the service with Annotation type.
func (*Builder) WithExternalTrafficPolicy ¶
func (builder *Builder) WithExternalTrafficPolicy(policyType corev1.ServiceExternalTrafficPolicyType) *Builder
WithExternalTrafficPolicy redefines the service with ServiceExternalTrafficPolicy type.
func (*Builder) WithIPFamily ¶
func (builder *Builder) WithIPFamily(ipFamily []corev1.IPFamily, ipStackPolicy corev1.IPFamilyPolicyType) *Builder
WithIPFamily redefines the service with IPFamilies type.
func (*Builder) WithNodePort ¶
WithNodePort redefines the service with NodePort service type.
func (*Builder) WithOptions ¶
func (builder *Builder) WithOptions(options ...AdditionalOptions) *Builder
WithOptions creates service with generic mutation options.