Skip to content
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

Cannot create cert-manager selfSigned Issuer #244

Open
steled opened this issue Dec 22, 2022 · 0 comments
Open

Cannot create cert-manager selfSigned Issuer #244

steled opened this issue Dec 22, 2022 · 0 comments

Comments

@steled
Copy link

steled commented Dec 22, 2022

The problem seems to be the same as described here: hashicorp/terraform-provider-kubernetes#1352

Terraform Version, Provider Version and Kubernetes Version

$ terraform version
Terraform v1.3.6
on linux_amd64
+ provider registry.terraform.io/gavinbunney/kubectl v1.14.0
+ provider registry.terraform.io/hashicorp/helm v2.7.1
+ provider registry.terraform.io/hashicorp/http v3.2.1
+ provider registry.terraform.io/hashicorp/kubernetes v2.16.1

$ kubectl version --short
Client Version: v1.25.3
Server Version: v1.24.7

Affected Resource(s)

kubectl_manifest

Terraform Configuration Files

resource "kubectl_manifest" "cert-manager_clusterissuer" {
  yaml_body = <<YAML
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: selfsigned-cluster-issuer
spec:
  selfsigned: {}
YAML

  depends_on = [
    module.cert-manager
  ]
}

Steps to Reproduce

Apply the above resource.

Expected Behavior

The ClusterIssuer should be deployed.

Actual Behavior

If I try to apply the code above I get the following error:

kubectl_manifest.cert-manager_clusterissuer: Creating...
╷
│ Error: selfsigned-cluster-issuer failed to run apply: error when creating "/tmp/979378527kubectl_manifest.yaml": admission webhook "webhook.cert-manager.io" denied the request: spec: Required value: at least one issuer must be configured
│
│   with kubectl_manifest.cert-manager_clusterissuer,
│   on clusterissuer.tf line 1, in resource "kubectl_manifest" "cert-manager_clusterissuer":
│    1: resource "kubectl_manifest" "cert-manager_clusterissuer" {

Workaround

When I apply the following code manually it works:

$ cat <<EOF | kubectl apply -f -
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: selfsigned-cluster-issuer
spec:
  selfSigned: {}
EOF
clusterissuer.cert-manager.io/selfsigned-cluster-issuer created
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant