Skip to content

Commit

Permalink
Update gitbook
Browse files Browse the repository at this point in the history
Signed-off-by: Vince Prignano <vincepri@vmware.com>
  • Loading branch information
vincepri committed Feb 7, 2019
1 parent f412e47 commit bf6bc41
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions docs/book/common_code/machine_controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@ the host with a new one matching the updated spec. If a `Machine` object is
deleted, the corresponding `Node` should have its external resources released by
the provider-specific controller, and should be deleted as well.

Machines can be associated with a Cluster using a custom label
`cluster.k8s.io/clusterName`. Providers using the `Cluster` controller must
provide the label which references the name of a cluster living in the same
namespace.

{% method %}
## Machine

`Machine` has 4 fields:

`Spec` contains the desired cluster state specified by the object. While much
`Spec` contains the desired machine state specified by the object. While much
of the `Spec` is defined by users, unspecified parts may be filled in with
defaults or by Controllers such as autoscalers.

`Status` contains only observed cluster state and is only written by
`Status` contains only observed machine state and is only written by
controllers. `Status` is not the source of truth for any information, but
instead aggregates and publishes observed state.

Expand Down Expand Up @@ -93,7 +98,7 @@ methods.
`Delete()` will only be called when the `Machine` is in the process of being
deleted.

The definition of `Exist()` is determined by the provider.
The definition of `Exists()` is determined by the provider.

**TODO**: Provide more guidance on `Exists()`.

Expand All @@ -108,7 +113,7 @@ We need a diagram tracing the logic from resource creation through updates
and finally deletion.
{% endpanel %}

0. Determine the `Cluster` associated with the `Machine`.
0. Determine the `Cluster` associated with the `Machine` from its `cluster.k8s.io/clusterName` label.
- If the `Machine` hasn't been deleted and doesn't have a finalizer, add one.
- If the `Machine` is being deleted, and there is no finalizer, we're done
- Check if the `Machine` is allowed to be deleted. [^1]
Expand Down

0 comments on commit bf6bc41

Please sign in to comment.