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

Annotations strategy #24

Closed
linki opened this issue Feb 20, 2017 · 8 comments
Closed

Annotations strategy #24

linki opened this issue Feb 20, 2017 · 8 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Milestone

Comments

@linki
Copy link
Member

linki commented Feb 20, 2017

We'll support several annotations from the beginning, some of them are supposed to be deprecated soon, others will be added over time as new requirements come up.

@justinsb throw in an idea where we store JSON as the value of an annotation which can then be used to encode more complicated data in order to support more advanced but less common use cases.

We could design our annotations around a single annotation holding JSON. This would be the source of truth for our controller. Keys can be added over time to support new features (CNAME, TTL, provider specific stuff). Though, normally one would use the simpler annotations using plain text values (e.g. external-dns/hostname: foo) but internally external-dns would convert the simpler annotations to the source-of-truth-struct before processing.

This way, most users could just use the simple annotations that are exposed but more adavanced users could directly set the JSON based annotation to have access to everything that external-dns provides.

This can also help with solving backwards-incopatible changes and with rolling out new versions. New features could be made available solely via some keys in the JSON before being promoted to top-level annotations if they prove to be useful.

@justinsb @ideahitme @iterion Any thoughs?

@ideahitme
Copy link

ideahitme commented Feb 20, 2017

I like the idea and totally makes sense to me. Plus making it easier to manage the logic :)

Additionally, we might think of storing the serialized json in the resource itself, similarly to what kubernetes does with kubernetes.io/created-by:

"kubernetes.io/created-by": "{\"kind\":\"SerializedReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"ReplicaSet\",\"namespace\":\"kube-system\",\"name\":\"mate-617493630\",\"uid\":\"...\",\"apiVersion\":\"extensions\",\"resourceVersion\":\"72660398\"}}\n",

If we store the last updated version of the referring to the resourceVersion, this could greatly simplify the procedure. For example:

"external-dns.kubernetes.io/config": "{\"hostname\":\"foo.com\", \"resourceVersion\":\"123\"}"
"kubernetes.io/created-by": "{..., \"resourceVersion\":\"124\"}" 

Since 124 != 123 - trigger update

@iterion
Copy link
Contributor

iterion commented Feb 20, 2017

This would also be a good idea for when we implement TPRs (#21). We would already have the format we require set up and implementation should be really easy.

@linki
Copy link
Member Author

linki commented Feb 27, 2017

I was wondering if we should rather use alpha annotations while external-dns is still unstable?

Looking at other projects I think it makes to target alpha.external-dns.kubernetes.io for now so that we allow us to change them at any time if we discover they aren't suitable. I know that we discussed the desired annotations for quite some time but you never know if they really works out.

@linki
Copy link
Member Author

linki commented Feb 28, 2017

I moved the discussion about using alpha annotations to #42

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 21, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 21, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants