pulumi-kubernetes-operator
pulumi-kubernetes-operator copied to clipboard
Unable to add a plugin to a stack
What happened?
I want to add a pulumi plugin for my stack, currently the pulumi-kubernetes-operator pod creates the pulumi workdir here, as its a dynamic path so I have no pay to run a pulumi plugin install from a local file that I am adding to the docker image for the stack to pickup.
Example
I added below to the Dockerfile to have my plugin installed
COPY ./bin/my-plugin-binary /tmp
RUN chmod 755 /tmp/my-plugin-binary
USER pulumi-kubernetes-operator
RUN pulumi plugin install resource my-plugin v0.0.1 -f /tmp/my-plugin-binary
It is installing the plugin in the path /home/pulumi-kubernetes-operator/.pulumi/plugins/ but the Stack root dir is
/tmp/pulumi-working/[my-namespace]/[my-stack-name]-[random alphanumeric string]/.pulumi so the custom plugin that I installed isn't being used by the stack when its doing pulumi up internally and I am getting the below error:
pulumi:providers:my-provider poc-gcp-us-west1Provider error: Could not automatically download and install resource plugin 'pulumi-resource-my-provide' at version v0.0.1, install the plugin using `pulumi plugin install resource rubix v0.0.1`: error downloading provider rubix to file: failed to download plugin: rubix-0.0.1: 403 HTTP error fetching plugin from https://get.pulumi.com/releases/plugins/pulumi-resource-my-provide-v0.0.1-linux-amd64.tar.gz\n pulumi:providers:rubix poc-gcp-us-west1Provider **failed**
Output of pulumi about
$pulumi about
CLI
Version 3.92.0
Go Version go1.21.3
Go Compiler gc
Host
OS debian
Version 11.8
Arch x86_64
Backend
Name pulumi.com
URL https://app.pulumi.com
User Unknown
Organizations
Token type personal
Pulumi locates its logs in /tmp by default
Additional context
My objective is to have a custom plugin available to my Stack, I am trying to achieve it by adding the pulumi plugin install... cmd to the Dockerfile assuming it will be used by the Stack but thats not happening as the pulumi root for the stack is different and my Dockerfile pulumi plugin install doesn't apply to that pulumi rootdir.
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
thanks for reporting this @avijitsarkar123. I think we're intentionally isolating the stack root directories to avoid cross contamination, but I can see how that makes configuring custom plugins difficult. We'll hang on to this issue as a reminder to design a way to do this better.
Good news everyone, we just release a preview of Pulumi Kubernetes Operator v2. This new release has a whole-new architecture that uses pods as the execution environment. The program sources are always checked out to /share/workspace, so you should be able to target that directory with an init container. It is also possible to create a custom docker image.
Please read the announcement blog post for more information: https://www.pulumi.com/blog/pulumi-kubernetes-operator-2-0/
Would love to hear your feedback! Feel free to engage with us on the #kubernetes channel of the Pulumi Slack workspace. cc @avijitsarkar123