Documentation
¶
Index ¶
- Constants
- func ExecCmd(ctx context.Context, client kubernetes.Interface, config *rest.Config, ...) error
- func GetFieldOwner(managerNamespace string) string
- func GetNode(ctx context.Context, kubeClient *kubernetes.Clientset, nodeName string) *corev1.Node
- func IsPodCompleted(c kubernetes.Interface, podName, namespace string) wait.ConditionWithContextFunc
- func IsPodRunning(c kubernetes.Interface, podName, namespace string) wait.ConditionWithContextFunc
- func PtrTo[T any](v T) *T
- func Wrap(z *zap.Logger) hclog.Logger
- type DrainManager
- func (d *DrainManager) IsClusterNodesHealthy(ctx context.Context) (bool, error)
- func (d *DrainManager) IsDrainOk(ctx context.Context, node *drainv1.Node) (bool, error)
- func (d *DrainManager) IsHealthy(ctx context.Context, node *drainv1.Node) (bool, error)
- func (d *DrainManager) RunPostDrain(ctx context.Context, node *drainv1.Node) error
- func (d *DrainManager) RunPreDrain(ctx context.Context, node *drainv1.Node) error
- type Level
- type RebootManager
- func (r *RebootManager) CleanupNode(ctx context.Context, nodeName string) error
- func (r *RebootManager) IsNodeRebooted(ctx context.Context, kubeNode *corev1.Node, oldBootId string) (bool, error)
- func (r *RebootManager) IsRebootRequired(ctx context.Context, nodeName string) (bool, error)
- func (r *RebootManager) RebootNode(ctx context.Context, node *drainv1.Node) error
Constants ¶
View Source
const ( LabelPrefix = "nodedrain.k8s.slyng.dk" LabelComponent = LabelPrefix + "/component" )
Variables ¶
This section is empty.
Functions ¶
func ExecCmd ¶ added in v0.0.10
func ExecCmd(ctx context.Context, client kubernetes.Interface, config *rest.Config, pod types.NamespacedName, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error
ExecCmd exec command on specific pod and wait the command's output.
func GetFieldOwner ¶
func IsPodCompleted ¶ added in v0.0.10
func IsPodCompleted(c kubernetes.Interface, podName, namespace string) wait.ConditionWithContextFunc
func IsPodRunning ¶ added in v0.0.10
func IsPodRunning(c kubernetes.Interface, podName, namespace string) wait.ConditionWithContextFunc
Types ¶
type DrainManager ¶
type DrainManager struct {
// contains filtered or unexported fields
}
func NewDrainManager ¶
func NewDrainManager(ctx context.Context, client kClient.Client, restConfig *rest.Config, recorder record.EventRecorder) (*DrainManager, error)
func (*DrainManager) IsClusterNodesHealthy ¶
func (d *DrainManager) IsClusterNodesHealthy(ctx context.Context) (bool, error)
func (*DrainManager) RunPostDrain ¶
func (*DrainManager) RunPreDrain ¶
type RebootManager ¶
type RebootManager struct {
// contains filtered or unexported fields
}
func NewRebootManager ¶
func (*RebootManager) CleanupNode ¶
func (r *RebootManager) CleanupNode(ctx context.Context, nodeName string) error
func (*RebootManager) IsNodeRebooted ¶
func (*RebootManager) IsRebootRequired ¶
func (*RebootManager) RebootNode ¶
Click to show internal directories.
Click to hide internal directories.