You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the introduction of ResourceSet input providers, Flux Operator can dynamically deploy/uninstall applications based on data provided by Git services e.g. open/close Pull Request or push/delete Git branch.
While this feature is akin to GitOps, it limits the decision-making to the operations performed by developers on the Git service (e.g. GitHub, GitLab) and to the data provided by these services (e.g. Pull Request ID, labels, branch name, commit SHA).
For complex scenarios when the decision-making is based on a mix of data from Git services and from other systems (e.g. testing, monitoring, ticketing), the Flux Operator could delegate the decision-making to a 3rd-party orchestrator that could provide the necessary data for the ResourceSet controller to perform the desired actions (e.g. deploy app version X to the canary production cluster when the release manager has signed off on it).
In the case of a 3rd-party orchestrator, the desired state is not fully defined in Git, instead it is dynamically generated from multiple sources:
Git Repository - where the ResourceSet and ResourceSetInputProvider manifests are defined.
Container Registry - where the application images, Helm charts and Flux artifacts are stored.
Orchestrator API - where the decision-making logic is implemented and from where the Flux Operator
fetches the input data for the ResourceSet templates.
While we could consolidate the desired state in the Container Registry by packaging the Flux manifests from Git and pushing them to the registry, the inputs for the ResourceSet templates would still need to be fetched from the orchestrator API at runtime.
To close the feedback loop, the orchestrator could expose an API endpoint where Flux will send the status of the deployments managed by a ResourceSet. This is already implemented in Flux, where events are sent to external services via notification-controller. The Flux events contain the information a 3rd-party orchestrator would need: the app version deployed, the target cluster, the deployment status, etc.
Proposal
To enable the Flux Operator to dynamically deploy applications based on data provided by 3rd-party orchestrators, the ResourceSetInputProvider should be extended with a new type ExternalService that would allow the operator to fetch arbitrary data from an external service via HTTP/S.
Example
Example of a ResourceSetInputProvider that fetches input values from an orchestrator API:
Given the above configuration, the orchestrator can instruct Flux Operator to perform the following actions:
Onboard a new tenant by adding a new input set to the response. The Flux Operator will deploy an instance of app1 for the new tenant and expose it outside the cluster using a dedicated hostname.
Offboard a tenant by removing the input set from the response. The Flux Operator will uninstall the app1 instance dedicated to the tenant.
Toggle features for a tenant by updating the input set in the response. The Flux Operator will update the HelmRelease values and trigger a Helm upgrade.
Change the app version for a tenant by updating the input set in the response. The Flux Operator will update the OCIRepository ref and trigger a Helm upgrade for the new Chart version.
The orchestrator can use the Flux events to track the status of the deployed instances by exposing an API endpoint that Flux notifications-controller can call.
Example of Flux Alert that sends events to the orchestrator API:
The Flux events can contain arbitrary data set in the ResourceSet using the event.toolkit.fluxcd.io/tenant annotations. The custom metadata can be used by the orchestrator to identify the deployment and update its internal state.
The text was updated successfully, but these errors were encountered:
With the introduction of ResourceSet input providers, Flux Operator can dynamically deploy/uninstall applications based on data provided by Git services e.g. open/close Pull Request or push/delete Git branch.
While this feature is akin to GitOps, it limits the decision-making to the operations performed by developers on the Git service (e.g. GitHub, GitLab) and to the data provided by these services (e.g. Pull Request ID, labels, branch name, commit SHA).
For complex scenarios when the decision-making is based on a mix of data from Git services and from other systems (e.g. testing, monitoring, ticketing), the Flux Operator could delegate the decision-making to a 3rd-party orchestrator that could provide the necessary data for the
ResourceSet
controller to perform the desired actions (e.g. deploy app version X to the canary production cluster when the release manager has signed off on it).In the case of a 3rd-party orchestrator, the desired state is not fully defined in Git, instead it is dynamically generated from multiple sources:
ResourceSet
andResourceSetInputProvider
manifests are defined.fetches the input data for the
ResourceSet
templates.While we could consolidate the desired state in the Container Registry by packaging the Flux manifests from Git and pushing them to the registry, the inputs for the
ResourceSet
templates would still need to be fetched from the orchestrator API at runtime.To close the feedback loop, the orchestrator could expose an API endpoint where Flux will send the status of the deployments managed by a
ResourceSet
. This is already implemented in Flux, where events are sent to external services via notification-controller. The Flux events contain the information a 3rd-party orchestrator would need: the app version deployed, the target cluster, the deployment status, etc.Proposal
To enable the Flux Operator to dynamically deploy applications based on data provided by 3rd-party orchestrators, the
ResourceSetInputProvider
should be extended with a new typeExternalService
that would allow the operator to fetch arbitrary data from an external service via HTTP/S.Example
Example of a
ResourceSetInputProvider
that fetches input values from an orchestrator API:The orchestrator API should be able to authorise the Flux Operator API calls using basic auth, bearer token and/or mTLS.
The orchestrator API should return a JSON object that contains an array of input values for the
ResourceSet
templates.Example of a response that contains input values for two tenants of app1 with different feature flags:
Example of a
ResourceSet
that uses the inputs fetched from the orchestrator API:Given the above configuration, the orchestrator can instruct Flux Operator to perform the following actions:
HelmRelease
values and trigger a Helm upgrade.OCIRepository
ref and trigger a Helm upgrade for the new Chart version.The orchestrator can use the Flux events to track the status of the deployed instances by exposing an API endpoint that Flux notifications-controller can call.
Example of Flux
Alert
that sends events to the orchestrator API:Every time a
HelmRelease
changes its status, the orchestrator will receive a HTTP POST request, for example:The Flux events can contain arbitrary data set in the
ResourceSet
using theevent.toolkit.fluxcd.io/tenant
annotations. The custom metadata can be used by the orchestrator to identify the deployment and update its internal state.The text was updated successfully, but these errors were encountered: