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

📖 Metadata propagation docs #5426

Merged

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented Oct 14, 2021

What this PR does / why we need it:
Add metadata propagation docs

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #5397

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 14, 2021
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 14, 2021
@enxebre
Copy link
Member Author

enxebre commented Oct 14, 2021

cc @sbueringer

@CecileRobertMichon
Copy link
Contributor

/retitle 📖 Metadata propagation docs

@k8s-ci-robot k8s-ci-robot changed the title 🌱 Metadata propagation docs 📖 Metadata propagation docs Oct 14, 2021
@enxebre enxebre force-pushed the metadata-propagation-docs branch from 0cbac1d to dfc2b26 Compare October 19, 2021 11:25
@enxebre enxebre force-pushed the metadata-propagation-docs branch from dfc2b26 to 66ea9c2 Compare October 19, 2021 12:41
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 19, 2021
@enxebre enxebre force-pushed the metadata-propagation-docs branch from 66ea9c2 to 8cef9f1 Compare October 19, 2021 12:41
Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one nit, otherwise lgtm from my side. Thx for taking care of this!


## KubeadmControlPlane
Top-level labels and annotations do not propagate at all.
MachineTemplate labels and annotations propagate to Machines, InfraMachines and BootstrapConfig.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MachineTemplate labels and annotations propagate to Machines, InfraMachines and BootstrapConfig.
MachineTemplate labels and annotations propagate to Machines, InfraMachines and BootstrapConfigs.

nit (plural like the others in the list)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(similar below for MachineSets)

@enxebre enxebre force-pushed the metadata-propagation-docs branch from 8cef9f1 to 5da280d Compare October 19, 2021 13:01
@sbueringer
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 19, 2021
@killianmuldoon
Copy link
Contributor

/lgtm

Comment on lines 7 to 13
Top-level labels and annotations do not propagate at all.
MachineTemplate labels and annotations propagate to Machines, InfraMachines and BootstrapConfigs.

- .labels =>
- .annotations =>
- .spec.machineTemplate.metadata.labels => Machine.labels, InfraMachine.labels, BootstrapConfig.labels
- .spec.machineTemplate.metadata.annotations => Machine.annotations, InfraMachine.annotations, BootstrapConfig.annotations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be we should match explanation with the rule in => notation

Suggested change
Top-level labels and annotations do not propagate at all.
MachineTemplate labels and annotations propagate to Machines, InfraMachines and BootstrapConfigs.
- .labels =>
- .annotations =>
- .spec.machineTemplate.metadata.labels => Machine.labels, InfraMachine.labels, BootstrapConfig.labels
- .spec.machineTemplate.metadata.annotations => Machine.annotations, InfraMachine.annotations, BootstrapConfig.annotations
Top-level labels and annotations do not propagate at all.
- `KubeadmControlPlane.labels` => (not propagated)
- `KubeadmControlPlane.annotations` => (not propagated)
MachineTemplate labels and annotations propagate to Machines, InfraMachines and BootstrapConfigs.
- `KubeadmControlPlane.spec.machineTemplate.metadata.labels` => `Machine.labels`, `InfraMachine.labels`, `BootstrapConfig.labels`
- `KubeadmControlPlane.spec.machineTemplate.metadata.annotations` => `Machine.annotations`, `InfraMachine.annotations`, `BootstrapConfig.annotations`

@enxebre enxebre force-pushed the metadata-propagation-docs branch from 5da280d to 4dca31c Compare October 25, 2021 09:31
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 25, 2021
@enxebre
Copy link
Member Author

enxebre commented Oct 25, 2021

PTAL @fabriziopandini @sbueringer

@sbueringer
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 25, 2021
Comment on lines +1 to +4
# 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.
New providers should behave accordingly fitting within the following pattern:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok merging this as-is, have we considered in alternative to add these details to each respective page?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a recurring topic that crosses multiple CRDs I find it useful to have it all in one single place but I'm fine either way, happy to hear others thoughts.

@vincepri
Copy link
Member

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 25, 2021
Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini, vincepri

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [fabriziopandini,vincepri]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 1187c4e into kubernetes-sigs:main Oct 25, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.1 milestone Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing documentation: metadata propagation
7 participants