k8sapi

package
v0.0.0-...-0c53b8b Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package kubernetes provides the kubernetes backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIWatcher

type APIWatcher interface {

	// Informers should return a list of functions that return an Kubernetes Object Informer, each mapped by watch name.
	// k8s_api will start each Informer on the API connection. If multiple plugins return an Informer func with the same
	// name, the first plugin (per plugin execution order), will take precedence.
	Informers() map[string]InformerFunc

	// SetIndexer should set the index passed to a local pointer to be used by the plugin.  k8s_api calls this function
	// for *all* Informers added via the Informers() function by any plugins implementing APIWatcher. This enables
	// multiple plugins to share the same store/index managed by a single Informer.
	SetIndexer(string, cache.KeyListerGetter) error

	// SetHasSynced should set the HasSyncedFunc passed to a local function to be used by the plugin. Implement this
	// if the plugin needs to know if the API informers have fully synced (i.e. completed initial list action before
	// beginning the watch).
	SetHasSynced(HasSyncedFunc)
}

type HasSyncedFunc

type HasSyncedFunc func() bool

type Informer

type Informer struct {
	Controller cache.Controller
	Lister     cache.KeyListerGetter
}

type InformerFunc

type InformerFunc func(context.Context, kubernetes.Interface) *Informer

type KubeAPI

type KubeAPI struct {
	APIServer     string
	APICertAuth   string
	APIClientCert string
	APIClientKey  string
	ClientConfig  clientcmd.ClientConfig
	APIConn       apiController
	// contains filtered or unexported fields
}

KubeAPI implements a plugin that connects to a Kubernetes cluster.

func New

func New(zones []string) *KubeAPI

New returns a initialized Kubernetes. It default interfaceAddrFunc to return 127.0.0.1. All other values default to their zero value, primaryZoneIndex will thus point to the first zone.

func (*KubeAPI) InitKubeCache

func (k *KubeAPI) InitKubeCache(ctx context.Context) (err error)

InitKubeCache initializes a new Kubernetes cache.

func (*KubeAPI) RegisterKubeCache

func (k *KubeAPI) RegisterKubeCache(c *caddy.Controller)

RegisterKubeCache registers KubeCache start and stop functions with Caddy

Jump to

Keyboard shortcuts

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