Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyCoreDNS(controllerContext *config.ControllerContext)
- func CheckUsingHeuristic(distro string) (bool, error)
- func CheckUsingSecretAnnotation(ctx context.Context, client kubernetes.Interface, ...) (bool, error)
- func CreateVClusterKubeConfig(config *clientcmdapi.Config, options *config.VirtualClusterConfig) (*clientcmdapi.Config, error)
- func EnsureBackingStoreChanges(ctx context.Context, client kubernetes.Interface, ...) error
- func GenerateCerts(ctx context.Context, currentNamespaceClient kubernetes.Interface, ...) error
- func InitAndValidateConfig(ctx context.Context, vConfig *config.VirtualClusterConfig) error
- func Initialize(ctx context.Context, options *config.VirtualClusterConfig) error
- func NewControllerContext(ctx context.Context, options *config.VirtualClusterConfig) (*config.ControllerContext, error)
- func SetGlobalOwner(ctx context.Context, vConfig *config.VirtualClusterConfig) error
- func StartControllers(controllerContext *config.ControllerContext) error
- func StartManagers(controllerContext *config.ControllerContext, syncers []syncertypes.Object) error
- func StartProxy(ctx *config.ControllerContext) error
- func SyncKubernetesService(ctx *config.ControllerContext) error
- func UpdateSecretWithK0sCerts(ctx context.Context, currentNamespaceClient kubernetes.Interface, ...) error
- func WriteKubeConfigToSecret(ctx context.Context, currentNamespace string, ...) error
Constants ¶
const ( AnnotationDistro = "vcluster.loft.sh/distro" AnnotationStore = "vcluster.loft.sh/store" )
Variables ¶
var NewLocalManager = ctrl.NewManager
NewLocalManager is used to create a new local manager
var NewVirtualManager = ctrl.NewManager
NewVirtualManager is used to create a new virtual manager
Functions ¶
func ApplyCoreDNS ¶
func ApplyCoreDNS(controllerContext *config.ControllerContext)
func CheckUsingHeuristic ¶ added in v0.20.0
CheckUsingHeuristic checks for known file path indicating the existence of a previous distro.
It checks for the existence of the default K3s token path or the K0s data directory.
func CheckUsingSecretAnnotation ¶ added in v0.20.0
func CheckUsingSecretAnnotation(ctx context.Context, client kubernetes.Interface, name, namespace, distro string, backingStoreType vclusterconfig.StoreType) (bool, error)
CheckUsingSecretAnnotation checks for backend store and distro changes using annotations on the vCluster's secret annotations. Returns true, if both annotations are set and the check was successful, otherwise false.
func CreateVClusterKubeConfig ¶
func CreateVClusterKubeConfig(config *clientcmdapi.Config, options *config.VirtualClusterConfig) (*clientcmdapi.Config, error)
func EnsureBackingStoreChanges ¶ added in v0.20.0
func EnsureBackingStoreChanges(ctx context.Context, client kubernetes.Interface, name, namespace, distro string, backingStoreType vclusterconfig.StoreType) error
EnsureBackingStoreChanges ensures that only a certain set of allowed changes to the backing store and distro occur.
func GenerateCerts ¶ added in v0.20.0
func GenerateCerts(ctx context.Context, currentNamespaceClient kubernetes.Interface, vClusterName, currentNamespace, serviceCIDR, certificatesDir string, options *config.VirtualClusterConfig) error
func InitAndValidateConfig ¶ added in v0.20.0
func InitAndValidateConfig(ctx context.Context, vConfig *config.VirtualClusterConfig) error
func Initialize ¶
func Initialize(ctx context.Context, options *config.VirtualClusterConfig) error
Initialize creates the required secrets and configmaps for the control plane to start
func NewControllerContext ¶
func NewControllerContext(ctx context.Context, options *config.VirtualClusterConfig) (*config.ControllerContext, error)
NewControllerContext builds the controller context we can use to start the syncer
func SetGlobalOwner ¶ added in v0.19.0
func SetGlobalOwner(ctx context.Context, vConfig *config.VirtualClusterConfig) error
SetGlobalOwner fetches the owning service and populates in translate.Owner if: the vcluster is configured to setOwner is, and if the currentNamespace == targetNamespace (because cross namespace owner refs don't work).
func StartControllers ¶
func StartControllers(controllerContext *config.ControllerContext) error
func StartManagers ¶
func StartManagers(controllerContext *config.ControllerContext, syncers []syncertypes.Object) error
func StartProxy ¶
func StartProxy(ctx *config.ControllerContext) error
func SyncKubernetesService ¶
func SyncKubernetesService(ctx *config.ControllerContext) error
func UpdateSecretWithK0sCerts ¶ added in v0.19.0
func WriteKubeConfigToSecret ¶
func WriteKubeConfigToSecret(ctx context.Context, currentNamespace string, currentNamespaceClient client.Client, options *config.VirtualClusterConfig, syncerConfig *clientcmdapi.Config) error
Types ¶
This section is empty.