This message was deleted.
# general
s
This message was deleted.
b
can you show the output of your pulumi up/diff config?
f
Hi the error is
error: resource <http://operatorconfigurations.acid.zalan.do|operatorconfigurations.acid.zalan.do> was not successfully created by the Kubernetes API server : <http://customresourcedefinitions.apiextensions.k8s.io|customresourcedefinitions.apiextensions.k8s.io> "<http://operatorconfigurations.acid.zalan.do|operatorconfigurations.acid.zalan.do>" already exists
I'm gonna try an installation without Pulumi just in case it's something else
But it worked fine before, that's the thing
It's like it doesn't see that the CRD already exists
Yeah it works when I install the chart directly with helm
Uhm the CRDs do not show up in the web app under "Resources". Could it be that Helm is installing the CRDs because they are in the expected crds directory, but Pulumi doesn't track those? @billowy-army-68599
b
do you see the resource in your pulumi up output?
f
it shows that it needs to create them
but they exist already
b
how about the first time?
you said this happens on subsequent runs
f
uhm I need to check, one sec
yep only on folowing updates
b
which version of helm are you using?
f
3.2.4
yes, when I install the first time it lists the CRDs for creation:
Copy code
+   ├─ ZalandoPostgres                                                               zalando-postgres-operator                           create
 +   │  ├─ kubernetes:core:Namespace                                                  zalando-postgres-operator-ns                        create
 +   │  └─ kubernetes:helm.sh:Chart                                                   zalando-postgres-operator                           create
 +   │     ├─ kubernetes:<http://rbac.authorization.k8s.io:ClusterRoleBinding|rbac.authorization.k8s.io:ClusterRoleBinding>                 zalando-postgres-operator                           create
 +   │     ├─ kubernetes:apps:Deployment                                              postgres-operator/zalando-postgres-operator         create
 +   │     ├─ kubernetes:<http://rbac.authorization.k8s.io:ClusterRole|rbac.authorization.k8s.io:ClusterRole>                        postgres-pod                                        create
 +   │     ├─ kubernetes:core:Service                                                 postgres-operator/zalando-postgres-operator         create
 +   │     ├─ kubernetes:<http://rbac.authorization.k8s.io:ClusterRole|rbac.authorization.k8s.io:ClusterRole>                        zalando-postgres-operator                           create
 +   │     ├─ kubernetes:<http://acid.zalan.do:OperatorConfiguration|acid.zalan.do:OperatorConfiguration>                          postgres-operator/zalando-postgres-operator         create
 +   │     ├─ kubernetes:core:ServiceAccount                                          postgres-operator/zalando-postgres-operator         create
 +   │     ├─ kubernetes:<http://apiextensions.k8s.io:CustomResourceDefinition|apiextensions.k8s.io:CustomResourceDefinition>                <http://postgresqls.acid.zalan.do|postgresqls.acid.zalan.do>                           create     1 warning
 +   │     └─ kubernetes:<http://apiextensions.k8s.io:CustomResourceDefinition|apiextensions.k8s.io:CustomResourceDefinition>                <http://operatorconfigurations.acid.zalan.do|operatorconfigurations.acid.zalan.do>                create     1 warning
the last two
but when I uninstalled before that, it didn't show the two CRDs for deletion
Doesn't Pulumi do
helm template
? When I run that command directly it doesn't show the CRDs in the output
b
yeah it does include the crds, I guess we probably need a feature flag to disable that if people want to
f
Ok. Is there something I can do in the meantime?
Some workaround?
b
you can use a transformation to drop the crds from the resources
f
The thing is that even if I ignore that, when I create a PG cluster (also with Pulumi) by creating the manifest, it doesn't do anything because it depends on the operator
uhm 😄
transformation? that is?
how can I adapt my code for that? Sorry I am pretty new to this and know close to zero of typescript as well
Found about transformations and I am trying something
I am trying with this but it doesn't seem to work
Copy code
transformations: [
          // Make every service private to the cluster, i.e., turn all services into ClusterIP instead of LoadBalancer.
          (obj: any, opts: pulumi.CustomResourceOptions) => {
            if (obj.kind === "CustomResourceDefinition" && (obj.metadata.name === "<http://postgresqls.acid.zalan.do|postgresqls.acid.zalan.do>" || obj.metadata.name === "<http://operatorconfigurations.acid.zalan.do|operatorconfigurations.acid.zalan.do>")) {
              obj.apiVersion = "v1"
[]              obj.kind = "List"
            }
          },
        ],
I am trying with a snippet from the docs
Actually it works! There was a stupid syntax error so the failure was different, plus I had to first clean up the leftovers manually. Thanks for pointing me to transformations!
b
no problem, glad that got your sorted. We're having a discussion internally to figure out how to better support this
and transformations are my fav pulumi/kubernetes feature
f
Hi @billowy-army-68599 yeah that feature looks very handy. What happens when you update Pulumi to improve handling this? I mean now my code tells the chart module to ignore the CRDs, and I am creating the CRDs by loading the yaml files directly. So at the moment the CRD resources are associated with the config files, right? So when you change Pulumi what will I need to change in my code without affecting the existing installation? Thanks!