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

core: create rook resources with k8s recommended labels #8678

Merged
merged 1 commit into from Dec 7, 2021

Conversation

parth-gr
Copy link
Member

@parth-gr parth-gr commented Sep 9, 2021

Adding Recommended Labels on the resources created by rook
and using Recommended Labels in the helm chart,
for better visuals and management of k8s object

Signed-off-by: parth-gr paarora@redhat.com

Description of your changes:

Which issue is resolved by this Pull Request:
Resolves #8400

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Skip Tests for Docs: Add the flag for skipping the build if this is only a documentation change. See here for the flag.
  • Skip Unrelated Tests: Add a flag to run tests for a specific storage provider. See test options.
  • Reviewed the developer guide on Submitting a Pull Request
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.
  • Pending release notes updated with breaking and/or notable changes, if necessary.
  • Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
  • Code generation (make codegen) has been run to update object specifications, if necessary.

@parth-gr parth-gr marked this pull request as draft September 9, 2021 15:11
@parth-gr parth-gr force-pushed the Recommended-labels branch 2 times, most recently from 2aa72fb to e9705f8 Compare September 9, 2021 15:22
@BlaineEXE
Copy link
Member

I don't see these changes reflected in crds.yaml or common.yaml. It seems that they should be there also.

@parth-gr parth-gr force-pushed the Recommended-labels branch 12 times, most recently from aa81ffc to ff12b42 Compare September 14, 2021 14:46
@parth-gr parth-gr marked this pull request as ready for review September 14, 2021 14:47
@travisn
Copy link
Member

travisn commented Sep 14, 2021

From discussion, we will need to add these as new labels rather than replacing existing labels.

Something else to be aware of is that in the various helpers for adding labels:

  • If there is a helper with the includeNewLabels flag, only add these labels if true
  • The rook and ceph versions are already added as labels on the ceph daemon deployments, but not the pods. We don't want the version labels on the pods since it may cause an unnecessary pod restart during upgrade if nothing else changed in the pod spec.

@parth-gr parth-gr force-pushed the Recommended-labels branch 2 times, most recently from 55bb69f to ab4a694 Compare September 21, 2021 14:09
@BlaineEXE
Copy link
Member

BlaineEXE commented Nov 30, 2021

@BlaineEXE ,

"app.kubernetes.io/instance": "a",

I am applying cfg.ID the daemon ID, should I apply resourceName-DaemonID ?

"app.kubernetes.io/instance": "my-store",

my-store is the objectStoreName which I have specified, cephObjectStore.Name, should Any other detail need to specify?

cephObjectStore.Name should be for app.kubernetes.io/part-of, which it is currently. The instance should be a unique name in the namespace (with the caveat that it might also be distinguished by app.kubernetes.io/component). I think it's best to make sure that instance is <name>-<id>, based on examples in the docs.

@parth-gr parth-gr force-pushed the Recommended-labels branch 6 times, most recently from 1343f5b to 5e520f8 Compare December 2, 2021 13:09
@parth-gr parth-gr changed the title build: create resources with k8s recommended labels core: create rook resources with k8s recommended labels Dec 2, 2021
@parth-gr parth-gr force-pushed the Recommended-labels branch 3 times, most recently from 233637d to 42ae916 Compare December 2, 2021 15:17
Copy link
Member

@travisn travisn left a comment

Choose a reason for hiding this comment

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

After the CI is fixed I'd propose we go ahead and merge. I've marked this as a blocker for 1.8 so we can start have these labels in the new release. Thanks!

@@ -1,4 +1,211 @@
---
kind: ClusterRoleBinding
Copy link
Member

Choose a reason for hiding this comment

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

looks like a bunch of extra rbac was mistakenly generated

@mergify
Copy link

mergify bot commented Dec 3, 2021

This pull request has merge conflicts that must be resolved before it can be merged. @parth-gr please rebase it. https://rook.io/docs/rook/latest/development-flow.html#updating-your-fork

@parth-gr parth-gr force-pushed the Recommended-labels branch 5 times, most recently from 571f59e to d3151c7 Compare December 7, 2021 08:42
    Adding Recommended Labels on the resources created by rook
    and using Recommended Labels in the helm chart,
    for better visuals and management of k8s object

Closes: rook#8400
Signed-off-by: parth-gr <paarora@redhat.com>
@travisn
Copy link
Member

travisn commented Dec 7, 2021

The labels look good to me on the majority of pods, so I would recommend we go ahead with this. We can follow up with a separate PR to add the labels on the other resources such as jobs, secrets, and configmaps.

@BlaineEXE
Copy link
Member

The labels look good to me on the majority of pods, so I would recommend we go ahead with this. We can follow up with a separate PR to add the labels on the other resources such as jobs, secrets, and configmaps.

sounds good

@travisn travisn merged commit c953032 into rook:master Dec 7, 2021
mergify bot added a commit that referenced this pull request Dec 7, 2021
core: create rook resources with k8s recommended labels  (backport #8678)
parth-gr pushed a commit to parth-gr/rook that referenced this pull request Feb 22, 2022
The cluster info is important context for the cluster controller to
create the cluster, and all the fields must be properly set.
A test cluster name was being set temporarily, resulting in
mons incorrectly getting the wrong cluster CR name. There is no
known issue from the temporary value, it was just exposed by
rook#8678 setting the value to a label.

Now the functions are more clearly named so only unit and
integration tests should be using the test value for the cluster
name where it is not important.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
parth-gr pushed a commit to parth-gr/rook that referenced this pull request Feb 22, 2022
The cluster info is important context for the cluster controller to
create the cluster, and all the fields must be properly set.
A test cluster name was being set temporarily, resulting in
mons incorrectly getting the wrong cluster CR name. There is no
known issue from the temporary value, it was just exposed by
rook#8678 setting the value to a label.

Now the functions are more clearly named so only unit and
integration tests should be using the test value for the cluster
name where it is not important.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rook resources should be created with the kubernetes recommended labels
3 participants