apiloadbalancer

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Overview

Package apiloadbalancer allows to create and manage kube-apiserver load balancer containers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromYaml

func FromYaml(c []byte) (types.Resource, error)

FromYaml allows to restore cluster state from YAML.

Types

type APILoadBalancer

type APILoadBalancer struct {
	Image          string    `json:"image,omitempty"`
	Host           host.Host `json:"host,omitempty"`
	Servers        []string  `json:"servers,omitempty"`
	Name           string    `json:"name,omitempty"`
	HostConfigPath string    `json:"hostConfigPath,omitempty"`
	BindAddress    string    `json:"bindAddress,omitempty"`
}

APILoadBalancer is a user-configurable representation of single instance of API load balancer

func (*APILoadBalancer) New

New validates APILoadBalancer configuration and fills it with default options If configuration is wrong, error is returned.

TODO I think we shouldn't fill the default values here. Maybe do it one level up?

func (*APILoadBalancer) Validate

func (a *APILoadBalancer) Validate() error

Validate contains all validation rules for APILoadBalancer struct. This method can be used by the user to catch configuration errors early.

type APILoadBalancers

type APILoadBalancers struct {
	Image            string            `json:"image,omitempty"`
	SSH              *ssh.Config       `json:"ssh,omitempty"`
	Servers          []string          `json:"servers,omitempty"`
	APILoadBalancers []APILoadBalancer `json:"apiLoadBalancers,omitempty"`
	Name             string            `json:"name,omitempty"`
	HostConfigPath   string            `json:"hostConfigPath,omitempty"`
	BindAddress      string            `json:"bindAddress,omitempty"`

	// Serializable fields
	State container.ContainersState `json:"state,omitempty"`
}

APILoadBalancers represents group of APILoadBalancer instances. It allows to set default values for all configured instances.

func (*APILoadBalancers) New

func (a *APILoadBalancers) New() (types.Resource, error)

New validates APILoadBalancers struct and fills all required fields in members with default values provided by the user.

TODO move filling the defaults to separated function, so it can be re-used in Validate.

func (*APILoadBalancers) Validate

func (a *APILoadBalancers) Validate() error

Validate validates APILoadBalancers struct.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