-
|
I have a kustomization directory containing the following three files:
When I try to apply this kustomization, I get the following error: How can I get this kustomization to work? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
This is a common chicken-and-egg problem with kustomize. When you include both a HelmChart (which installs cert-manager and its CRDs) and a ClusterIssuer (which depends on those CRDs) in the same kustomization, kustomize tries to validate the ClusterIssuer against the CRD schema at build time — but the CRD doesn't exist yet. The simplest fix is to split them into two separate kustomization directories and apply them in order. Or if you're using something like ArgoCD or Flux, use sync waves / dependencies to control the ordering. If you want to keep them together, you can tell kustomize to skip validation for unknown resources by using the Another approach: wrap the ClusterIssuer in its own HelmChart that depends on cert-manager being ready, using a simple Helm chart with a |
Beta Was this translation helpful? Give feedback.
Thank you for your response.
What I learned after I posted this question is that a
HelmChartresource does not install the CRD itself, but rather starts a helm install on the cluster, and that helm install ends up creating the CRDs. So, kustomize has no way of knowing that the CRD installation is included in this run.So, I abandoned the
HelmChartapproach and switched to having kustomize install everything itself. For helm charts, I ended up using the kustomizeHelmChartInflationGeneratorresource, since it allows my to "kustomize" the chart values using environment overlays. Now, I'm not running into the error reported in my original post anymore, since the Kubernetes API sees the CRD i…