services

package
v3.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 22 Imported by: 10

Documentation

Index

Constants

View Source
const (
	ExposeAnnotation             = "fabric8.io/expose"
	ExposeURLAnnotation          = "fabric8.io/exposeUrl"
	ExposeGeneratedByAnnotation  = "fabric8.io/generated-by"
	ExposeIngressName            = "fabric8.io/ingress.name"
	JenkinsXSkipTLSAnnotation    = "jenkins-x.io/skip.tls"
	ExposeIngressAnnotation      = "fabric8.io/ingress.annotations"
	CertManagerAnnotation        = "certmanager.k8s.io/issuer"
	CertManagerClusterAnnotation = "certmanager.k8s.io/cluster-issuer"
	ServiceAppLabel              = "app"
)

Variables

This section is empty.

Functions

func AnnotateServicesWithBasicAuth

func AnnotateServicesWithBasicAuth(client kubernetes.Interface, ns string, services ...string) error

AnnotateServicesWithBasicAuth annotates the services with nginx baisc auth annotations

func AnnotateServicesWithCertManagerIssuer

func AnnotateServicesWithCertManagerIssuer(c kubernetes.Interface, ns, issuer string, clusterIssuer bool, services ...string) ([]*v1.Service, error)

AnnotateServicesWithCertManagerIssuer adds the cert-manager annotation to the services from the given namespace. If a list of services is provided, it will apply the annotation only to that specific services.

func CleanServiceAnnotations

func CleanServiceAnnotations(c kubernetes.Interface, ns string, services ...string) error
func CreateServiceLink(client kubernetes.Interface, currentNamespace, targetNamespace, serviceName, externalURL string) error

func DeleteService

func DeleteService(client *kubernetes.Clientset, namespace string, serviceName string) error

func ExtractServiceSchemePort

func ExtractServiceSchemePort(svc *v1.Service) (string, string, error)

ExtractServiceSchemePort is a utility function to interpret http scheme and port information from k8s service definitions

func FindIngressURL

func FindIngressURL(client kubernetes.Interface, namespace string, name string) (string, error)

func FindService

func FindService(client kubernetes.Interface, name string) (*v1.Service, error)

FindService looks up a service by name across all namespaces

func FindServiceHostname

func FindServiceHostname(client kubernetes.Interface, namespace string, name string) (string, error)

func FindServiceSchemePort

func FindServiceSchemePort(client kubernetes.Interface, namespace string, name string) (string, string, error)

FindServiceSchemePort parses the service definition and interprets http scheme in the absence of an external ingress

func FindServiceURL

func FindServiceURL(client kubernetes.Interface, namespace string, name string) (string, error)

func FindServiceURLWithDynamicClient added in v3.2.13

func FindServiceURLWithDynamicClient(client kubernetes.Interface, namespace string, name string, dynamicClient dynamic.Interface) (string, error)

func FindUrlFromVsIstio added in v3.2.13

func FindUrlFromVsIstio(dynamicClient dynamic.Interface, namespace, name string) (string, error)

FindUrlFromVsIstio finds the host from istio virtual service

func GetService

func GetService(client kubernetes.Interface, currentNamespace, targetNamespace, serviceName string) error

func GetServiceAppName

func GetServiceAppName(c kubernetes.Interface, name, ns string) (string, error)

GetServiceAppName retrieves the application name from the service labels

func GetServiceNames

func GetServiceNames(client kubernetes.Interface, ns string, filter string) ([]string, error)

func GetServiceURL

func GetServiceURL(svc *v1.Service) string

GetServiceURL returns the

func GetServiceURLFromMap

func GetServiceURLFromMap(services map[string]*v1.Service, name string) string

func GetServiceURLFromName

func GetServiceURLFromName(c kubernetes.Interface, name, ns string) (string, error)

func GetServices

func GetServices(client kubernetes.Interface, ns string) (map[string]*v1.Service, error)

func GetServicesByName

func GetServicesByName(client kubernetes.Interface, ns string, services []string) ([]*v1.Service, error)

GetServicesByName returns a list of Service objects from a list of service names

func HasExternalAddress

func HasExternalAddress(svc *v1.Service) bool

func IngressHost

func IngressHost(ing *nv1.Ingress) string

IngressHost returns the host for the ingres

func IngressProtocol

func IngressProtocol(ing *nv1.Ingress) string

IngressProtocol returns the scheme (https / http) for the Ingress

func IngressURL

func IngressURL(ing *nv1.Ingress) string

IngressURL returns the URL for the ingres

func IsServicePresent

func IsServicePresent(c kubernetes.Interface, name, ns string) (bool, error)

func ServiceAppName

func ServiceAppName(service *v1.Service) string

ServiceAppName retrives the application name from service labels. If no app lable exists, it returns the service name

func WaitForExternalIP

func WaitForExternalIP(client kubernetes.Interface, name, namespace string, timeout time.Duration) error

WaitForExternalIP waits for the pods of a deployment to become ready

func WaitForService

func WaitForService(client kubernetes.Interface, name, namespace string, timeout time.Duration) error

WaitForService waits for a service to become ready

Types

type ServiceURL

type ServiceURL struct {
	Name string
	URL  string
}

func FindServiceURLs

func FindServiceURLs(client kubernetes.Interface, namespace string) ([]ServiceURL, error)

Jump to

Keyboard shortcuts

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