RedisLabs / redis-enterprise-k8s-docs

151 stars 91 forks source link

[FEATURE] Add annotations to services #185

Closed AlexH0661 closed 2 years ago

AlexH0661 commented 2 years ago

Hello, Currently I am unable to apply annotations to the rec-ui service. My OCP cluster is running on bare metal, and in order to use external IPs, I am using the keepalived operator.

Services must be annotated to opt-in to being observed by the keepalived operator and to specify which KeepalivedGroup they refer to. The annotation looks like this: keepalived-operator.redhat-cop.io/keepalivedgroup: <keepalivedgroup namespace>/<keepalivedgroup-name>

I try to apply this annotation to the rec-ui service, but it gets overwritten by the Redis Enterprise Operator.

For reference keepalived-operator redhat-cop/keepalived-operator

laurentdroin commented 2 years ago

Hi Alex,

The Redis Enterprise services are completely managed by the Redis Enterprise operator and cannot be edited directly, but you can direct the Redis Enterprise Operator to inject annotations to the UI service it manages by using the uiAnnotations property in the REC's manifest. See https://github.com/RedisLabs/redis-enterprise-k8s-docs/blob/master/redis_enterprise_cluster_api.md#redisenterpriseclusterspec

Hope this helps.

Laurent.

AlexH0661 commented 2 years ago

Sorry Laurent, I thought I had responded to this already. Thank you for that great information. I will give your recommendations a test, and see how I go.

Cheers, Alex

AlexH0661 commented 2 years ago

Applying the uiAnnotations worked perfectly :) Thank you! Is it also possible to do this for the database instances? I tried the following, but it doesn't look like it applied my annotation to the database-load-balancer instance

  servicesRiggerSpec:
    databaseServiceType: 'load_balancer,headless'
    serviceNaming: bdb_name
  podAnnotations:
    keepalived-operator.redhat-cop.io/keepalivedgroup: keepalived-operator/keepalivedgroup-workers
laurentdroin commented 2 years ago

Hi Alex,

Unfortunately, adding annotations to database services is not possible today, but I understand the need and I have logged a feature request about this a few months ago. I am hoping that this will be supported in a future version later this year (but I don't have an ETA for it).

Laurent.

AlexH0661 commented 2 years ago

HI Laurent,

No worries. I'll make keep a look out in future releases :)

Kind regards, Alex