Multi Region Support - Orchestrator factories
requested to merge feature/multi_region_support_orchestrator_component_factory into feature/multi_region_support_multiple_platforms
Related tasks
Context
Change
This MR restructures the orchestrator
package to contain a components
subpackage, which in turn contains a component package for each cluster component (e.g. Nodes
, Pods
, Services
, etc.). Factories have been created for the orchestrator.Cluster
interface, as well as for the interface exported by every cluster component.
The orchestrator.Cluster
factory composes all component factories to allow creating clusters by nesting configs.
Cluster Factory
Nodes Factory
Pods Factory
Services Factory
Ingresses Factory
IngressRules Factory
NetworkPolicies Factory
This allows specifying a config like the following to create a cluster
# orchestrator.Cluster factory config
type: "kubernetes"
config:
api:
kubeconfig: "" # Use default kubeconfig ~/.kube/config
components:
# nodes.Nodes factory config
nodes:
type: "kubernetes"
# pods.Pods factory config
pods:
type: "kubernetes"
# services.Services factory config
services:
type: "kubernetes"
# ingresses.Ingresses factory config
ingresses:
type: "gloo"
# ingresses.ingressRules factory config
ingressRules:
type: "gloo"
# network.Policies factory config
networkPolicies:
type: "kubernetes"
Other information
The main downside to the Factory
approach is the considerable amount of boilerplate code needed to setup factories. Future work should address the amount of repeated code introduced in this MR.
Additional documentation
Edited by Alejo Carballude