common

package
v4.0.0-alpha.0+incompa... Latest Latest
Warning

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

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

Documentation

Overview

Package common defines the types and functions that are shared by multiple commands in the cmd package.

Index

Constants

View Source
const (
	// LeaseDuration is the default duration for the leader election lease.
	LeaseDuration = 90 * time.Second
	// RenewDeadline is the default duration for the leader renewal.
	RenewDeadline = 60 * time.Second
	// RetryPeriod is the default duration for the leader electrion retrial.
	RetryPeriod = 30 * time.Second
)

Variables

This section is empty.

Functions

func CreateResourceLock

func CreateResourceLock(cb *ClientBuilder, componentNamespace, componentName string) resourcelock.Interface

CreateResourceLock returns an interface for the resource lock.

Types

type ClientBuilder

type ClientBuilder struct {
	// contains filtered or unexported fields
}

ClientBuilder can create a variety of kubernetes client interface with its embeded rest.Config.

func NewClientBuilder

func NewClientBuilder(kubeconfig string) (*ClientBuilder, error)

NewClientBuilder returns a *ClientBuilder with the given kubeconfig.

func (*ClientBuilder) APIExtClientOrDie

func (cb *ClientBuilder) APIExtClientOrDie(name string) apiext.Interface

APIExtClientOrDie returns the kubernetes client interface for extended kubernetes objects.

func (*ClientBuilder) ConfigClientOrDie

func (cb *ClientBuilder) ConfigClientOrDie(name string) configclientset.Interface

ConfigClientOrDie returns the kubernetes client interface for security related kubernetes objects such as pod security policy, security context.

func (*ClientBuilder) KubeClientOrDie

func (cb *ClientBuilder) KubeClientOrDie(name string) kubernetes.Interface

KubeClientOrDie returns the kubernetes client interface for general kubernetes objects.

func (*ClientBuilder) MachineConfigClientOrDie

func (cb *ClientBuilder) MachineConfigClientOrDie(name string) mcfgclientset.Interface

MachineConfigClientOrDie returns the kubernetes client interface for machine config.

type ControllerContext

type ControllerContext struct {
	ClientBuilder *ClientBuilder

	NamespacedInformerFactory     mcfginformers.SharedInformerFactory
	InformerFactory               mcfginformers.SharedInformerFactory
	KubeInformerFactory           informers.SharedInformerFactory
	KubeNamespacedInformerFactory informers.SharedInformerFactory
	APIExtInformerFactory         apiextinformers.SharedInformerFactory
	ConfigInformerFactory         configinformers.SharedInformerFactory

	AvailableResources map[schema.GroupVersionResource]bool

	Stop <-chan struct{}

	InformersStarted chan struct{}

	ResyncPeriod func() time.Duration
}

ControllerContext stores all the informers for a variety of kubernetes objects.

func CreateControllerContext

func CreateControllerContext(cb *ClientBuilder, stop <-chan struct{}, targetNamespace string) *ControllerContext

CreateControllerContext creates the ControllerContext with the ClientBuilder.

Jump to

Keyboard shortcuts

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