Documentation
¶
Overview ¶
Package strategy dispatches a DeploymentIntent across the Runtime/Strategy axis: which backend to deploy to (Kubernetes, ECS, Knative) and, once a backend is chosen, which rollout strategy to run there (Rolling, BlueGreen).
In this domain, Kubernetes/ECS/Knative are themselves deployment strategies, not a separate runtime layer sitting above strategy — so RuntimeProvider (the Runtime switch) and each backend's own strategy dispatch (K8SStrategy's Rolling/BlueGreen switch, plus the ECS/Knative placeholders) live together in this one package rather than being split across "runtime" and "strategy" packages.
This package only decides *which* strategy runs; the actual object apply/teardown work is delegated to pkg/apis/deployment/api (e.g. K8SStrategy wraps api.K8SProvider and calls its ApplyServiceUnit).
Index ¶
- type ECSReconciler
- type K8SStrategy
- func (s *K8SStrategy) Execute(ctx context.Context, dIntent *intent.DeploymentIntent) (*domain.DeploymentResult, error)
- func (s *K8SStrategy) Runtime() intent.Runtime
- func (s *K8SStrategy) Supports(strategy intent.Strategy) bool
- func (s *K8SStrategy) Teardown(ctx context.Context, dIntent *intent.DeploymentIntent) error
- type KnativeReconciler
- type RuntimeProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ECSReconciler ¶
ECSReconciler is a placeholder for the ECS runtime backend — not yet implemented (see RuntimeProvider.Execute).
func NewECSReconciler ¶
func NewECSReconciler(scheme *runtime.Scheme, log logr.Logger) *ECSReconciler
NewECSReconciler constructs an ECSReconciler.
func (*ECSReconciler) Reconcile ¶
func (r *ECSReconciler) Reconcile( ctx context.Context, su serviceunitIntent.ServiceUnitIntent, ) (intent.ServiceUnitResult, error)
Reconcile executes a ServiceUnitIntent on ECS
type K8SStrategy ¶
type K8SStrategy struct {
K8S *api.K8SProvider
Log logr.Logger
}
K8SStrategy dispatches a DeploymentIntent's Strategy (Rolling, BlueGreen) against the Kubernetes runtime, delegating the actual object apply/ teardown to api.K8SProvider.
func NewK8SStrategy ¶
func NewK8SStrategy(k8s *api.K8SProvider, log logr.Logger) *K8SStrategy
NewK8SStrategy constructs a K8SStrategy wrapping the given K8SProvider.
func (*K8SStrategy) Execute ¶
func (s *K8SStrategy) Execute( ctx context.Context, dIntent *intent.DeploymentIntent, ) (*domain.DeploymentResult, error)
Execute dispatches dIntent's rollout strategy (Rolling, BlueGreen) to the matching apply path, delegating the actual object apply to K8S.
func (*K8SStrategy) Runtime ¶
func (s *K8SStrategy) Runtime() intent.Runtime
Runtime reports that K8SStrategy handles intent.RuntimeKubernetes.
func (*K8SStrategy) Supports ¶
func (s *K8SStrategy) Supports( strategy intent.Strategy, ) bool
Supports reports whether K8SStrategy can run the given rollout strategy (only Rolling and BlueGreen).
func (*K8SStrategy) Teardown ¶
func (s *K8SStrategy) Teardown( ctx context.Context, dIntent *intent.DeploymentIntent, ) error
Teardown delegates to K8S.Teardown, deleting the Kubernetes Deployment and Service objects this strategy applied for dIntent.
type KnativeReconciler ¶
KnativeReconciler is a placeholder for the Knative runtime backend — not yet implemented (see RuntimeProvider.Execute).
func NewKnativeReconciler ¶
func NewKnativeReconciler(c client.Client, scheme *runtime.Scheme, log logr.Logger) *KnativeReconciler
NewKnativeReconciler constructs a KnativeReconciler.
type RuntimeProvider ¶
type RuntimeProvider struct {
Client client.Client
Scheme *runtime.Scheme
Log logr.Logger
K8S *K8SStrategy
}
RuntimeProvider dispatches a DeploymentIntent's Runtime (Kubernetes, Knative, ECS) to the strategy that implements it. Runtime and Strategy are the same axis in this domain — which runtime to deploy to is itself a deployment strategy choice — so this and K8SStrategy live together in this package, not split across a separate "runtime" concept.
func NewRuntimeProvider ¶
func NewRuntimeProvider(c client.Client, scheme *runtime.Scheme, log logr.Logger, Recorder events.EventRecorder) *RuntimeProvider
NewRuntimeProvider constructs a RuntimeProvider, wiring up its K8S strategy from the given clients.
func (*RuntimeProvider) Execute ¶
func (p *RuntimeProvider) Execute( ctx context.Context, dIntent *intent.DeploymentIntent, ) (*domain.DeploymentResult, error)
Execute dispatches dIntent to the strategy implementing its Runtime. Knative and ECS are recognized but not yet implemented.
func (*RuntimeProvider) Teardown ¶
func (p *RuntimeProvider) Teardown( ctx context.Context, dIntent *intent.DeploymentIntent, ) error
Teardown dispatches dIntent to the strategy implementing its Runtime, mirroring Execute's dispatch. Knative and ECS are recognized but not yet implemented.