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

Feature Request: Allow and replace macros in annotations #795

Closed
joewreschnig opened this issue Oct 15, 2021 · 4 comments
Closed

Feature Request: Allow and replace macros in annotations #795

joewreschnig opened this issue Oct 15, 2021 · 4 comments

Comments

@joewreschnig
Copy link

In some cases my services need to connect to specific shards to modify/retrieve data. I usually control externally-visible names via the external-dns.alpha.kubernetes.io/hostname annotation; I'd like to be able to do the same here using the shard and replica template macros within the annotation to expose e.g. each replica under a unique name:

      - name: replica
        generateName: db-{clusterID}-{shard}-{replica}
        metadata:
          annotations:
            external-dns.alpha.kubernetes.io/hostname: clickhouse-{clusterID}-{shard}-{replica}.example.com
        spec:
          type: LoadBalancer
          ....

But this currently results in the annotation clickhouse-{clusterID}-{shard}-{replica}.example.com.

If this needs to be done under e.g. a new generateAnnotations option for backwards-compatibility, that's also fine with me, as long as I have some way to attach them.

@alex-zaitsev
Copy link
Member

@joewreschnig
Copy link
Author

Yes, the above is the relevant part of my service template. As far as I can see the template replacement applies only to the generateName and not any of the annotations or other fields.

@alex-zaitsev
Copy link
Member

That's right, make sense. In Altinity.Cloud we use annotations in order to configure external load balancer and moved templating logic on that level. But it makes sense to add it to an operator as well. Will take it as a feature request to 0.17.0

@joewreschnig joewreschnig changed the title Allow and replace macros in annotations Feature Request: Allow and replace macros in annotations Oct 15, 2021
@alex-zaitsev
Copy link
Member

Implemented in 0.17.0 version
cc @joewreschnig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants