jx: github.com/jenkins-x/jx/pkg/kube/services Index | Files

package services

import "github.com/jenkins-x/jx/pkg/kube/services"

Index

Package Files

services.go

Constants

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"
)

func AnnotateServicesWithCertManagerIssuer Uses

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 Uses

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

func DeleteService Uses

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

func ExtractServiceSchemePort Uses

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 Uses

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

func FindService Uses

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

FindService looks up a service by name across all namespaces

func FindServiceHostname Uses

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

func FindServiceSchemePort Uses

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 Uses

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

func GetService Uses

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

func GetServiceAppName Uses

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

GetServiceAppName retrieves the application name from the service labels

func GetServiceNames Uses

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

func GetServiceURL Uses

func GetServiceURL(svc *v1.Service) string

GetServiceURL returns the

func GetServiceURLFromMap Uses

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

func GetServiceURLFromName Uses

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

func GetServices Uses

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

func GetServicesByName Uses

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 Uses

func HasExternalAddress(svc *v1.Service) bool

func IngressHost Uses

func IngressHost(ing *v1beta1.Ingress) string

IngressHost returns the host for the ingres

func IngressProtocol Uses

func IngressProtocol(ing *v1beta1.Ingress) string

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

func IngressURL Uses

func IngressURL(ing *v1beta1.Ingress) string

IngressURL returns the URL for the ingres

func IsServicePresent Uses

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

func ServiceAppName Uses

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 Uses

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 Uses

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

WaitForService waits for a service to become ready

type ServiceURL Uses

type ServiceURL struct {
    Name string
    URL  string
}

func FindServiceURLs Uses

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

Package services imports 17 packages (graph) and is imported by 15 packages. Updated 2019-09-14. Refresh now. Tools for package owners.