terraform-provider-kustomization
terraform-provider-kustomization copied to clipboard
Retry "no endpoints available for service" errors
This issue is similar to https://github.com/kbst/terraform-provider-kustomization/issues/116, in the sense that I'm trying to deploy a ClusterIssuer
, but instead of failing due to:
│ Error: github.com/kbst/terraform-provider-kustomize/kustomize.kustomizationResourceCre
ate: apiVersion: "cert-manager.io/v1", kind: "ClusterIssuer", namespace: "cert-manager"
name: "letsencrypt": create failed: the server could not find the requested resource
│
│ with kustomization_resource.p1["cert-manager.io_v1_ClusterIssuer|cert-manager|letsen
crypt"],
│ on kustomize.tf line 43, in resource "kustomization_resource" "p1":
│ 43: resource "kustomization_resource" "p1" {
│
the error I get is an eventual consistency one:
│ Error: github.com/kbst/terraform-provider-kustomize/kustomize.kustomizationResourceCreate: apiVersion: "cert-manager.io/v1alpha2", kind: "ClusterIssuer", namespace: "" name: "kubeflow-self-signing-issuer": create failed: conversion webhook for cert-manager.io/v1alpha2, Kind=ClusterIssuer failed: Post "https://cert-manager-webhook.cert-manager.svc:443/convert?timeout=30s": no endpoints available for service "cert-manager-webhook"
│
│ with kustomization_resource.kubeflow_requirements_p1["cert-manager.io/ClusterIssuer/_/kubeflow-self-signing-issuer"],
│ on kubeflow.tf line 82, in resource "kustomization_resource" "kubeflow_requirements_p1":
│ 82: resource "kustomization_resource" "kubeflow_requirements_p1" {
The way I'm working around this, is by retrying the deployment. Currently considering using terragrunt as a catch-all solution.
Maybe this sort of eventual consistency errors, e.g the cert-manager-webhook is not ready yet but it will eventually, could be handled by the provider by retrying. What do you think?
Bump, we're also getting the exact same error. It only seems to happen when we're adding in addition resources that use a CRD in order to create.

@andruwa13 , ClusterIssuer
is not a namespaced resource. You get this error because you're setting a namespace. Fix your manifests/kustomization. This issue is about something else.
@Pst thank you, it works
The provider has the ability to wait for deployments for a while by setting wait = true
on the kustomization_resource
. I'm closing this issue now. People facing this can order their code in a way that it waits for the webhook deployment before continuing with the other resources. That should do the trick.