kubernetes-sigs / cluster-api

Home for Cluster API, a subproject of sig-cluster-lifecycle
https://cluster-api.sigs.k8s.io
Apache License 2.0
3.5k stars 1.3k forks source link

Add conditions to the DockerMachine object #3111

Closed fabriziopandini closed 4 years ago

fabriziopandini commented 4 years ago

User Story

As a developer/user/operator I would like to have conditions documenting the operational state of DockerMachine objects

Detailed Description

The DockerMachine object drives the process that creates a docker container and starts a Kubernetes node on it; please note that, as a difference from other providers, container provisioning and bootstrap are directly managed by the controller (not by cloud-init).

The DockerMachine creation process waits for the cluster infrastructure to be ready and for the machine's bootstrap config to be ready; once the Kubernetes node is started, no further actions are taken.

As a consequence, I'm proposing to implement two conditions for the DockerMachine object

// ContainerProvisioningSucceeded provides an observation of the provisioning of the
// container that provides the DockerMachine infrastructure.
// The condition gets generated at the first reconciliation.
ContainerProvisionedCondition clusterv1.ConditionType = "ContainerProvisioned"

// BootstrapExecSucceeded provides an observation of the DockerMachine bootstrap process.
BootstrapExecSucceededCondition clusterv1.ConditionType = "BootstrapExecSucceeded"

The ContainerProvisioningSucceeded state=False will be further detailed by the following reasons:

Nb, When the Container creation starts the process completes almost immediately and within the same reconciliation, so the user will always see a transition from Wait to Succeed without having evidence that the operation is started.

The BootstrapExecSucceeded state=False will be further detailed by the following reasons:

Nb, Given that the bootstrap operation takes 30 seconds or more, we are going to change the controller implementation so we can make it visible when the machine is actually bootstrapping.

Anything else you would like to add: As required by the condition CAEP, the DockerMachine objects should also provide a Ready condition describing the overall state of the object, in this case, the summary of ContainerProvisioned and BootstrapExecSucceeded.

/kind feature

vincepri commented 4 years ago

/milestone v0.3.x

fabriziopandini commented 4 years ago

/assign /lifecycle active