options

package
v0.18.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHostsRewriteImage = "library/alpine:3.13.1"
	GenericConfig            = "CONFIG"
)

Variables

View Source
var DefaultEnabledControllers = sets.New(

	"services",
	"configmaps",
	"secrets",
	"endpoints",
	"pods",
	"events",
	"persistentvolumeclaims",
	"fake-nodes",
	"fake-persistentvolumes",
)
View Source
var ExistingControllers = sets.New(
	"services",
	"configmaps",
	"secrets",
	"endpoints",
	"pods",
	"events",
	"fake-nodes",
	"fake-persistentvolumes",
	"persistentvolumeclaims",
	"ingresses",
	"ingressclasses",
	"nodes",
	"persistentvolumes",
	"storageclasses",
	"hoststorageclasses",
	"priorityclasses",
	"networkpolicies",
	"volumesnapshots",
	"poddisruptionbudgets",
	"serviceaccounts",
	"csinodes",
	"csidrivers",
	"csistoragecapacities",
	"namespaces",
)

Functions

func AddFlags

func AddFlags(flags *pflag.FlagSet, options *VirtualClusterOptions)

func DisableMissingAPIs

func DisableMissingAPIs(discoveryClient discovery.DiscoveryInterface, controllers sets.Set[string]) (sets.Set[string], error)

DisableMissingAPIs checks if the apis are enabled, if any are missing, disable the syncer and print a log

func ParseControllers

func ParseControllers(options *VirtualClusterOptions) (sets.Set[string], error)

Types

type ControllerContext

type ControllerContext struct {
	Context context.Context

	LocalManager          ctrl.Manager
	VirtualManager        ctrl.Manager
	VirtualRawConfig      *clientcmdapi.Config
	VirtualClusterVersion *version.Info

	CurrentNamespace       string
	CurrentNamespaceClient client.Client

	Controllers             sets.Set[string]
	AdditionalServerFilters []servertypes.Filter
	Options                 *VirtualClusterOptions
	StopChan                <-chan struct{}

	//set of extra services that should handle the traffic or pass it along
	ExtraHandlers []func(http.Handler) http.Handler
}

type VirtualClusterOptions

type VirtualClusterOptions struct {
	Controllers []string `json:"controllers,omitempty"`

	ServerCaCert        string   `json:"serverCaCert,omitempty"`
	ServerCaKey         string   `json:"serverCaKey,omitempty"`
	TLSSANs             []string `json:"tlsSans,omitempty"`
	RequestHeaderCaCert string   `json:"requestHeaderCaCert,omitempty"`
	ClientCaCert        string   `json:"clientCaCert,omitempty"`
	KubeConfigPath      string   `json:"kubeConfig,omitempty"`

	KubeConfigContextName     string   `json:"kubeConfigContextName,omitempty"`
	KubeConfigSecret          string   `json:"kubeConfigSecret,omitempty"`
	KubeConfigSecretNamespace string   `json:"kubeConfigSecretNamespace,omitempty"`
	KubeConfigServer          string   `json:"kubeConfigServer,omitempty"`
	Tolerations               []string `json:"tolerations,omitempty"`

	BindAddress string `json:"bindAddress,omitempty"`
	Port        int    `json:"port,omitempty"`

	Name string `json:"name,omitempty"`

	TargetNamespace string `json:"targetNamespace,omitempty"`
	ServiceName     string `json:"serviceName,omitempty"`

	SetOwner bool `json:"setOwner,omitempty"`

	SyncAllNodes        bool     `json:"syncAllNodes,omitempty"`
	EnableScheduler     bool     `json:"enableScheduler,omitempty"`
	DisableFakeKubelets bool     `json:"disableFakeKubelets,omitempty"`
	FakeKubeletIPs      bool     `json:"fakeKubeletIPs,omitempty"`
	ClearNodeImages     bool     `json:"clearNodeImages,omitempty"`
	TranslateImages     []string `json:"translateImages,omitempty"`

	NodeSelector        string `json:"nodeSelector,omitempty"`
	EnforceNodeSelector bool   `json:"enforceNodeSelector,omitempty"`
	ServiceAccount      string `json:"serviceAccount,omitempty"`

	OverrideHosts               bool   `json:"overrideHosts,omitempty"`
	OverrideHostsContainerImage string `json:"overrideHostsContainerImage,omitempty"`

	ClusterDomain string `json:"clusterDomain,omitempty"`

	LeaderElect   bool  `json:"leaderElect,omitempty"`
	LeaseDuration int64 `json:"leaseDuration,omitempty"`
	RenewDeadline int64 `json:"renewDeadline,omitempty"`
	RetryPeriod   int64 `json:"retryPeriod,omitempty"`

	DisablePlugins      bool     `json:"disablePlugins,omitempty"`
	PluginListenAddress string   `json:"pluginListenAddress,omitempty"`
	Plugins             []string `json:"plugins,omitempty"`

	DefaultImageRegistry string `json:"defaultImageRegistry,omitempty"`

	EnforcePodSecurityStandard string `json:"enforcePodSecurityStandard,omitempty"`

	MapHostServices    []string `json:"mapHostServices,omitempty"`
	MapVirtualServices []string `json:"mapVirtualServices,omitempty"`

	SyncLabels []string `json:"syncLabels,omitempty"`

	IsK8sDistro bool `json:"singleBinaryDistro,omitempty"`

	// hostpath mapper options
	// this is only needed if using vcluster-hostpath-mapper component
	// see: https://github.com/loft-sh/vcluster-hostpath-mapper
	MountPhysicalHostPaths bool `json:"mountPhysicalHostPaths,omitempty"`
	// To enable FSMounts functionality
	VirtualLogsPath          string
	VirtualPodLogsPath       string
	VirtualContainerLogsPath string
	VirtualKubeletPodPath    string

	HostMetricsBindAddress    string `json:"hostMetricsBindAddress,omitempty"`
	VirtualMetricsBindAddress string `json:"virtualMetricsBindAddress,omitempty"`

	MultiNamespaceMode bool     `json:"multiNamespaceMode,omitempty"`
	NamespaceLabels    []string `json:"namespaceLabels,omitempty"`
	SyncAllSecrets     bool     `json:"syncAllSecrets,omitempty"`
	SyncAllConfigMaps  bool     `json:"syncAllConfigMaps,omitempty"`

	ProxyMetricsServer         bool `json:"proxyMetricsServer,omitempty"`
	ServiceAccountTokenSecrets bool `json:"serviceAccountTokenSecrets,omitempty"`

	// DEPRECATED FLAGS
	RewriteHostPaths                   bool `json:"rewriteHostPaths,omitempty"`
	DeprecatedSyncNodeChanges          bool `json:"syncNodeChanges"`
	DeprecatedDisableSyncResources     string
	DeprecatedOwningStatefulSet        string
	DeprecatedUseFakeNodes             bool
	DeprecatedUseFakePersistentVolumes bool
	DeprecatedEnableStorageClasses     bool
	DeprecatedEnablePriorityClasses    bool
	DeprecatedSuffix                   string
	DeprecatedUseFakeKubelets          bool
}

VirtualClusterOptions holds the cmd flags

Jump to

Keyboard shortcuts

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