service

package
v0.43.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DescribeServices added in v0.41.0

func DescribeServices(svcPrefix, namespace string)

DescribeServices describes all service resources whose name matches a substring

func WaitOnDeleted added in v0.36.0

func WaitOnDeleted(servicePrefix, namespace string, sleep, timeout time.Duration) (bool, error)

WaitOnDeleted returns when a service resource is successfully deleted

Types

type GetAllByPrefixResult added in v0.41.0

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

GetAllByPrefixResult is a return struct for GetAllByPrefixAsync

func GetAllByPrefixAsync added in v0.41.0

func GetAllByPrefixAsync(prefix, namespace string) GetAllByPrefixResult

GetAllByPrefixAsync wraps Get with a struct response for goroutine + channel usage

type GetResult added in v0.41.0

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

GetResult is a return struct for GetAsync

func GetAsync added in v0.41.0

func GetAsync(name, namespace string) GetResult

GetAsync wraps Get with a struct response for goroutine + channel usage

type List added in v0.36.0

type List struct {
	Services []Service `json:"items"`
}

List holds a list of services returned from kubectl get svc

func GetAll added in v0.36.0

func GetAll(namespace string) (*List, error)

GetAll will return all services in a given namespace

type LoadBalancer

type LoadBalancer struct {
	Ingress []map[string]string `json:"ingress"`
}

LoadBalancer holds the ingress definitions

type Metadata

type Metadata struct {
	CreatedAt time.Time         `json:"creationTimestamp"`
	Labels    map[string]string `json:"labels"`
	Name      string            `json:"name"`
	Namespace string            `json:"namespace"`
}

Metadata holds information like name, namespace, and labels

type Port

type Port struct {
	NodePort   int    `json:"nodePort"`
	Port       int    `json:"port"`
	Protocol   string `json:"protocol"`
	TargetPort int    `json:"targetPort"`
}

Port represents a service port definition

type Service

type Service struct {
	Metadata Metadata `json:"metadata"`
	Spec     Spec     `json:"spec"`
	Status   Status   `json:"status"`
}

Service represents a kubernetes service

func CreateServiceFromFile

func CreateServiceFromFile(filename, name, namespace string) (*Service, error)

CreateServiceFromFile will create a Service from file with a name

func CreateServiceFromFileDeleteIfExist added in v0.36.0

func CreateServiceFromFileDeleteIfExist(filename, name, namespace string) (*Service, error)

CreateServiceFromFileDeleteIfExist will create a Service from file, deleting any pre-existing service with the same name

func Get

func Get(name, namespace string) (*Service, error)

Get returns the service definition specified in a given namespace

func GetAllByPrefix added in v0.36.0

func GetAllByPrefix(prefix, namespace string) ([]Service, error)

GetAllByPrefix will return all services in a given namespace that match a prefix

func (*Service) Delete

func (s *Service) Delete(retries int) error

Delete will delete a service in a given namespace

func (*Service) Describe added in v0.41.0

func (s *Service) Describe() error

Describe will describe a service resource

func (*Service) GetNodePort

func (s *Service) GetNodePort(port int) int

GetNodePort will return the node port for a given pod

func (*Service) Validate

func (s *Service) Validate(bodyResponseTextMatch string) error

Validate will attempt to run an http.Get against the root service url

func (*Service) ValidateWithRetry added in v0.42.0

func (s *Service) ValidateWithRetry(bodyResponseTextMatch string, sleep, timeout time.Duration) error

ValidateWithRetry waits for an Ingress to be provisioned

func (*Service) WaitForIngress added in v0.36.0

func (s *Service) WaitForIngress(timeout, sleep time.Duration) error

WaitForIngress waits for an Ingress to be provisioned

type Spec

type Spec struct {
	ClusterIP string `json:"clusterIP"`
	Ports     []Port `json:"ports"`
	Type      string `json:"type"`
}

Spec holds information like clusterIP and port

type Status

type Status struct {
	LoadBalancer LoadBalancer `json:"loadBalancer"`
}

Status holds the load balancer definition

Jump to

Keyboard shortcuts

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