Documentation ¶
Overview ¶
Package registration creates a ByoHost CRD in the management cluster This is equivalent to a ByoHost joining a capacity pool
Index ¶
Constants ¶
const ( KeySize = 2048 // ExpirationSeconds defines the expiry time for Certificates // which is currently set to 1 year aligned with kubeadm defaults. ExpirationSeconds = 86400 * 365 ByohCSROrg = "byoh:hosts" ByohCSRCNFormat = "byoh:host:%s" ByohCSRNameFormat = "byoh-csr-%s" TmpPrivateKey = "byoh-client.key.tmp" DefaultConfigPath = ".byoh/config" )
Variables ¶
var ( ConfigPath string // CSRApprovalTimeout defines the time to wait for certificate to // be issued. Currently set to 1 hour. CSRApprovalTimeout = 3600 * time.Second )
Functions ¶
func GetBYOHConfigPath ¶ added in v0.3.0
func GetBYOHConfigPath() string
GetBYOHConfigPath set the directory for BYOH kubeconfig
func LoadRESTClientConfig ¶ added in v0.3.0
func LoadRESTClientConfig(kubeconfigPath string) (*restclient.Config, error)
LoadRESTClientConfig is to create an instance of *restclient.Config from the boostrap kubeconfig path, this then will be used to create bootstrap k8s client
Types ¶
type ByohCSR ¶ added in v0.3.0
type ByohCSR struct { PrivateKey []byte // contains filtered or unexported fields }
func NewByohCSR ¶ added in v0.3.0
func NewByohCSR(bootstrapClientConfig *restclient.Config, logger logr.Logger, expiryDurationInSeconds int64) (*ByohCSR, error)
NewByohCSR returns a ByohCSR instance
func (*ByohCSR) BootstrapKubeconfig ¶ added in v0.3.0
BootstrapKubeconfig will create a CertificateSigningRequest for the host its running on and once the CSR is approved it will fetch the Certificate and create a kubeconfig which will be used then by the host reconciler
type HostInfo ¶
type HostInfo struct {
DefaultNetworkInterfaceName string
}
HostInfo contains information about the host network interface.
type HostRegistrar ¶
HostRegistrar used to register a host.
var ( // LocalHostRegistrar is a HostRegistrar that registers the local host. LocalHostRegistrar *HostRegistrar )
func (*HostRegistrar) GetNetworkStatus ¶
func (hr *HostRegistrar) GetNetworkStatus() []infrastructurev1beta1.NetworkStatus
GetNetworkStatus returns the network interface(s) status for the host
func (*HostRegistrar) Register ¶
func (hr *HostRegistrar) Register(hostName, namespace string, hostLabels map[string]string) error
Register is called on agent startup This function registers the byohost as available capacity in the management cluster If the CR is already present, we consider this to be a restart / reboot of the agent process
func (*HostRegistrar) UpdateHost ¶ added in v0.3.0
func (hr *HostRegistrar) UpdateHost(ctx context.Context, byoHost *infrastructurev1beta1.ByoHost) error
UpdateHost updates the network interface and host platform details status for the host