Skip to main content
Version: Next

How to quickly check the synchronization status of CRD

When using the Apache APISIX Ingress Controller declarative configuration, often use the kubectl apply command. Only if the configuration was verified by its Open API V3 Schema definition and its validation webhooks (if any), can the configuration be accepted by Kubernetes.

When the Apache APISIX Ingress Controller watches the resource change, the logic unit of the Apache APISIX Ingress Controller has just started to work. In various operations of the Apache APISIX Ingress Controller, object conversion and more verification will be performed. When the verification fails, the Apache APISIX Ingress Controller will log an error message and will continue to retry until the declared state is successfully synchronized to APISIX.

Therefore, after the declarative configuration is accepted by Kubernetes, it does not mean that the configuration is synchronized to APISIX.

In this practice, we will show how to check the status of CRD.

Prerequisites#

  • an available Kubernetes cluster (version >= 1.14)
  • an available Apache APISIX (version >= 2.6) and Apache APISIX Ingress Controller (version >= 0.6.0) installation

Take ApisixRoute resource as an example#

deploy and check ApisixRoute resource#

  1. first deploy an ApisixRoute resource

e.g.

kubectl apply -f - <<EOF
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
name: httpbin-route
spec:
http:
- name: rule1
match:
hosts:
- httpbin.com
paths:
- /ip
backends:
- serviceName: httpbin-service-e2e-test
servicePort: 80
EOF
  1. After apply the ApisixRoute resource, now check the status of CRD
kubectl describe ar -n test httpbin-route

Then, will see the status of httpbin-route resource.

...
Status:
Conditions:
Last Transition time: 2021-06-06T09:50:22Z
Message: Sync Successfully
Reason: ResourceSynced
Status: True
Type: ReousrceReady
...

Also supports checking the status of other resources#

ApisixUpstream ApisixTls ApisixClusterConfig ApisixConsumer

Frequent Questions#

If can not see the Status information, please check the following points:

  1. The version of Apache APISIX Ingress Controller needs to be >= 1.0.
  2. Use the latest CRD definition file, refer to here.
  3. Use the latest RBAC configuration, refer to here.