Documentation ¶
Index ¶
- func DefineServicePort(port, targetPort int32, protocol corev1.Protocol) (*corev1.ServicePort, error)
- func GetGVR() schema.GroupVersionResource
- 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) Update() (*Builder, error)
- 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) WithLabels(labels map[string]string) *Builder
- func (builder *Builder) WithNodePort() *Builder
- func (builder *Builder) WithOptions(options ...AdditionalOptions) *Builder
- func (builder *Builder) WithSelector(selector map[string]string) *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 GetGVR ¶
func GetGVR() schema.GroupVersionResource
GetGVR returns service's GroupVersionResource which could be used for Clean function.
func GetServiceGVR ¶
func GetServiceGVR() schema.GroupVersionResource
GetServiceGVR returns service's GroupVersionResource which could be used for Clean function. Deprecated: This function is being name-changed to GetGVR in the future and will be deprecated.
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 List ¶
func List(apiClient *clients.Settings, nsname string, options ...metav1.ListOptions) ([]*Builder, error)
List returns service inventory in the given namespace.
func NewBuilder ¶
func NewBuilder( apiClient *clients.Settings, name string, nsname string, selector 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) Update ¶
Update renovates the existing service object with service definition in builder.
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) WithLabels ¶
WithLabels redefines the service with label.
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.