-
Notifications
You must be signed in to change notification settings - Fork 115
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
failed to determine if the following GVK is namespaced if CRD is created in the same run #3176
Comments
The workaround I use now is to create the CRDs myself with another
then I set |
This changes our error handling in `Normalize` to degrade gracefully in the case when we can't determine namespaced-ness, probably due to the CRD not existing yet. Instead of failing, we assume the resource is namespaced to allow the preview to succeed. This is consistent with our error handling for this case elsewhere: * Check https://github.com/pulumi/pulumi-kubernetes/blob/0f834c8b0d89e0003f0dc2d527d4ca8e2cde26e9/provider/pkg/provider/provider.go#L1481-L1488 * Invoke: https://github.com/pulumi/pulumi-kubernetes/blob/0f834c8b0d89e0003f0dc2d527d4ca8e2cde26e9/provider/pkg/provider/invoke_decode_yaml.go#L49-L56 Fixes #3176
I faced a similar issue with multiple Release, e.g Kyverno or Karpenter and after quite a lot of testing, here is my conclusion:
A little test I run, trying to create the same resource but with a different provider (made sure there was no clash in the manifest): Updating (dev):
Type Name Status Info
pulumi:pulumi:Stack pulumi-aetion-dev **failed** 1 error
└─ pulumi-project:k8s:core-components core-components
+ ├─ kubernetes:helm.sh/v3:Release helm-kyverno created (67s)
+ ├─ kubernetes:yaml:ConfigFile kyverno-sync-secret-crd created
+ │ └─ kubernetes:kyverno.io/v1:ClusterPolicy sync-secrets created (3s)
+ └─ kubernetes:yaml/v2:ConfigFile kyverno-sync-secret-crd2 created
Diagnostics:
pulumi:pulumi:Stack (pulumi-aetion-dev):
error: kubernetes:yaml/v2:ConfigFile resource 'kyverno-sync-secret-crd2' has a problem: marshaling properties: awaiting input property "resources": failed to determine if the following GVK is namespaced: kyverno.io/v1, Kind=ClusterPolicy
No amount of waiting or anything like that would help, as a matter of fact CRDs are created very early with Helm, way before the Pods are rolled out and the ConfigFile provider try to apply a manifest (it's easy to check with My suspicion lies here but I was not able to test it. Anyway, I'm not sure what's the difference between the provider |
The basic requirement is that the CRD be definitely installed before any CRs that depends on it are registered. This requirement is usually solved with the In preview mode, the provider maintains a cache of the CRDs that are planned, so that Pulumi may determine whether a given CRD is namespaced or cluster-scoped. The |
What happened?
I'm deploying cert-manager helm release + a ClusterIssuer resource
cert-manager helm release creates the ClusterIssuer CRD, but it seems that the
pulumi.ConfigGroup
that creates theClusterIssuer
resources tries to check some properties of theClusterIssuer
CRD before it's actually created although there isdepends_on
to the cert-manager.If I rerun
pulumi up -y --skip-preview
after then theClusterIssuer
will be created fine. That's why I think it's a timing issue between the creation of theClusterIssuer
CRD and the actualClusterIssuer
resource.Example
Output of
pulumi about
Additional context
No response
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).
The text was updated successfully, but these errors were encountered: