Help us shape the future of Go! Take the 2026 Go Developer Survey

service

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 13 Imported by: 33

Documentation

Index

Constants

View Source
const (
	// MetalLBAddressPoolAnnotation -
	MetalLBAddressPoolAnnotation = "metallb.universe.tf/address-pool"
	// MetalLBAllowSharedIPAnnotation -
	MetalLBAllowSharedIPAnnotation = "metallb.universe.tf/allow-shared-ip"
	// MetalLBLoadBalancerIPs -
	MetalLBLoadBalancerIPs = "metallb.universe.tf/loadBalancerIPs"
)

Variables

This section is empty.

Functions

func DeleteServicesWithLabel

func DeleteServicesWithLabel(
	ctx context.Context,
	h *helper.Helper,
	obj metav1.Object,
	labelSelectorMap map[string]string,
) error

DeleteServicesWithLabel - Delete all services in namespace of the obj matching label selector

func GenericService

func GenericService(svcInfo *GenericServiceDetails) *corev1.Service

GenericService func

func GetServiceWithName

func GetServiceWithName(
	ctx context.Context,
	h *helper.Helper,
	name string,
	namespace string,
) (*corev1.Service, error)

GetServiceWithName - Get service with name in namespace

func GetServicesListWithLabel

func GetServicesListWithLabel(
	ctx context.Context,
	h *helper.Helper,
	namespace string,
	labelSelectorMap map[string]string,
) (*corev1.ServiceList, error)

GetServicesListWithLabel - Get all services in namespace of the obj matching label selector

func GetServicesPortDetails

func GetServicesPortDetails(
	service *corev1.Service,
	portName string,
) *corev1.ServicePort

GetServicesPortDetails - Return ServicePort with name from a Service

func MetalLBService

func MetalLBService(svcInfo *MetalLBServiceDetails) *corev1.Service

MetalLBService func

Types

type GenericServiceDetails

type GenericServiceDetails struct {
	Name      string
	Namespace string
	Labels    map[string]string
	Selector  map[string]string
	Port      GenericServicePort
	ClusterIP string
}

GenericServiceDetails -

type GenericServicePort

type GenericServicePort struct {
	Name     string
	Port     int32
	Protocol corev1.Protocol // corev1.ProtocolTCP/ corev1.ProtocolUDP/ corev1.ProtocolSCTP - https://pkg.go.dev/k8s.io/api@v0.23.6/core/v1#Protocol
}

GenericServicePort -

type MetalLBServiceDetails

type MetalLBServiceDetails struct {
	Name        string
	Namespace   string
	Annotations map[string]string
	Labels      map[string]string
	Selector    map[string]string
	Port        GenericServicePort
}

MetalLBServiceDetails -

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service -

func NewService

func NewService(
	service *corev1.Service,
	labels map[string]string,
	timeout time.Duration,
) *Service

NewService returns an initialized Service.

func (*Service) AddAnnotation

func (s *Service) AddAnnotation(anno map[string]string)

AddAnnotation - Adds annotation and merges it with the current set

func (*Service) CreateOrPatch

func (s *Service) CreateOrPatch(
	ctx context.Context,
	h *helper.Helper,
) (ctrl.Result, error)

CreateOrPatch - creates or patches a service, reconciles after Xs if object won't exist.

func (*Service) Delete

func (s *Service) Delete(
	ctx context.Context,
	h *helper.Helper,
) error

Delete - delete a service.

func (*Service) GetClusterIPs

func (s *Service) GetClusterIPs() []string

GetClusterIPs - returns the cluster IPs of the created service

func (*Service) GetExternalIPs

func (s *Service) GetExternalIPs() []string

GetExternalIPs - returns a list of external IPs of the created service

func (*Service) GetIPFamilies

func (s *Service) GetIPFamilies() []corev1.IPFamily

GetIPFamilies - returns the IP families of the created service

func (*Service) GetServiceHostname

func (s *Service) GetServiceHostname() string

GetServiceHostname - returns the service hostname

func (*Service) GetServiceHostnamePort

func (s *Service) GetServiceHostnamePort() string

GetServiceHostnamePort - returns the service hostname with port

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL