Documentation ¶
Index ¶
- Constants
- func DeleteServicesWithLabel(ctx context.Context, h *helper.Helper, obj metav1.Object, ...) error
- func GenericService(svcInfo *GenericServiceDetails) *corev1.Service
- func GetServiceWithName(ctx context.Context, h *helper.Helper, name string, namespace string) (*corev1.Service, error)
- func GetServicesListWithLabel(ctx context.Context, h *helper.Helper, namespace string, ...) (*corev1.ServiceList, error)
- func GetServicesPortDetails(service *corev1.Service, portName string) *corev1.ServicePort
- func MetalLBService(svcInfo *MetalLBServiceDetails) *corev1.Service
- type GenericServiceDetails
- type GenericServicePort
- type MetalLBServiceDetails
- type Service
- func (s *Service) CreateOrPatch(ctx context.Context, h *helper.Helper) (ctrl.Result, error)
- func (s *Service) Delete(ctx context.Context, h *helper.Helper) error
- func (s *Service) GetClusterIPs() []string
- func (s *Service) GetExternalIPs() []string
- func (s *Service) GetServiceHostname() string
- func (s *Service) GetServiceHostnamePort() string
Constants ¶
const ( // MetalLBAddressPoolAnnotation - MetalLBAddressPoolAnnotation = "metallb.universe.tf/address-pool" 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) CreateOrPatch ¶
CreateOrPatch - creates or patches a service, reconciles after Xs if object won't exist.
func (*Service) GetClusterIPs ¶
GetClusterIPs - returns the cluster IPs of the created service
func (*Service) GetExternalIPs ¶
GetExternalIPs - returns a list of external IPs of the created service
func (*Service) GetServiceHostname ¶
GetServiceHostname - returns the service hostname
func (*Service) GetServiceHostnamePort ¶
GetServiceHostnamePort - returns the service hostname with port