-
Notifications
You must be signed in to change notification settings - Fork 599
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 KeyRef support for plugin configuration #2763
Comments
@scseanchow this was previously raised internally as FTI-2476. Copying my initial response from chat:
|
All paths seem less than Ideal, but the current iteration is rather difficult to work with and also less than ideal. If we have to deal with some pain to get to a better state, We're willing to do that. If there isn't a full stop opposition to the idea in general, Can we settle on which path to take? |
Since currently the secret effectively has to contain the entire config, Wouldn't it be enough to just translate something that has a configFrom to be a list of secret key refs that map to the keys in the secret? configFrom:
name: <secret-key>
valueFrom:
secretKeyref:
- name: <secret-name>
key: <secret-key> As far as supporting forward and backward compatibility for a single version - that doesn't seem too bad. |
Unsure, we hadn't looked into the specifics of conversion handling--this hadn't been scheduled yet, so we hadn't tried to write any POC code yet. I do think it'll hit a problem in one direction: if you have the new env-like format and reference multiple Secrets, there's no way to convert that back to a single Secret. |
I see, thats fair. But is that an acceptable concession if its documented and communicated that is the case? |
It's unknown. The current state of this is that we know we'd like to do it, but that it's not trivial, and we're waiting for the product owners to prioritize it so that we allocate time to develop a POC and review options in depth. |
Its something we'd like to see sooner rather that later. Is there any opposition outside contribution on this? |
For something like this we would ask for a KEP to help build the consensus around the initiative as well as documenting implementation intent. You can find examples in the Also please keep in mind that while we will try to accommodate, there is a real chance we may have to eventually consider the KEP If you have any questions about the KEP process please don't hesitate to ask in a discussion on this repository. |
Initial draft proposing a new configuration model for plugins to make them an active participant in a running kubernetes cluster rather than entirely static see: Kong#2763
Initial draft proposing a new configuration model for plugins to make them an active participant in a running kubernetes cluster rather than entirely static see: Kong#2763
Initial draft proposing a new configuration model for plugins to make them an active participant in a running kubernetes cluster rather than entirely static see: Kong#2763
Initial draft proposing a new configuration model for plugins to make them an active participant in a running kubernetes cluster rather than entirely static see: Kong#2763
Initial draft proposing a new configuration model for plugins to make them an active participant in a running kubernetes cluster rather than entirely static see: Kong#2763
Initial draft proposing a new configuration model for plugins to make them an active participant in a running kubernetes cluster rather than entirely static see: Kong#2763
Initial draft proposing a new configuration model for plugins to make them an active participant in a running kubernetes cluster rather than entirely static see: Kong#2763
Initial draft proposing a new configuration model for plugins to make them an active participant in a running kubernetes cluster rather than entirely static see: #2763
Thanks @esatterwhite for creating a KEP for this, which is now merged in a At this time I've discussed this effort and the KEP with other maintainers and we're currently leaning towards accepting this proposal and getting it on our roadmap. Nothing confirmed yet, but we'll use this issue to communicate on acceptance and milestones so that we can provide some insights as to if and when this would be available. If you have any questions or concerns in the meantime, please feel free to reach out in the comments here. |
Is this something Kong is looking to implement internally or is outside contribution welcome? |
We're open to outside contributions to the KEP to move it towards implementable state, after which we would consider it ready for implementation, but for the actual implementation we're not yet certain as there's significant complexity and there's timing considerations to figure out. In the KEP so far we have the "what" and "why" pretty well established. What is your appetite for adding the "how" (technical implementation details, graduation criteria, e.t.c.)? (we the maintainers would intend to further fill out the KEP otherwise though, so things will still progress even if you want to be hands off from here) |
Happy to help push this forward anyway possible. |
What are the timing considerations? |
At this point filling out the implementation details and then making sure we have consensus between the maintainers and the community (just you so far) about those implementation details.
Originally I was thinking about this being a
This actually adds context to the "areas of concern" question above: we (the maintainers) have been considering this one something to do for our cc @Kong/team-k8s |
As for the implementation details, you're looking for a high level how / design, yes? not how it would theoretically implemented in code? I'm curious as to what the common pattern for handling version translations like we are talking about is? What is the timeline to v3? 6mo? 12mo? 18mo? |
Ideally we would start with the high, and even yes some low level details. Maybe some code for examples.
The relevant documentation is https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/. It's usually desired to not have to implement a conversion webhook (just because these can become a bit high maintenance, and esoteric).
We don't have a timeline for it at the moment, and I'm not in a position to provide a good guess, all I can say is I feel a great deal of confidence next year would be the earliest. If your need in terms of timing is much greater than that, then we should probably be digging into the path of feasibility of adding this in the |
Is there an existing issue for this?
Problem Statement
Currently the only way to configure plugins using the
KongPlugin
orKongClusterPlugin
resources is static.While it is possible to reference a
Secret
to pull configuration from, the entire configuration for the plugin must be defined in the secret. This makes it difficult to pull data from multiple sources and generates a lot of duplication of value.It would be highly beneficial to support reading individual values from
ConfigMap
and/orSecret
resourcesProposed Solution
Similar to the way values are pulled in as environment variables in a
Pod
env spec,value
- is a means to specify a literal value which would support similar functionality to the wayconfig
does nowvalueFrom
- is a way to read dynamic values from the clusterthe
namespace
can be optional and default to the namespace the plugins are defined in. specifying a value would read configmaps from the specified namespaceas a migration path, the literal configuration of existing plugins could be translated to literal values in the new format
becomes
So it would makes sense that the schema allows for only one of
config
orconfigFrom
. Both may not make sense.I'm aware that
configFrom
is used to read the single secret value, so it can be a different name if that is more suitableAdditional information
Currently plugin configuration is updated when the configuration changes. The introduction of this change would inherently change that as the plugin resource itself would not be changing, but the values on the cluster could.
It may be necessary to re-eval plugins periodically or use additional event watchers based on the configuration to maintain the hot reload behavior that the controller exhibits today.
Points of complexity
Network errors when communicating with the API server may cause edge cases and It may be necessary to allow end users to specify how that is handled. - is it a full stop error? or should processing continue and/or use default values?
The list style of
name/value
makes it difficult to support complex nested objects. support for both forms w/ a clearly defined hierarchy maybe needed to facilitate both. Although it is still valid to assign an object/ array to thevalue
propertyAcceptance Criteria
The text was updated successfully, but these errors were encountered: