kubernetes

package
v1.3.0-rc1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2017 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasNamespace

func HasNamespace(ingress *v1beta1.Ingress, namespaces Namespaces) bool

HasNamespace checks if the ingress is in one of the namespaces

func NewListWatchFromClient

func NewListWatchFromClient(c cache.Getter, resource string, namespace string, fieldSelector fields.Selector, labelSelector labels.Selector) *cache.ListWatch

NewListWatchFromClient creates a new ListWatch from the specified client, resource, namespace, field selector and label selector. Extends cache.NewListWatchFromClient to support labelSelector

Types

type Client

type Client interface {
	GetIngresses(namespaces Namespaces) []*v1beta1.Ingress
	GetService(namespace, name string) (*v1.Service, bool, error)
	GetSecret(namespace, name string) (*v1.Secret, bool, error)
	GetEndpoints(namespace, name string) (*v1.Endpoints, bool, error)
	WatchAll(labelSelector string, stopCh <-chan struct{}) (<-chan interface{}, error)
}

Client is a client for the Provider master. WatchAll starts the watch of the Provider ressources and updates the stores. The stores can then be accessed via the Get* functions.

func NewExternalClusterClient

func NewExternalClusterClient(endpoint, token, caFilePath string) (Client, error)

NewExternalClusterClient returns a new Provider client that may run outside of the cluster. The endpoint parameter must not be empty.

func NewInClusterClient

func NewInClusterClient(endpoint string) (Client, error)

NewInClusterClient returns a new Provider client that is expected to run inside the cluster.

type Namespaces

type Namespaces []string

Namespaces holds kubernetes namespaces

func (*Namespaces) Get

func (ns *Namespaces) Get() interface{}

Get []string

func (*Namespaces) Set

func (ns *Namespaces) Set(str string) error

Set adds strings elem into the the parser it splits str on , and ;

func (*Namespaces) SetValue

func (ns *Namespaces) SetValue(val interface{})

SetValue sets []string into the parser

func (*Namespaces) String

func (ns *Namespaces) String() string

String return slice in a string

type Provider

type Provider struct {
	provider.BaseProvider  `mapstructure:",squash"`
	Endpoint               string     `description:"Kubernetes server endpoint (required for external cluster client)"`
	Token                  string     `description:"Kubernetes bearer token (not needed for in-cluster client)"`
	CertAuthFilePath       string     `description:"Kubernetes certificate authority file path (not needed for in-cluster client)"`
	DisablePassHostHeaders bool       `description:"Kubernetes disable PassHost Headers"`
	Namespaces             Namespaces `description:"Kubernetes namespaces"`
	LabelSelector          string     `description:"Kubernetes api label selector to use"`
	// contains filtered or unexported fields
}

Provider holds configurations of the provider.

func (*Provider) Provide

func (p *Provider) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, constraints types.Constraints) error

Provide allows the k8s provider to provide configurations to traefik using the given configuration channel.

Jump to

Keyboard shortcuts

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