https://pulumi.com logo
#general
Title
# general
a

alert-mechanic-59024

08/11/2021, 6:12 PM
Heya all. I have a few questions regarding the Pulumi K8s Operator (PKO), which I’d really appreciate some feedback on. In no particular order: Does the PKO support checking out the head of branches, rather than specific commits - i.e. follow master (and what is the default branch it uses - it is complaining about not being able to find my master branch); Does PKO support local state management, rather than operating against the Pulumi API? (If so, how does one pass this requirement to the stack CR); I’m getting “Failed to setup Pulumi workdir”,“Request.Namespace”“default”,“Request.Name”“bow-poc”,“Stack.Name”“bow poc”,“error”“failed to create local workspace: failed to create workspace, unable to enlist in git repo: unable to checkout branch: object not found”" when attempting to pull down a remote repo. Could someone point me in the right direction, please?
b

billowy-army-68599

08/11/2021, 6:18 PM
hey @alert-mechanic-59024 getting some answers for you here cc @sparse-park-68967
a

alert-mechanic-59024

08/11/2021, 6:20 PM
@billowy-army-68599 Thanks!
s

sparse-park-68967

08/11/2021, 6:21 PM
Does the PKO support checking out the head of branches, rather than specific commits - i.e. follow master
We added support for this in https://github.com/pulumi/pulumi-kubernetes-operator/blob/master/CHANGELOG.md#0015-2021-07-23
to track a branch you need to specify things in this format:
refs/heads/master
Does PKO support local state management, rather than operating against the Pulumi API?
You can specify the backend to use - defaults to pulumi service. See https://github.com/pulumi/pulumi-kubernetes-operator/blob/master/pkg/apis/pulumi/v1alpha1/stack_types.go#L32
Our docs are quite lacking on some of these configuration options. Happy to take PRs on example configuration etc.
a

alert-mechanic-59024

08/11/2021, 6:27 PM
As soon as I get it working, I’m happy to raise a few!
🙌 1
@sparse-park-68967 When attempting to build a python stack from the k8s operator, I seem to be having problems with venv: {“level”“debug”,“ts”1628722742.816751,“logger”“controller stack”,“msg”“Pip Install”,“Request.Namespace”“default”,“Request.Name”“bow-poc”,“Path”“/usr/local/bin/python3”,“Args”[“/usr/local/bin/python3”,“-m”,“venv”,“venv”],“Text”“Error [Errno 13] Permission denied: ‘/venv’“} <-- deployments seem to work against other runtimes, i.e. npm.
b

billowy-army-68599

08/11/2021, 11:22 PM
@alert-mechanic-59024 that looks like a filesystem error, python is trying to create your venv at the root of your filesystem
/venv
which probably doesn't have perms
a

alert-mechanic-59024

08/12/2021, 7:50 AM
@billowy-army-68599 This is inside the Pulumi K8s Operator Pod (PKO). It looks like it runs as non-root user, and yes… it does not have permission to create /venv. My feeling is that PKO should either attempt to create the directory within the workspace (which seems to be in /tmp/<tmp-git-checkout-dir>, or in its home directory… the former makes more sense. I’m assuming all that needs doing is to prefix workspace directory to venv before attempting to build out. The other issue I saw was that python attempts to run pip -r, but is unable to find the requirements.txt file… I’m assuming both issues occur due to not CWDing into correct workspace.
b

billowy-army-68599

08/12/2021, 4:17 PM
Hey Garron. this is related to python inside your env, not Pulumi itself. can you open an iossue on the operator repo for this?
s

sparse-park-68967

08/12/2021, 7:25 PM
Sorry missed this. Could you open an issue as Lee mentioned?
a

alert-mechanic-59024

08/16/2021, 2:26 PM
Will do, thanks.
10 Views