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

PodDisruptionBudget are not named according to overrides #720

Closed
adejanovski opened this issue Oct 24, 2024 · 2 comments · Fixed by #734
Closed

PodDisruptionBudget are not named according to overrides #720

adejanovski opened this issue Oct 24, 2024 · 2 comments · Fixed by #734
Assignees
Labels
bug Something isn't working

Comments

@adejanovski
Copy link
Contributor

adejanovski commented Oct 24, 2024

What happened?

When using datacenterName overrides, the dc name label is set to the overridden one, and the pdb object is created with this name as well.
If two cassdc are created with a dc1 overridden name in the same namespace, they will end up competing for the ownership of the same dc1-pdb PodDisruptionBudget object, and reconcile in a loop.

What did you expect to happen?

The pdb objects should be created with the cassdc meta.name as prefix for their name, which will then avoid creating conflicts as two cassdc objects cannot have the same name in the same namespace.

How can we reproduce it (as minimally and precisely as possible)?

Create a first cassdc using dc1 as datacenterName:

apiVersion: cassandra.datastax.com/v1beta1
kind: CassandraDatacenter
metadata:
  name: cluster1-dc1
  namespace: test
spec:
  clusterName: cluster1
  datacenterName: dc1
  ...

and another one with the same datacenterName value:

apiVersion: cassandra.datastax.com/v1beta1
kind: CassandraDatacenter
metadata:
  name: cluster2-dc1
  namespace: test
spec:
  clusterName: cluster2
  datacenterName: dc1
  ...

They'll both end up creating a dc1-pdb object.

cass-operator version

v1.22.4

Kubernetes version

v1.30

Method of installation

Helm

Anything else we need to know?

No response

┆Issue is synchronized with this Jira Story by Unito
┆Fix Versions: 2024-11
┆Issue Number: CASS-75

@adejanovski adejanovski added the bug Something isn't working label Oct 24, 2024
@burmanm
Copy link
Contributor

burmanm commented Oct 24, 2024

Actually, what it is missing is the clusterName prefix which is present in every other object. Otherwise the naming uses the same methods as other resources.

@burmanm
Copy link
Contributor

burmanm commented Oct 24, 2024

Now, while fixing when creating a new one is easy, this will require us to also delete the old one. Will have to use the new field metadataVersion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants