Skip to content

Conversation

@kylepl
Copy link

@kylepl kylepl commented Dec 17, 2025

I recently discovered that if you do not set a labelSelector, it seems not to match anything - so the spread constraint is not useful: kubernetes/kubernetes#135797 (comment).

I happened to notice this applies to cockroachDB too.

…s not match anything - so the spread constraint is not useful: kubernetes/kubernetes#135797 (comment).

i
I happened to notice this applies to cockroachDB too.
@NishanthNalluri
Copy link
Contributor

@kylepl Nice catch! Thanks for pointing out this. Instead of app label, could you modify it to crdb.cockroachlabs.com/cluster. The CrdbCluster CR will also have this label with value being the cluster name.

@kylepl
Copy link
Author

kylepl commented Jan 1, 2026

Sure, done!

whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
crdb.cockroachlabs.com/cluster: cockroachdb
Copy link
Contributor

Choose a reason for hiding this comment

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

The label value will not always be cockroachdb. The value needs to be "{{ template \"cockroachdb.fullname\" . }}", similar to the CR name.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for catching that.

To confirm, do you want the value of the row to be exactly:
crdb.cockroachlabs.com/cluster: cockroachdb: "{{ template \"cockroachdb.fullname\" . }}"

Not the quotations. I ask since I'm not sure how template evaluation works for things in values.yaml (rather than things in templates/) - and I don't see any examples of it in the same values.yaml file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah that should work, you can test it out once by rendering templates.

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.

2 participants