pulumi / pulumi-kubernetes-operator

A Kubernetes Operator that automates the deployment of Pulumi Stacks
Apache License 2.0
226 stars 54 forks source link

Support global vars, volumes and volumeMounts for workspace statefulsets within helm chart #749

Open drduker opened 1 week ago

drduker commented 1 week ago

Hello!

Support global vars, volumes and volumeMounts for workspace statefulsets from the operator being supported in the helm chart templates.

This is really an ask that should require two changes:

  1. Add helm templating to create a place for global values or a flag to have workspace pods inherit envs,volumes and volumeMounts from the operator config.
  2. Make the operator deploy statefulsets using additional global configs in addition to what comes from the workspaceTemplate with the stack configs.

Issue details

Affected area/feature

EronWright commented 6 days ago

I take this as a feature request to provide for global customization of the Workspace. I suppose the operator could have a cluster-scoped and/or namespace-scoped configuration object, providing a default workspace template (and would be merged with the stack's own template). The Helm chart could then produce this object.

A possible workaround would be to use a mutating webhook, to apply some defaults into the Stack object or directly into the Workspace object.

@drduker to help make the case for this feature, could you share some specific use cases that you have in mind?

drduker commented 6 days ago

Use case is an offline deployment where you have local libraries that require netrc variables set. This vars need to go onto the workspace pods. Could use kyvero yes. Iโ€™m setting the values per stack in the workspace template values now. But itโ€™s redundant and was not quick to find the usage for that. Had to look up spec and play around with that.