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

Support for resource level annotations #553

Closed
kameshsampath opened this issue Jun 22, 2020 · 5 comments · Fixed by #644
Closed

Support for resource level annotations #553

kameshsampath opened this issue Jun 22, 2020 · 5 comments · Fixed by #644
Assignees

Comments

@kameshsampath
Copy link

It will be good to have resource level annotations configurable via properties. E.g. let us say we have a dekorate.kubernetes.expose=true, then doing something like

dekorate.kubernetes.expose.annnotations[0].key=foo
dekorate.kubernetes.expose.annnotations[0].value=bar

Should add the annotations to expose related resources such as ingress

@iocanel
Copy link
Member

iocanel commented Jun 22, 2020

I would prefer if we used ingress instead of expose unless these annotations are also applicable to Route too.

Also, do you think that we should expose the annotation itself or a property describes the intent, e.g. dekorate.kubernetes.ingress.rewrite-target?

@kameshsampath
Copy link
Author

@iocanel , I initially thought about using specific k8s resource kind, then wondering if we are complicating :( .. so thought to make it general as annotations.

@kameshsampath
Copy link
Author

Also, do you think that we should expose the annotation itself or a property describes the intent, e.g. dekorate.kubernetes.ingress.rewrite-target?

That sounds like a good idea too

iocanel added a commit to iocanel/dekorate that referenced this issue Jul 10, 2020
iocanel added a commit to iocanel/dekorate that referenced this issue Jul 10, 2020
@iocanel iocanel self-assigned this Sep 23, 2020
@iocanel
Copy link
Member

iocanel commented Sep 23, 2020

I have been pondering for a solution around this and TBH, I haven't been able to find an elegant technical soluton.

The best thing that pops to my mind, is to modify @Label and @annotation in order to include a field say resourceKinds.

This way one could

@KubernetesApplication(name="myapp", labels=@Label(name="foo", value="bar", rerourceKinds=["Service", "Ingress"])

or in properties;

dekorate.kubernetes.labels[0].key=foo
dekorate.kubernetes.labels[0].value=bar
dekorate.kubernetes.labels[0].resource-kinds=Service,Ingress

I think that this is pretty close to what @kameshsampath needs and it should also be compatible with what have in downstream projects. @geoand wdyt?

@geoand
Copy link
Collaborator

geoand commented Sep 23, 2020

I like the idea!

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

Successfully merging a pull request may close this issue.

3 participants