controlplane

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 37 Imported by: 0

Documentation

Overview

Package controlplane contains code for setting up and running a OneX control plane API server.

Index

Constants

View Source
const (
	// DefaultEndpointReconcilerInterval is the default amount of time for how often the endpoints for
	// the kubernetes Service are reconciled.
	DefaultEndpointReconcilerInterval = 10 * time.Second
	// DefaultEndpointReconcilerTTL is the default TTL timeout for the storage layer
	DefaultEndpointReconcilerTTL = 15 * time.Second
	// IdentityLeaseComponentLabelKey is used to apply a component label to identity lease objects, indicating:
	//   1. the lease is an identity lease (different from leader election leases)
	//   2. which component owns this lease
	IdentityLeaseComponentLabelKey = "apiserver.kubernetes.io/identity"
	// KubeAPIServer defines variable used internally when referring to kube-apiserver component
	KubeAPIServer = "kube-apiserver"
	// KubeAPIServerIdentityLeaseLabelSelector selects kube-apiserver identity leases
	KubeAPIServerIdentityLeaseLabelSelector = IdentityLeaseComponentLabelKey + "=" + KubeAPIServer
)

Variables

This section is empty.

Functions

func DefaultAPIResourceConfigSource

func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig

DefaultAPIResourceConfigSource returns which groupVersion enabled and its resources enabled/disabled.

Types

type CompletedConfig

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

CompletedConfig embeds a private pointer that cannot be instantiated outside of this package.

func (CompletedConfig) New

func (c CompletedConfig) New(delegationTarget genericapiserver.DelegationTarget) (*Instance, error)

New returns a new instance of APIServer from the given config. Certain config fields will be set to a default value if unset.

type Config

type Config struct {
	GenericConfig *genericapiserver.RecommendedConfig
	ExtraConfig   ExtraConfig
}

Config defines configuration for the onex-apiserver.

func (*Config) Complete

func (c *Config) Complete() CompletedConfig

Complete fills in any fields not set that are required to have valid data. It's mutating the receiver.

type ExtraConfig

type ExtraConfig struct {
	// Place you custom config here.
	APIResourceConfigSource serverstorage.APIResourceConfigSource
	StorageFactory          serverstorage.StorageFactory
	EventTTL                time.Duration
	EnableLogsSupport       bool
	ProxyTransport          *http.Transport

	// PeerProxy, if not nil, sets proxy transport between kube-apiserver peers for requests
	// that can not be served locally
	PeerProxy utilpeerproxy.Interface
	// PeerEndpointLeaseReconciler updates the peer endpoint leases
	PeerEndpointLeaseReconciler peerreconcilers.PeerEndpointLeaseReconciler

	// Number of masters running; all masters must be started with the
	// same value for this field. (Numbers > 1 currently untested.)
	MasterCount int

	VersionedInformers     informers.SharedInformerFactory
	KubeVersionedInformers kubeinformers.SharedInformerFactory
}

ExtraConfig defines extra configuration for the onex-apiserver.

type Instance

type Instance struct {
	GenericAPIServer *genericapiserver.GenericAPIServer
}

Instance contains state for a onex-apiserver instance.

func (*Instance) InstallAPIs

func (m *Instance) InstallAPIs(
	apiResourceConfigSource serverstorage.APIResourceConfigSource,
	restOptionsGetter generic.RESTOptionsGetter,
	restStorageProviders ...storage.RESTStorageProvider,
) error

Instance will install the APIs for the restStorageProviders if they are enabled.

func (*Instance) InstallLegacyAPI

func (m *Instance) InstallLegacyAPI(c *completedConfig, restOptionsGetter generic.RESTOptionsGetter) error

InstallLegacyAPI will install the legacy APIs for the restStorageProviders if they are enabled.

Directories

Path Synopsis
admission
plugin/minerset
Package minerset contains an admission controller that modifies and validation every new MinerSet.
Package minerset contains an admission controller that modifies and validation every new MinerSet.
Package app does all of the work necessary to create a OneX APIServer by binding together the API, master and APIServer infrastructure.
Package app does all of the work necessary to create a OneX APIServer by binding together the API, master and APIServer infrastructure.
options
Package options contains flags and options for initializing an apiserver
Package options contains flags and options for initializing an apiserver
controller

Jump to

Keyboard shortcuts

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