cert-manager: Failed calling webhook "webhook.cert-manager.io": connect: connection refused
🌟 tl;dr: If you hit
connect: connection refused
, you can debug the error by reading the section Error 1: connect: connection refused of The Definitive Debugging Guide for the cert-manager Webhook Pod.
Describe the bug: Upon trying to create a ClusterIssuer (after waiting for cert-manager pod to be ready) I get:
Error from server (InternalError): error when creating "STDIN": Internal error occurred: failed calling webhook "webhook.cert-manager.io": Post https://cert-manager-webhook.cert-manager.svc:443/mutate?timeout=30s: dial tcp 10.152.183.156:443: connect: connection refused
Error: error executing "/tmp/terraform_1028679806.sh": Process exited with status 1
Expected behaviour: ClusterIssuer is created.
Steps to reproduce the bug: In my setup Terraform runs the following script after provisioning Ubuntu 20.04 on DigitalOcean:
snap wait system seed.loaded
snap install microk8s --classic --channel=1.18/stable
export PATH=$PATH:/snap/bin/
microk8s status --wait-ready
microk8s enable dns dashboard helm3 ingress registry
microk8s helm3 repo add jetstack https://charts.jetstack.io
microk8s helm3 repo update
microk8s kubectl create namespace cert-manager
microk8s helm3 install cert-manager jetstack/cert-manager \
--namespace cert-manager \
--version v0.15.2 \
--set installCRDs=true \
--set ingressShim.defaultIssuerName=letsencrypt-prod \
--set ingressShim.defaultIssuerKind=ClusterIssuer \
--set ingressShim.defaultIssuerGroup=cert-manager.io
while [[ $(microk8s kubectl get pods -n cert-manager -l app=cert-manager -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]
do
echo "Waiting for cert-manager pods to be ready."
sleep 5
done
cat <<EOF | microk8s kubectl apply -f -
apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: <removed>
privateKeySecretRef:
name: <removed>
solvers:
- selector: {}
- http01:
ingress:
class: nginx
---
EOF
Anything else we need to know?: The “wait” loop runs for about 30 seconds before proceeding and throwing the error.
Environment details::
- Kubernetes version (e.g. v1.10.2): microk8s 1.18
- Cloud-provider/provisioner (e.g. GKE, kops AWS, etc): DigitalOcean
- cert-manager version (e.g. v0.4.0): 0.15.2
- Install method (e.g. helm or static manifests): helm3
/kind bug
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (4 by maintainers)
I didn’t see
connect: connection refused
for some reason… It seems your controller nodes cannot reach the network where the cert-manager pod runs. Is there some firewall in place that can block this? That would cause the refuse…We have new Webhook debug documentation, I suggest checking them out at https://cert-manager.io/docs/concepts/webhook/ if we missd any use case PRs welcome!
version
log
Noticing a very similar if not the same issue on a fresh install into Kind from v1.0.1