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

Pods not found when using a mixed-case datacenterName #1252

Closed
1 task done
olim7t opened this issue Mar 20, 2024 · 4 comments · Fixed by #1257
Closed
1 task done

Pods not found when using a mixed-case datacenterName #1252

olim7t opened this issue Mar 20, 2024 · 4 comments · Fixed by #1257
Assignees
Labels
bug Something isn't working done Issues in the state 'done' naming

Comments

@olim7t
Copy link
Contributor

olim7t commented Mar 20, 2024

Given this spec:

apiVersion: k8ssandra.io/v1alpha1
kind: K8ssandraCluster
metadata:
  namespace: test
  name: k8s-cluster
spec:
  cassandra:
    serverVersion: 4.1.0
    clusterName: Cql_Cluster
    datacenters:
      - metadata:
          name: k8s-dc1
        datacenterName: Cql_DataCenter1
        size: 1
        racks:
          - name: Cql_Rack1
        storageConfig:
          cassandraDataVolumeClaimSpec:
            storageClassName: standard
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 100Mi

The cluster errors out with:

no pods in READY state found in datacenter k8s-dc1

This is because cass-operator sanitizes the Cassandra pod's DC label with CleanupForKubernetes (no caps, no underscores):

cassandra.datastax.com/datacenter: cql-datacenter1

But k8ssandra-operator uses the unsanitized version to build its selector:

cassandra.datastax.com/datacenter: Cql_DataCenter1

We need to use the same sanitization function in k8ssandra-operator.

We should also consider switching to CleanLabelValue() in both operators, because this is what cass-operator uses for the cluster and rack labels. Right now we have inconsistent formats:

cassandra.datastax.com/cluster: Cql_Cluster
cassandra.datastax.com/datacenter: cql-datacenter1
cassandra.datastax.com/rack: Cql_Rack1

Blocked by

  1. bug done naming
    olim7t
@olim7t olim7t added the bug Something isn't working label Mar 20, 2024
@adejanovski adejanovski added the assess Issues in the state 'assess' label Mar 20, 2024
@adejanovski
Copy link
Contributor

I think I poo-pooed here when using the sanitized name for the labels :(
Let's move to CleanLabelValue() overall, even if I hate having multiple ways of naming things...

@olim7t olim7t self-assigned this Mar 21, 2024
@adejanovski adejanovski added ready Issues in the state 'ready' and removed assess Issues in the state 'assess' labels Mar 21, 2024
@olim7t olim7t added the naming label Mar 21, 2024
@olim7t
Copy link
Contributor Author

olim7t commented Mar 21, 2024

I filed k8ssandra/cass-operator#622.
I'll keep this open until I can re-test with the cass-operator fix.

@adejanovski adejanovski added blocked Issues in the state 'blocked' and removed ready Issues in the state 'ready' labels Mar 25, 2024
olim7t added a commit to olim7t/k8ssandra-operator that referenced this issue Mar 25, 2024
@olim7t
Copy link
Contributor Author

olim7t commented Mar 25, 2024

I'll keep this open until I can re-test with the cass-operator fix

Actually we still need to sanitize the name in k8ssandra-operator, so this gets its own PR.

@adejanovski adejanovski added in-progress Issues in the state 'in-progress' ready-for-review Issues in the state 'ready-for-review' and removed blocked Issues in the state 'blocked' in-progress Issues in the state 'in-progress' labels Mar 25, 2024
@adejanovski adejanovski added review Issues in the state 'review' and removed ready-for-review Issues in the state 'ready-for-review' labels Mar 26, 2024
olim7t added a commit to olim7t/k8ssandra-operator that referenced this issue Mar 28, 2024
@olim7t olim7t closed this as completed in 8ba5703 Mar 29, 2024
@adejanovski adejanovski added done Issues in the state 'done' and removed review Issues in the state 'review' labels Mar 29, 2024
@mk01
Copy link

mk01 commented Apr 2, 2024

I'll keep this open until I can re-test with the cass-operator fix

Actually we still need to sanitize the name in k8ssandra-operator, so this gets its own PR.

isn't in this particular case (the line of the code) simply taking wrong field ? instead of "datacenterName()" it should take "Name" (which complies with k8s rules) and cass-operator uses for the label ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working done Issues in the state 'done' naming
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants