Skip to content

Support for efficient stack configuration updates #965

@JonCholas

Description

@JonCholas

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

In the current design, the stack controller populates the stack field in the workspace CRD. The stacks are composed of the config and some other stack configurations.

When the workspace starts (aka is ready), the workspace_controller sets the stack configuration based on the workspace stack field

if len(stack.Config) != 0 {
	l.V(1).Info("Setting the stack configuration")
	config := make([]*agentpb.ConfigItem, 0, len(stack.Config))
	for _, item := range stack.Config {
		config = append(config, marshalConfigItem(item))
	}
	_, err := wc.SetAllConfig(ctx, &agentpb.SetAllConfigRequest{
		Config: config,
	})
	if err != nil {
		return err
	}
}

This creates a 1:1 dependency between the Workspace and the stack configuration. So every time the stack config changes, the stack generation changes, and then the workspace generation changes and therefore the workspace gets a rollout deployment (stateful changes).

A workspace is meant to be a runtime for the stack and should be independent of the stack config and any other field that doesn't affect the workspace pod.

The current methods waste a ton of resources re-initialising the pod (not to mention re-scheduling a new one, which will depend on the autoscaler to provision a new node or be able to re-utilise the current one) when the pod doesn't need to change, as the stack config is independent of the runtime environment.

Other stack changes should affect the pod, like the podTemplate or other arguments that are injected into the workspace (like service_account), but nothing else.

Is there any reason why the stack config shouldn't be on the update CRD instead? It would make more sense to have the stack config per update to track different configs on each update.

Affected area/feature

Pulumi operator

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions