controllers

package
v0.0.0-...-792bb18 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// ContainerProvisionedCondition documents the status of the provisioning of the container
	// generated by a DockerMachine.
	//
	// NOTE: When the container provisioning starts the process completes almost immediately and within
	// the same reconciliation, so the user will always see a transition from Wait to Provisioned without
	// having evidence that the operation is started/is in progress.
	ContainerProvisionedCondition clusterv1.ConditionType = "ContainerProvisioned"

	// WaitingForClusterInfrastructureReason (Severity=Info) documents a DockerMachine waiting for the cluster
	// infrastructure to be ready before starting to create the container that provides the DockerMachine
	// infrastructure.
	WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure"

	// WaitingForBootstrapDataReason (Severity=Info) documents a DockerMachine waiting for the bootstrap
	// script to be ready before starting to create the container that provides the DockerMachine infrastructure.
	WaitingForBootstrapDataReason = "WaitingForBootstrapData"

	// ContainerProvisioningFailedReason (Severity=Warning) documents a DockerMachine controller detecting
	// an error while provisioning the container that provides the DockerMachine infrastructure; those kind of
	// errors are usually transient and failed provisioning are automatically re-tried by the controller.
	ContainerProvisioningFailedReason = "ContainerProvisioningFailed"
)
View Source
const (
	// BootstrapExecSucceededCondition provides an observation of the DockerMachine bootstrap process.
	// 	It is set based on successful execution of bootstrap commands and on the existence of
	//	the /run/cluster-api/bootstrap-success.complete file.
	// The condition gets generated after ContainerProvisionedCondition is True.
	//
	// NOTE as a difference from other providers, container provisioning and bootstrap are directly managed
	// by the DockerMachine controller (not by cloud-init).
	BootstrapExecSucceededCondition clusterv1.ConditionType = "BootstrapExecSucceeded"

	// BootstrappingReason documents (Severity=Info) a DockerMachine currently executing the bootstrap
	// script that creates the Kubernetes node on the newly provisioned machine infrastructure.
	BootstrappingReason = "Bootstrapping"

	// BootstrapFailedReason documents (Severity=Warning) a DockerMachine controller detecting an error while
	// bootstrapping the Kubernetes node on the machine just provisioned; those kind of errors are usually
	// transient and failed bootstrap are automatically re-tried by the controller.
	BootstrapFailedReason = "BootstrapFailed"
)
View Source
const (
	// LoadBalancerAvailableCondition documents the availability of the container that implements the cluster load balancer.
	//
	// NOTE: When the load balancer provisioning starts the process completes almost immediately and within
	// the same reconciliation, so the user will always see a transition from no condition to available without
	// having evidence that the operation is started/is in progress.
	LoadBalancerAvailableCondition clusterv1.ConditionType = "LoadBalancerAvailable"

	// LoadBalancerProvisioningFailedReason (Severity=Warning) documents a DockerCluster controller detecting
	// an error while provisioning the container that provides the cluster load balancer.; those kind of
	// errors are usually transient and failed provisioning are automatically re-tried by the controller.
	LoadBalancerProvisioningFailedReason = "LoadBalancerProvisioningFailed"
)
View Source
const (
	EnvSkipRDE = "CAPVCD_SKIP_RDE"

	RDEStatusResolved = "RESOLVED"
	VCDLocationHeader = "Location"

	ClusterApiStatusPhaseReady    = "Ready"
	ClusterApiStatusPhaseNotReady = "Not Ready"
	CapvcdInfraId                 = "CapvcdInfraId"

	NoRdePrefix     = `NO_RDE_`
	VCDResourceVApp = "VApp"

	TcpPort = 6443
)
View Source
const (
	ReclaimPolicyDelete = "Delete"
	ReclaimPolicyRetain = "Retain"

	VcdResourceTypeVM = "virtual-machine"
)
View Source
const (
	NetworkConfiguration                   = "guestinfo.postcustomization.networkconfiguration.status"
	ProxyConfiguration                     = "guestinfo.postcustomization.proxy.setting.status"
	MeteringConfiguration                  = "guestinfo.metering.status"
	KubeadmInit                            = "guestinfo.postcustomization.kubeinit.status"
	KubeadmNodeJoin                        = "guestinfo.postcustomization.kubeadm.node.join.status"
	NvidiaRuntimeInstall                   = "guestinfo.postcustomization.nvidia.runtime.install.status"
	PostCustomizationScriptExecutionStatus = "guestinfo.post_customization_script_execution_status"
	PostCustomizationScriptFailureReason   = "guestinfo.post_customization_script_execution_failure_reason"
)
View Source
const Mebibyte = 1048576

