Version: v0.0.0-...-9bd628c Latest Latest

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

Go to latest
Published: Apr 7, 2019 License: MIT Imports: 11 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


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 Get

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

Get returns the service definition specified in a given namespace

func (*Service) Delete

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

Delete will delete a service in a given namespace

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(check string, attempts int, sleep, wait time.Duration) bool

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

func (*Service) WaitForExternalIP

func (s *Service) WaitForExternalIP(wait, sleep time.Duration) (*Service, error)

WaitForExternalIP waits for an external ip 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

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL