Node maintenance API objects
The node maintenance API consists of the following objects:
Cluster level:
ClusterWorkloadLockClusterMaintenanceRequest
Node level:
NodeWorkloadLockNodeMaintenanceRequest
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"
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:
release: 21.1.0
scope: drain # drain;os; deprecated
Caution
The scope field of ClusterMaintenanceRequest is deprecated
in favor of the same field in NodeMaintenanceRequest that supports the
same options and allows for more flexible node-level maintenance.
For details, see scope field of the ClusterMaintenanceRequest resource.
apiVersion: lcm.mirantis.com/v1alpha1
kind: NodeMaintenanceRequest
metadata:
name: node-1
spec:
nodeName: node-1
release: 21.1.0
scope: drain # drain;os
The release parameter specifies the Cluster release version for which the
MaintenanceRequest object is created.
The scope parameter in the NodeMaintenanceRequest object specification
defines the impact on the MOSK node. The list of the
available options include:
drainA regular 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.
osA node might be rebooted during the update. Triggers the workload evacuation by the OpenStack Controller (Rockoon).
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.