root

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

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

Go to latest
Published: May 17, 2019 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNodeName             = "virtual-kubelet"
	DefaultOperatingSystem      = "Linux"
	DefaultInformerResyncPeriod = 1 * time.Minute
	DefaultMetricsAddr          = ":10255"
	DefaultListenPort           = 10250 // TODO(cpuguy83)(VK1.0): Change this to an addr instead of just a port.. we should not be listening on all interfaces.
	DefaultPodSyncWorkers       = 10
	DefaultKubeNamespace        = corev1.NamespaceAll

	DefaultTaintEffect = string(corev1.TaintEffectNoSchedule)
	DefaultTaintKey    = "virtual-kubelet.io/provider"
)

Defaults for root command options

Variables

AcceptedCiphers is the list of accepted TLS ciphers, with known weak ciphers elided Note this list should be a moving target.

Functions

func NewCommand

func NewCommand(ctx context.Context, name string, c Opts) *cobra.Command

NewCommand creates a new top-level command. This command is used to start the virtual-kubelet daemon

func NodeFromProvider

func NodeFromProvider(ctx context.Context, name string, taint *v1.Taint, p providers.Provider) *v1.Node

NodeFromProvider builds a kubernetes node object from a provider This is a temporary solution until node stuff actually split off from the provider interface itself.

func SetDefaultOpts

func SetDefaultOpts(c *Opts) error

SetDefaultOpts sets default options for unset values on the passed in option struct. Fields tht are already set will not be modified.

Types

type Opts

type Opts struct {
	// Path to the kubeconfig to use to connect to the Kubernetes API server.
	KubeConfigPath string
	// Namespace to watch for pods and other resources
	KubeNamespace string
	// Sets the port to listen for requests from the Kubernetes API server
	ListenPort int32

	// Node name to use when creating a node in Kubernetes
	NodeName string

	// Operating system to run pods for
	OperatingSystem string

	Provider           string
	ProviderConfigPath string

	TaintKey     string
	TaintEffect  string
	DisableTaint bool

	MetricsAddr string

	// Number of workers to use to handle pod notifications
	PodSyncWorkers       int
	InformerResyncPeriod time.Duration

	// Use node leases when supported by Kubernetes (instead of node status updates)
	EnableNodeLease bool

	TraceExporters  []string
	TraceSampleRate string
	TraceConfig     opencensus.TracingExporterOptions

	// Startup Timeout is how long to wait for the kubelet to start
	StartupTimeout time.Duration
}

Opts stores all the options for configuring the root virtual-kubelet command. It is used for setting flag values.

You can set the default options by creating a new `Opts` struct and passing it into `SetDefaultOpts`

Jump to

Keyboard shortcuts

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