apisix-ingress-controller: ApisixTls status not updated
Issue description
I use cert manager to generate certificates and create the Certificate
and ApisixTls
resources at the same time. Cert-manager needs some time to request the certificate, so when apisix-ingress-controller tries to find the cert secret it doesn’t exist yet. The problem is apisix-ingress-controller won’t retry to find the secret, so we are stucked. I know it is documented here that the secret should exist when we create the ApisixTls resource, but with a retry mechanism it would be much more relieable.
Edit: as I see, there is a retry rule in apisix-ingress-controller, but in this case it doesn’t seem to retry. Maybe because of the ResourceSyncAborted
status reason?
Environment
- your apisix-ingress-controller version (output of apisix-ingress-controller version --long):
Version: 1.4.1
Git SHA: no-git-module
Go Version: go1.16.15
Building OS/Arch: linux/amd64
Running OS/Arch: linux/amd64
- your Kubernetes cluster version (output of kubectl version):
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.1", GitCommit:"3ddd0f45aa91e2f30c70734b175631bec5b5825a", GitTreeState:"clean", BuildDate:"2022-05-24T12:26:19Z", GoVersion:"go1.18.2", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"22+", GitVersion:"v1.22.11-eks-18ef993", GitCommit:"b9628d6d3867ffd84c704af0befd31c7451cdc37", GitTreeState:"clean", BuildDate:"2022-07-06T18:06:23Z", GoVersion:"go1.16.15", Compiler:"gc", Platform:"linux/amd64"}
Minimal test code / Steps to reproduce
Install cert-manager and apisix-ingress-controller, and
create the following:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: test
namespace: default
spec:
dnsNames:
- '*.test.example.com'
issuerRef:
group: cert-manager.io
kind: ClusterIssuer
name: letsencrypt-prod
secretName: test-wildcard
---
apiVersion: apisix.apache.org/v2beta3
kind: ApisixTls
metadata:
name: test
namespace: default
spec:
hosts:
- '*.test.example.com'
secret:
name: test-wildcard
namespace: default
Actual result
status:
conditions:
- lastTransitionTime: "2022-08-04T13:23:20Z"
message: secret "test-wildcard" not found
observedGeneration: 1
reason: ResourceSyncAborted
status: "False"
type: ResourcesAvailable
Error log
Expected result
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (8 by maintainers)
Here is how to reproduce:
create namespace and the ApisixTls:
check the ApisixTls status:
ingress controller logs (secret not found):
wait a few seconds, then create the tls secret
ingress controller logs (only healthcheck, no error):
apisix logs (ssl resource created successfully in apisix):
Check the ApisixTls status again, not updated:
@tao12345666333 sure, I will on the weekend if that’s fine, don’t have time right now