terraform-provider-kustomization icon indicating copy to clipboard operation
terraform-provider-kustomization copied to clipboard

Retry "no endpoints available for service" errors

Open GerardoGR opened this issue 3 years ago • 4 comments

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?

GerardoGR avatar Dec 07 '21 10:12 GerardoGR

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.

joshua-nable avatar Mar 22 '22 15:03 joshua-nable

image

andruwa13 avatar Mar 30 '22 11:03 andruwa13

@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 avatar Apr 02 '22 22:04 pst

@Pst thank you, it works

andruwa13 avatar Apr 03 '22 05:04 andruwa13

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.

pst avatar May 11 '24 01:05 pst