service

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 23 Imported by: 58

Documentation

Index

Constants

View Source
const (
	// DefaultWait is the default wait time, in seconds
	DefaultWait = 2
	// DefaultInterval is the default interval, in seconds
	DefaultInterval = 1
)

Variables

This section is empty.

Functions

func CheckService

func CheckService(cname string, namespace string, service string) error

CheckService checks if a service is listening on a port.

func CheckServicePods added in v1.31.0

func CheckServicePods(cname, svcName, namespace string) error

check whether there are running pods for a service

func CreateSecret

func CreateSecret(cname string, namespace, name string, dataValues map[string]string, labels map[string]string) error

CreateSecret creates or modifies secrets

func DeleteSecret

func DeleteSecret(cname string, namespace, name string) error

DeleteSecret deletes a secret from a namespace

func GetServiceListByLabel

func GetServiceListByLabel(cname string, namespace string, key string, value string) (*core.ServiceList, error)

GetServiceListByLabel returns a ServiceList by label

func OptionallyHTTPSFormattedURLString added in v0.31.0

func OptionallyHTTPSFormattedURLString(bareURLString string, https bool) (string, bool)

OptionallyHTTPSFormattedURLString returns a formatted URL string, optionally HTTPS

func PrintServiceList added in v1.3.0

func PrintServiceList(writer io.Writer, data [][]string)

PrintServiceList prints a list of services as a table which has "Namespace", "Name" and "URL" columns to a writer

func WaitForService added in v1.5.1

func WaitForService(api libmachine.API, cname string, namespace string, service string, urlTemplate *template.Template, urlMode bool, https bool,
	wait int, interval int) ([]string, error)

WaitForService waits for a service, and return the urls when available

Types

type K8sClient

type K8sClient interface {
	GetCoreClient(string) (typed_core.CoreV1Interface, error)
}

K8sClient represents a Kubernetes client

var K8s K8sClient

K8s is the current K8sClient

type K8sClientGetter

type K8sClientGetter struct{}

K8sClientGetter can get a K8sClient

func (*K8sClientGetter) GetCoreClient

func (k *K8sClientGetter) GetCoreClient(context string) (typed_core.CoreV1Interface, error)

GetCoreClient returns a core client

type SVCNotFoundError added in v1.9.0

type SVCNotFoundError struct {
	Err error
}

SVCNotFoundError error type handles 'service not found' scenarios

func (SVCNotFoundError) Error added in v1.9.0

func (t SVCNotFoundError) Error() string

Error method for SVCNotFoundError type

type SvcURL added in v1.4.0

type SvcURL struct {
	Namespace string
	Name      string
	URLs      []string
	PortNames []string
}

SvcURL represents a service URL. Each item in the URLs field combines the service URL with one of the configured node ports. The PortNames field contains the configured names of the ports in the URLs field (sorted correspondingly - first item in PortNames belongs to the first item in URLs).

func GetServiceURLsForService

func GetServiceURLsForService(api libmachine.API, cname string, namespace, service string, t *template.Template) (SvcURL, error)

GetServiceURLsForService returns a SvcURL object for a service in a namespace. Supports optional formatting.

type URLs added in v0.31.0

type URLs []SvcURL

URLs represents a list of URL

func GetServiceURLs

func GetServiceURLs(api libmachine.API, cname string, namespace string, t *template.Template) (URLs, error)

GetServiceURLs returns a SvcURL object for every service in a particular namespace. Accepts a template for formatting

Jump to

Keyboard shortcuts

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