k8s

package
v0.1.11 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cluster *lang.Cluster, cfg config.Plugins) (plugin.ClusterPlugin, error)

New creates new instance of the Kubernetes cluster plugin for specified Cluster and plugins config

Types

type ClusterConfig

type ClusterConfig struct {
	Namespace  string      `yaml:",omitempty"`
	Local      bool        `yaml:",omitempty"`
	Context    string      `yaml:",omitempty"`
	KubeConfig interface{} `yaml:",omitempty"` // it's just a kubeconfig, we don't need to parse it
}

ClusterConfig represents Kubernetes cluster plugin configuration

type Plugin

type Plugin struct {
	Cluster         *lang.Cluster
	RestConfig      *rest.Config
	ClientConfig    clientcmd.ClientConfig
	Namespace       string
	ExternalAddress string
	// contains filtered or unexported fields
}

Plugin represents Kubernetes cluster plugin

func (*Plugin) AddEndpointsFromService

func (plugin *Plugin) AddEndpointsFromService(service *api.Service, endpoints map[string]string)

AddEndpointsFromService searches for the available endpoints in specified service and writes them into provided map

func (*Plugin) Cleanup

func (plugin *Plugin) Cleanup() error

Cleanup intended to run cleanup operations for plugin, but it's not used in Kubernetes cluster plugin

func (*Plugin) EnsureNamespace

func (plugin *Plugin) EnsureNamespace(client kubernetes.Interface, namespace string) error

EnsureNamespace ensures configured Kubernetes namespace

func (*Plugin) Init

func (plugin *Plugin) Init() error

Init parses Kubernetes cluster config and retrieves external address for Kubernetes cluster

func (*Plugin) NewClient

func (plugin *Plugin) NewClient() (kubernetes.Interface, error)

NewClient returns new instance of the Kubernetes client created from the cached in the plugin cluster config

func (*Plugin) Validate

func (plugin *Plugin) Validate() error

Validate checks Kubernetes cluster by connecting to it and ensuring configured namespace

Jump to

Keyboard shortcuts

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