Variables

View Source
var (
	CAPVCDEntityTypeID = fmt.Sprintf("urn:vcloud:type:%s:%s:%s", capisdk.CAPVCDTypeVendor, capisdk.CAPVCDTypeNss, rdeType.CapvcdRDETypeVersion)
	OneArmDefault      = vcdsdk.OneArm{
		StartIP: "192.168.8.2",
		EndIP:   "192.168.8.100",
	}
	SkipRDE = vcdutil.Str2Bool(os.Getenv(EnvSkipRDE))
)

Functions

func MergeJinjaToCloudInitScript

func MergeJinjaToCloudInitScript(cloudInitConfig CloudInitScriptInput, jinjaConfig string) ([]byte, error)

MergeJinjaToCloudInitScript : merges the cloud init config with a jinja config and adds a `#cloudconfig` header. Does a couple of special handling: takes jinja's runcmd and embeds it into a fixed location in the cloudInitConfig. Returns the merged bytes or nil and error.

Types

type CloudInitScriptInput

type CloudInitScriptInput struct {
	ControlPlane        bool   // control plane node
	NvidiaGPU           bool   // configure containerd for NVIDIA libraries
	BootstrapRunCmd     string // bootstrap run command
	HTTPProxy           string // httpProxy endpoint
	HTTPSProxy          string // httpsProxy endpoint
	NoProxy             string // no proxy values
	MachineName         string // vm host name
	ResizedControlPlane bool   // resized node type: worker | control_plane
	VcdHostFormatted    string // vcd host
	TKGVersion          string // tkgVersion
	ClusterID           string //cluster id
}

type NoRDEError

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

NoRDEError is an error used when the InfraID value in the VCDCluster object does not point to a valid RDE in VCD

func NewNoRDEError

func NewNoRDEError(message string) *NoRDEError

func (*NoRDEError) Error

func (nre *NoRDEError) Error() string

type VCDClusterReconciler

type VCDClusterReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

VCDClusterReconciler reconciles a VCDCluster object

func (*VCDClusterReconciler) Reconcile

func (r *VCDClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, rerr error)

func (*VCDClusterReconciler) SetupWithManager

func (r *VCDClusterReconciler) SetupWithManager(mgr ctrl.Manager, options controller.Options) error

SetupWithManager sets up the controller with the Manager.

type VCDMachineReconciler

type VCDMachineReconciler struct {
	client.Client
}

VCDMachineReconciler reconciles a VCDMachine object

func (*VCDMachineReconciler) Reconcile

func (r *VCDMachineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, rerr error)

+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=vcdmachines,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=vcdmachines/status,verbs=get;update;patch +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=vcdmachines/finalizers,verbs=update

func (*VCDMachineReconciler) SetupWithManager

func (r *VCDMachineReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager,
	options controller.Options) error

SetupWithManager sets up the controller with the Manager.

func (*VCDMachineReconciler) VCDClusterToVCDMachines

func (r *VCDMachineReconciler) VCDClusterToVCDMachines(o client.Object) []ctrl.Request

VCDClusterToVCDMachines is a handler.ToRequestsFunc to be used to enqueue requests for reconciliation of VCDMachines.

Jump to

Keyboard shortcuts

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