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

Metrics agent ConfigMap should use cluster name override #1138

Closed
olim7t opened this issue Dec 15, 2023 · 1 comment · Fixed by #1246
Closed

Metrics agent ConfigMap should use cluster name override #1138

olim7t opened this issue Dec 15, 2023 · 1 comment · Fixed by #1246
Labels
bug Something isn't working done Issues in the state 'done'

Comments

@olim7t
Copy link
Contributor

olim7t commented Dec 15, 2023

When creating a cluster with a name override:

apiVersion: k8ssandra.io/v1alpha1
kind: K8ssandraCluster
metadata:
  namespace: test
  name: demo
spec:
  cassandra:
    serverVersion: 4.1.0
    clusterName: override # <<< name override here
    datacenters:
      - metadata:
          name: dc1
        size: 1
        racks:
          - name: rack1
        storageConfig:
          cassandraDataVolumeClaimSpec:
            storageClassName: standard
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 100Mi

The metrics agent ConfigMap is named demo-dc1-metrics-agent-config.
This is inconsistent with other Kubernetes resources (pods, etc) which are named after the override.

This line should use c.Kluster.SanitizedName(). Additionally, it should check that the concatenated name doesn't have more than 253 characters.

We should also audit other generated names to make sure that those rules are consistently applied.

@olim7t olim7t added the bug Something isn't working label Dec 15, 2023
@olim7t olim7t changed the title Metrics agent ConfigMap name is not properly sanitized Metrics agent ConfigMap should use cluster name override Dec 18, 2023
@olim7t
Copy link
Contributor Author

olim7t commented Dec 18, 2023

Note: this ticket used to cover invalid DC names too, but that is a more widespread issue so I moved it to a dedicated ticket: #1141.

olim7t added a commit to olim7t/k8ssandra-operator that referenced this issue Mar 18, 2024
- reject cluster creation if a DC has an invalid name
- always use sanitized DC name override when naming secondary resources
- use cluster name override for metrics agent configMap

Fixes k8ssandra#1138
Fixes k8ssandra#1141
@olim7t olim7t mentioned this issue Mar 18, 2024
5 tasks
olim7t added a commit that referenced this issue Mar 19, 2024
- reject cluster creation if a DC has an invalid name
- always use sanitized DC name override when naming secondary resources
- use cluster name override for metrics agent configMap

Fixes #1138
Fixes #1141
@adejanovski adejanovski added the done Issues in the state 'done' label Mar 19, 2024
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'
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants