const ( SocketReadTimeout time.Duration = 30 * time.Second SocketWriteTimeout time.Duration = 300 * time.Second )
PlaceholderToken is only set statically to make kubeadm not randomize the token on every run
var PlaceholderToken = bootstraptokenv1.BootstrapToken{ Token: &bootstraptokenv1.BootstrapTokenString{ ID: "abcdef", Secret: "0123456789abcdef", }, }
func DeleteMember(ctx context.Context, cfg leave.Conf) error
deleteEtcdMember() deletes the EtcdMember resource which matches the node name successful completion is not essential for the LAN outage Leave operation so it returns nil in all cases
func RemoveEtcdManifest(ctx context.Context, cfg leave.Conf) error
func RemoveKubeConfig(ctx context.Context, cfg leave.Conf) error
removeKubeConfig removes the zylevel0.conf kubeconfig and keys from the node's filesystem
func RemoveKubeManifests(ctx context.Context, cfg leave.Conf) error
removeKubeManifests removes the kubernetes kube-apiserver, controller manager, and scheduler static pod manifests from the node's filesystem.
func RemoveLOMFlag(ctx context.Context, cfg leave.Conf) error
func RemoveVipAlias(ctx context.Context, cfg leave.Conf) error
func removeVipAlias() removes the VIP alias from the lo interface, doesn't error if there isn't a VIP present
func ReverseIsolateNode(ctx context.Context, cfg leave.Conf) error
func Run() error
Action encodes the operations that the reconciler can effect on the node
type Action int
const ( None Action = iota Enter Leave Stay )
type Conn struct {
// contains filtered or unexported fields
}
func (c *Conn) Receive() (string, error)
Receive reads from the connection
func (c *Conn) Respond(response string, errMessage string) error
Respond writes to the connection
LANDetector performs a connection test to the control plane
type LANDetector struct { *LOMReconciler // contains filtered or unexported fields }
func (l LANDetector) Detect() error
Detect makes a ping request for the control plane
type LOMReconciler struct {
// contains filtered or unexported fields
}
func NewLOMReconciler(cfg config.Config, isLOM bool) *LOMReconciler
func (l *LOMReconciler) Enter(ctx context.Context) error
main function for entering LAN outage mode
func (l LOMReconciler) EnterPreconditionCheck(ctx context.Context) (bool, error)
Checks if the following pre-conditions for Enter are true: - LOM is enabled in the LOMConfig file - local node is not already acting as a control plane - etcd is provisioned on the worker node
func (l LOMReconciler) GetFs() afero.Fs
func (l *LOMReconciler) Leave(ctx context.Context) error
main function for leaving LAN outage mode
func (l LOMReconciler) LeavePreconditionCheck(ctx context.Context) (bool, error)
Checks if the following pre-conditions for Leave are true: - LOM is enabled in the LOMConfig file - local node is not already acting as a control plane - the main etcd cluster is healthy
func (l LOMReconciler) WithLock(fn func() error) (bool, error)
WithLock returns the error of the input function and reports whether the lock was acquired.
type SocketHandler struct {
// contains filtered or unexported fields
}
func NewSocketHandler(path string) (*SocketHandler, error)
NewSocketHandler creates a new SocketHandler, clearing any stale sockets
func (s *SocketHandler) Clear() error
Clear removes the socket file
func (s *SocketHandler) ReceiveConnection() (*Conn, error)
ReceiveConnection waits for a connection and returns it
type SocketResponse struct { Message string `json:"message,omitempty"` Error string `json:"error,omitempty"` }
type Step func() error