Skip to content

Headless service additional annotations is missed on Operator code #1572

@ami-descope

Description

@ami-descope

We have a cert manager service that creates certs based on service annotations, but it can only generate one secret for the cert ( can add additonal hostnames to it if we want)

the issue is that currently the code is taking the same annotation for all services resulting in conflicts on secret name.

What version of redis operator are you using?

kubectl logs <_redis-operator_pod_name> -n <namespace>

redis-operator version: 0.17.2

Does this issue reproduce with the latest release?
yes

What operating system and processor architecture are you using (kubectl version)?
cluster is at: 1.32.2
linux amd64

kubectl version Output
$ kubectl version
Client Version: v1.32.2
Kustomize Version: v5.5.0
Server Version: v1.32.801

What did you do?
added service additional annotation for redisReplication, which are rendered correctly to the CRD but not being added to the redis-node-headless service

apiVersion: redis.redis.opstreelabs.in/v1beta2
kind: RedisReplication
metadata:
  name: {{ .Values.redisReplication.name }}
  namespace: {{ .Release.Namespace }}
spec:
  clusterSize: {{ .Values.redisReplication.clusterSize }}
  kubernetesConfig:
    service:
      headless:
        additionalAnnotations:
          test: "123"

CRD rendered

apiVersion: v1
items:
- apiVersion: redis.redis.opstreelabs.in/v1beta2
  kind: RedisReplication
  metadata:
    annotations:
      meta.helm.sh/release-namespace: databases
    finalizers:
    - redisReplicationFinalizer
    labels:
      app.kubernetes.io/managed-by: Helm
    name: redis-node
    namespace: databases
  spec:
    ...
    kubernetesConfig:
      service:
        headless:
          additionalAnnotations:
          test: '123'
          enabled: true
          type: ClusterIP

Service rendered

apiVersion: v1
kind: Service
metadata:
  annotations:
    meta.helm.sh/release-name: redis
    meta.helm.sh/release-namespace: databases
    prometheus.io/port: "9121"
    prometheus.io/scrape: "true"
    redis.opstreelabs.in: "true"
    redis.opstreelabs.instance: redis-node
  labels:
    app: redis-node
    app.kubernetes.io/managed-by: Helm
    redis_setup_type: replication
    role: replication
...

What did you expect to see?
The annotation from the CRD rendered to the service

What did you see instead?

no additional annotations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions