Rely on Kubernetes resource refs in destinations#1
Conversation
mneagul
left a comment
There was a problem hiding this comment.
The current implementation complicates the whole interaction with KNative.
What is important: K_NATIVE is an URL which can receive a POST event of a CloudEvent.
The K_CE_OVERRIDES specified an JSON encoded environment variables representing key/values that should be overwritten by the code. The Python code should ignore this as much as possible and apply it before triggering the POST corresponding to the generated event.
| from ..core.plugin import BaseOutput, BasePluginConfig, PluginMetadata | ||
|
|
||
|
|
||
| class RefConfig(BaseModel): |
There was a problem hiding this comment.
What I'm expecting:
- The code in eoAPI only expects to have
K_SINKdefined in an environment variable - The
refvsurllogic should be outside the code, and should only reside in the helm chart - The Helm chart, based on the configuration, should set
K_SINKonly isurlis set, otherwise it should create aSinkBindingwhich should match the deployment/stefullset and inject the environment variable. This last part is the responsibility of KNative and no logic, besides the expectation on the presence okK_SINK, should reside in the application code.
There was a problem hiding this comment.
The Python side of code should only care of K_SINK. If it's set then it has to POST to that endpoint.
A special attention should be given to the env K_CE_OVERRIDES. This is a JSON object that specifies overrides to the outbound event.
See this:
|
Thanks for your reviews and support @mneagul! Closing this PR here in favour of these follow-ups: |
No description provided.