Node maintenance API objects¶
The node maintenance API consists of the following objects:
Cluster level:
ClusterWorkloadLock
ClusterMaintenanceRequest
Node level:
NodeWorkloadLock
NodeMaintenanceRequest
WorkloadLock objects¶
The WorkloadLock
objects are created by each Application Controller.
These objects prevent LCM from performing any changes on the cluster or node
level while the lock is in the active state. The inactive state of the lock
means that the Application Controller has finished its work and the LCM can
proceed with the node or cluster maintenance.
apiVersion: lcm.mirantis.com/v1alpha1
kind: ClusterWorkloadLock
metadata:
name: cluster-1-openstack
spec:
controllerName: openstack
status:
state: active # inactive;active;failed (default: active)
errorMessage: ""
release: "6.16.0+21.3"
apiVersion: lcm.mirantis.com/v1alpha1
kind: NodeWorkloadLock
metadata:
name: node-1-openstack
spec:
nodeName: node-1
controllerName: openstack
status:
state: active # inactive;active;failed (default: active)
errorMessage: ""
release: "6.16.0+21.3"
MaintenanceRequest objects¶
The MaintenanceRequest
objects are created by LCM. These objects notify
Application Controllers about the upcoming maintenance of a cluster or
a specific node.
apiVersion: lcm.mirantis.com/v1alpha1
kind: ClusterMaintenanceRequest
metadata:
name: cluster-1
spec:
scope: drain # drain;os
apiVersion: lcm.mirantis.com/v1alpha1
kind: NodeMaintenanceRequest
metadata:
name: node-1
spec:
nodeName: node-1
scope: drain # drain;os
The scope
parameter in the object specification defines the impact on
the managed cluster or node. The list of the available options include:
drain
A regular managed cluster update. Each node in the cluster goes over a drain procedure. No node reboot takes place, a maximum impact includes restart of services on the node including Docker, which causes the restart of all containers present in the cluster.
os
A node might be rebooted during the update. Triggers the workload evacuation by the OpenStack Controller.
When the MaintenanceRequest
object is created, an Application Controller
executes a handler to prepare workloads for maintenance and put appropriate
WorkloadLock
objects into the inactive state.
When maintenance is over, LCM removes MaintenanceRequest
objects,
and the Application Controllers move their WorkloadLocks
objects into
the active state.