Hi, I am trying to apply some Kubernetes CRDs via ...
# general
b
Hi, I am trying to apply some Kubernetes CRDs via Pulumi but it seems Pulumi doesnt like my CRD definition, I am getting following error
Is this some known Pulumi issue ? It seems that the CRD itself looks fine
p
Can you share some code? As far as I remember I didn’t have any issues with CRDs in pulumi but it was some time ago.
b
@boundless-angle-56560 does your crd have an Empty status map at the end of it ?
p
@billowy-army-68599 I guess you’re thinking about:
Copy code
# Workaround: <https://github.com/pulumi/pulumi-kubernetes/issues/800>
def remove_status(obj, _):
    if obj["kind"] == "CustomResourceDefinition":
        del obj["status"]
(that’s a copy&paste from one of my projects) If so, I was thinking about it but the message doesn’t seem to fit that case.
b
Yes that’s the one
b
the CRD looks like this:
apiVersion: <http://apiextensions.k8s.io/v1|apiextensions.k8s.io/v1>
kind: CustomResourceDefinition
metadata:
name: manifests.akash.network
spec:
group: akash.network
scope: Namespaced
names:
plural: manifests
singular: manifest
kind: Manifest
shortNames:
- mani
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
lease_id:
type: object
properties:
owner:
type: string
dseq:
type: string
format: uint64
gseq:
type: integer
oseq:
type: integer
provider:
type: string
group:
type: object
properties:
name:
type: string
services:
type: array
items:
type: object
properties:
name:
type: string
image:
type: string
args:
type: array
items:
type: string
env:
type: array
items:
type: string
unit:
type: object
properties:
cpu:
type: number
format: uint32
memory:
type: string
format: uint64
storage:
type: string
format: uint64
count:
type: number
format: uint64
expose:
type: array
items:
type: object
properties:
port:
type: integer
format: uint16
external_port:
type: integer
format: uint16
proto:
type: string
service:
type: string
global:
type: boolean
hosts:
type: array
items:
type: string
@billowy-army-68599 @prehistoric-activity-61023 ^
b
how are you applying it? can you share your python code
p
python code would be nice; plus attach it as a snippet so it’s more readable and easier to download (shortcuts/lighting icon -> “Create a text snippet”)
b
here, @billowy-army-68599 @prehistoric-activity-61023 sorry for late reply
p
I tried that on my cluster and it worked just fine (and created appropriate CRD).
Copy code
❯ pip freeze | grep pulumi-
pulumi-cloudflare==3.3.0
pulumi-gcp==5.11.0
pulumi-kubernetes==3.5.0
pulumi-random==4.2.0
just in case it’s an issue with some particular
pulumi-kubernetes
version
tested on pulumi 3.7.0
b
I'll check my versions
p
same with latest versions (pulumi 3.11.0 and kubernetes 3.7.0)
b
I'll try to update pulumi-kubernete
now on 3.7.0 but the issue persist 😕
p
how about
pip freeze | grep pulumi
?
I can see you’re using python39 (I tested on python38) but I don’t think that should be the issue
+ can you share the full error stacktrace as a snippet?
b
p
Copy code
pip install --upgrade pulumi
b
ok issue is gone
🙂
for some reason I though that when I am upgrading pulumi I just run the sh installer and I am done
p
the thing is that, you have an additional python dependency there as well
b
and the installer is not triggering upgrades of pip dependencies ?
p
I don’t have any pieces of advice yet regarding how to deal with that
It does not. You have to manually upgrade that.
b
ok, at least I know now for the next time 🙂
p
I assume you’re already using some
requirements.txt
file so just make sure you use pinned versions there.
although now I’m thinking we should ensure that these versions match 🤔
b
I think this is a common problem in the python world
p
If that assumption is true, it would be nice to compare pulumi version with python lib version while doing
pulumi up
for example
b
yeah, I mean, any kind of intelligent check that would intelligently point user that he should check his versions would be helpful
p
I think this is a common problem in the python world
I wouldn’t say so. There’s an interesting approach here used in pulumi where you have CLI tool (pulumi binary) as well as some programming lang environment (e.g. python but it might be js as well) and these two pieces must communicate with each other.
in other words: pulumi cli runs python environment that uses pulumi python module
b
understood
p
I’d need to read more on the low-level pulumi architecture to give you some more details but basically I assume that’s how it must be designed 😉
Pulumi cli can use different languages (python, golang, javascript and c# if I remember well) so there must be some communication-bridge between pulumi-cli and your python project (that’s why you need
pulumi
as python dependency). If it’s possible to have “version conflicts”, we should have some warning/error while trying to run it 🤔 . If you take a look at the traceback, it’s quite hard for an inexperienced person to understand anything from it. @billowy-army-68599 Maybe you can follow up? Did I get it right and if so, are there any plans to add some additional version assertions?
b
No that’s absolutely right!