-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a podTemplate inside the workspaceTemplate #774
Comments
I'll add some context for this from the slack conversation: I was trying to add a pulumi plugin (for scala support) in my Stack custom resource for the operator. I found this issue/comment which suggests adding an init container to achieve this. (I assume Stack.spec.workspaceTemplate.spec.podTemplate.spec) So far I've come across two issues with this approach, but I was just trying to get this to work relatively quickly so I may have missing something.
This is the quick & dirty spec I was trying to get to work: workspaceTemplate:
spec:
podTemplate:
spec:
initContainers:
- name: install-scala-cli-and-plugin
image: curlimages/curl:latest
command:
- "/bin/sh"
- "-c"
- |
cd /share/workspace
curl -sSLf https://scala-cli.virtuslab.org/get | sh
pulumi plugin install language scala 0.3.2 --server github://api.github.com/VirtusLab/besom
containers:
- name: "dummy"
image: busybox:latest This is the resulting updated spec, which puts the custom initContainer before the others:
|
The approach worked for me pretty well. Maybe there is just an misunderstanding how the template works? The podTemplate is applied as a strategic merge patch (as described in the docs).
In your example you use a init container with just the curl image, there is no pulumi cli installed nor any volume mounted. So how should the plugin get into the main container executing pulumi? You just miss a bunch of things, maybe this example helps you #430 (comment) ? |
Thanks @alexstaeding and @project0 for the discussion, is there a specific change you think we should make, e.g. to the merging logic? How should we ensure that the init containers are correctly ordered? |
@alexstaeding (documentation confusion aside) -- note that you can avoid adding a dummy container if you specify an empty list (due to the merge): workspaceTemplate:
spec:
podTemplate:
spec:
initContainers:
...
containers: [] |
We currently expect a fully-formed Pod spec, but we should use an apply configuration instead.
I have a branch where I started this work but I ran into a number of issues.
#713 (comment)
The text was updated successfully, but these errors were encountered: