Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📖 Update docs for metadata propagation #6935

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Metadata propagation
Cluster API controllers implement consistent metadata (labels & annotations) propagation across the core API resources.
This behaviour tries to be consistent with kubernetes apps/v1 Deployment and ReplicaSet.
This behaviour tries to be consistent with Kubernetes apps/v1 Deployment and ReplicaSet.
New providers should behave accordingly fitting within the following pattern:

## KubeadmControlPlane
killianmuldoon marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -30,4 +30,4 @@ Top-level labels and annotations do not propagate at all.

Template labels and annotations propagate to Machines, InfraMachines and BootstrapConfigs.
- `.spec.template.metadata.labels` => `Machine.labels`, `InfraMachine.labels`, `BootstrapConfig.labels`
- `.spec.template.metadata.annotations` => `Machine.annotations`, `InfraMachine.annotations`, `BootstrapConfig.labels`
- `.spec.template.metadata.annotations` => `Machine.annotations`, `InfraMachine.annotations`, `BootstrapConfig.annotations`
4 changes: 0 additions & 4 deletions docs/book/src/developer/providers/bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ type PhippyBootstrapConfigTemplate struct {
}

type PhippyBootstrapConfigTemplateResource struct {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"`
killianmuldoon marked this conversation as resolved.
Show resolved Hide resolved
Spec PhippyBootstrapConfigSpec `json:"spec"`
}
```
Expand Down
4 changes: 3 additions & 1 deletion docs/book/src/developer/providers/v0.4-to-v1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ The `serving-cert` certificates now have organization set to `k8s-sig-cluster-li
[machine][machine-contract] provider contract docs for more information. This is not required, but is recommended for
consistency across the infrastructure providers as Cluster API graduates and opens up use cases where coordinating
controllers can use labels and annotations from template infrastructure resources to do external provisioning or
provide configuration information, e.g. [IPAM support for vSphere / bare-metal][capv-ipam].
provide configuration information, e.g. [IPAM support for vSphere / bare-metal][capv-ipam].
- Labels and annotations from KubeadmControlPlane, MachineDeployment and MachineSet and their `.spec.template.metadata` fields are now selectively propagated to objects controlled by their respective controllers. Refer to [metadata-propagation] for more information.
killianmuldoon marked this conversation as resolved.
Show resolved Hide resolved

## ⚠ LeaderElectionResourceLock change ⚠

Expand All @@ -70,4 +71,5 @@ Otherwise, your controller might end up with multiple running instances that eac

[cluster-contract]: ./cluster-infrastructure.md
[machine-contract]: ./machine-infrastructure.md
[metadata-propagation]: ../../developer/architecture/controllers/metadata-propagation.md
[capv-ipam]: https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/pull/1210