opts

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: Apache-2.0 Imports: 9 Imported by: 13

Documentation

Index

Constants

View Source
const (
	DefaultNodeName             = "virtual-kubelet"
	DefaultOperatingSystem      = "Linux"
	DefaultInformerResyncPeriod = 1 * time.Minute
	DefaultMetricsAddr          = ""
	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
	DefaultKubeClusterDomain    = "cluster.local"

	DefaultTaintEffect           = string(corev1.TaintEffectNoSchedule)
	DefaultTaintKey              = "virtual-kubelet.io/provider"
	DefaultStreamIdleTimeout     = 4 * time.Hour
	DefaultStreamCreationTimeout = 30 * time.Second
)

Defaults for root command options

Variables

This section is empty.

Functions

This section is empty.

Types

type Authentication added in v0.5.0

type Authentication struct {
	// webhook contains settings related to webhook bearer token authentication
	Webhook WebhookAuthentication
}

Authentication holds the Kubetlet Authentication setttings.

type Authorization added in v0.5.0

type Authorization struct {
	// webhook contains settings related to Webhook authorization.
	Webhook WebhookAuthorization
}

Authorization holds the state related to the authorization in the kublet.

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
	// Domain suffix to append to search domains for the pods created by virtual-kubelet
	KubeClusterDomain 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
	TaintValue   string
	DisableTaint bool

	MetricsAddr string

	// Only trust clients with tls certs signed by the provided CA
	ClientCACert string
	// Do not require client tls verification
	AllowUnauthenticatedClients bool

	// 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

	// Startup Timeout is how long to wait for the kubelet to start
	StartupTimeout time.Duration
	// StreamIdleTimeout is the maximum time a streaming connection
	// can be idle before the connection is automatically closed.
	StreamIdleTimeout time.Duration
	// StreamCreationTimeout is the maximum time for streaming connection
	StreamCreationTimeout time.Duration

	// KubeAPIQPS is the QPS to use while talking with kubernetes apiserver
	KubeAPIQPS int32
	// KubeAPIBurst is the burst to allow while talking with kubernetes apiserver
	KubeAPIBurst int32

	// SyncPodsFromKubernetesRateLimiter defines the rate limit for the SyncPodsFromKubernetes queue
	SyncPodsFromKubernetesRateLimiter workqueue.RateLimiter
	// DeletePodsFromKubernetesRateLimiter defines the rate limit for the DeletePodsFromKubernetesRateLimiter queue
	DeletePodsFromKubernetesRateLimiter workqueue.RateLimiter
	// SyncPodStatusFromProviderRateLimiter defines the rate limit for the SyncPodStatusFromProviderRateLimiter queue
	SyncPodStatusFromProviderRateLimiter workqueue.RateLimiter

	Version string

	// authentication specifies how requests to the virtual-kubelet's server are authenticated
	Authentication Authentication
	// authorization specifies how requests to the virtual-kubelet's server are authorized
	Authorization Authorization
}

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`

func FromEnv

func FromEnv() (*Opts, error)

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

func New

func New() *Opts

type WebhookAuthentication added in v0.5.0

type WebhookAuthentication struct {
	// enabled allows bearer token authentication backed by the tokenreviews.authentication.k8s.io API
	Enabled bool
	// cacheTTL enables caching of authentication results
	CacheTTL metav1.Duration
}

WebhookAuthentication contains settings related to webhook authentication

type WebhookAuthorization added in v0.5.0

type WebhookAuthorization struct {
	// cacheAuthorizedTTL is the duration to cache 'authorized' responses from the webhook authorizer.
	CacheAuthorizedTTL metav1.Duration
	// cacheUnauthorizedTTL is the duration to cache 'unauthorized' responses from the webhook authorizer.
	CacheUnauthorizedTTL metav1.Duration
}

WebhookAuthorization holds the state related to the Webhook Authorization in the Kubelet.

Jump to

Keyboard shortcuts

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