k8ssandra / k8ssandra-operator

The Kubernetes operator for K8ssandra
https://k8ssandra.io/
Apache License 2.0
174 stars 79 forks source link

Custom registry configuration affect default used tags #1396

Open julienbaladier opened 2 months ago

julienbaladier commented 2 months ago

What happened?

I am trying to use a private registry to pull images by following these instructions.

When setting only the spec.reaper.containerImage.registry and spec.medusa.containerImage.registry properties, it seems to affect the tags that are used as well. Instead of using the default fixed versions, it is using the latest tags for the repear and medusa images.

~$ kubectl get pods -n julien thehive-dc-r2-sts-0  -o json | jq -r '.spec.initContainers[].image'
cr.k8ssandra.io/k8ssandra/cass-management-api:4.1.5-ubi8
cr.k8ssandra.io/k8ssandra/k8ssandra-client:v0.5.0
docker.io/k8ssandra/medusa:0.22.0

~$ kubectl get pods -n julien thehive-dc-r2-sts-0  -o json | jq -r '.spec.containers[].image'
cr.k8ssandra.io/k8ssandra/cass-management-api:4.1.5-ubi8
docker.io/k8ssandra/medusa:0.22.0
cr.k8ssandra.io/k8ssandra/system-logger:v1.22.0

~$ kubectl get pods -n julien thehive-dc-reaper-58d5d9b994-thxnj  -o json | jq -r '.spec.containers[].image'
docker.io/thelastpickle/cassandra-reaper:3.6.1
~$ kubectl get pods -n julien thehive-dc-reaper-58d5d9b994-thxnj  -o json | jq -r '.spec.initContainers[].image'
docker.io/thelastpickle/cassandra-reaper:3.6.1

Did you expect to see something different?

I would have expected the tags not to be affected since I am only providing the information I case about. With the current behaviour I need to provide the tags and I need to update them each time the version changes.

How to reproduce it (as minimally and precisely as possible):

  1. Create the K8ssandraCluster without setting spec.reaper.containerImage.registry and spec.medusa.containerImage.registry.
  2. Check the images versions used for each container.
  3. Delete the K8ssandraCluster.
  4. Set the spec.reaper.containerImage.registry and spec.medusa.containerImage.registry perperties with the default registry: docker.io.
  5. Check the images versions used, they are different.

Environment

```yaml

apiVersion: k8ssandra.io/v1alpha1 kind: K8ssandraCluster metadata: name: test spec: auth: true cassandra: serverVersion: "4.1.5" serverImage: /k8ssandra/cass-management-api:4.1.5-ubi8 serviceAccount: cassandra superuserSecretRef: name: test-superuser telemetry: mcac: enabled: false prometheus: enabled: true datacenters:

maxBackupCount: 30

apiVersion: v1 kind: ServiceAccount metadata: name: cassandra annotations: eks.amazonaws.com/role-arn: "arn:aws:iam::XXXXXXXXXXXX:role/iam-role-sa-test-cassandra" imagePullSecrets:

┆Issue is synchronized with this Jira Story by Unito ┆Issue Number: K8OP-1