Documentation
¶
Index ¶
- func CordonAndDrainNode(ctx context.Context, clientset *kubernetes.Clientset, node *v1.Node) bool
- func CordonNode(ctx context.Context, clientset *kubernetes.Clientset, node *v1.Node, ...) error
- func DeleteNodeViaRancher(ctx context.Context, clientset *kubernetes.Clientset, nodeName string) bool
- func DrainNode(ctx context.Context, clientset *kubernetes.Clientset, node *v1.Node) error
- func GenerateKubeconfig(ctx context.Context, clusterID string) (string, error)
- func GetClusterID() (string, error)
- func GetConfig(ctx context.Context) (*rest.Config, error)
- func HardRebootViaHarvester(ctx context.Context, clientset *kubernetes.Clientset, nodeName string) bool
- func IsNewNode(node *v1.Node) bool
- func IsNodeReady(ctx context.Context, clientset *kubernetes.Clientset, nodeName string) (bool, error)
- func SshAndRebootNode(ctx context.Context, clientset *kubernetes.Clientset, nodeName string) bool
- func UncordonNode(ctx context.Context, clientset *kubernetes.Clientset, node *v1.Node) error
- func WaitForNodeRecovery(ctx context.Context, clientset *kubernetes.Clientset, node *v1.Node) bool
- type Machine
- type MachineList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CordonAndDrainNode ¶
func CordonNode ¶
func DeleteNodeViaRancher ¶
func DeleteNodeViaRancher(ctx context.Context, clientset *kubernetes.Clientset, nodeName string) bool
DeleteNodeViaRancher deletes a node from the Rancher managed cluster based on the node name.
func GenerateKubeconfig ¶
GenerateKubeconfig creates a kubeconfig for a specified cluster and returns it as a string.
func GetClusterID ¶
GetClusterID fetches the cluster ID for a given cluster name from Rancher.
func HardRebootViaHarvester ¶
func HardRebootViaHarvester(ctx context.Context, clientset *kubernetes.Clientset, nodeName string) bool
HardRebootViaHarvester reboots a virtual machine managed by Harvester via an API call.
func IsNewNode ¶
IsNewNode checks if a node is considered "new" based on a configurable age threshold.
func IsNodeReady ¶
func IsNodeReady(ctx context.Context, clientset *kubernetes.Clientset, nodeName string) (bool, error)
IsNodeReady checks if the node is in a ready state.
func SshAndRebootNode ¶
SshAndRebootNode reboots a node by SSHing into it and running the reboot command.
func UncordonNode ¶
uncordonNode uncordons the given node.
func WaitForNodeRecovery ¶
WaitForNodeRecovery waits for a node to recover within the specified duration.
Types ¶
type Machine ¶
type Machine struct { Metadata struct { Name string `json:"name"` } `json:"metadata"` Spec struct { InfrastructureRef struct { Name string `json:"name"` } `json:"infrastructureRef"` } `json:"spec"` }
Machine represents a single machine in the Rancher API response
type MachineList ¶
type MachineList struct {
Data []Machine `json:"data"`
}
MachineList represents the list of machines fetched from the Rancher API