Skip to content

Multi Region Support - Restructure orchestrator package

Related tasks

Context

The orchestrator package contains a Cluster interface composed of several interfaces that manage different resources (e.g. Pods, Nodes, Services, etc.). All of these interfaces exist in the same package. Because of the way things are setup, it is difficult to understand the relationship between files in the package, and to know which implementations are for each component.

Change

The orchestrator package has been restructured to have a package per cluster resource interface. This structure will allow to define different implementations for each interface, and provides a similar directory structure to other components that implement a Factory.

pkg/orchestrator/
├── components/              \\ Cluster components. `Pods`, `Nodes`, `Services`, etc.
│   ├── ingresses/
│   │   ├── implementations/ \\ `Ingresses` implementations
│   │   └── ingresses.go     \\ `Ingresses` interface
│   ⋮    
│   ├── services/
│   │   └── implementations/ \\ `Services` implementations
│   │   └── services.go      \\ `Services` interface
│   └── spdy/                \\ SPDY executor
├── implementations/         \\ Cluster implementations
├── resource/                \\ `Resource` and `Selector` interfaces
└── cluster.go               \\ `Cluster` interface

Resource and Selector were extracted into their own packages to avoid cyclical import errors.

Other information

Additional documentation

Edited by Alejo Carballude

Merge request reports