Checking the synchronization status of the CRDs
APISIX CRDs are applied to a Kubernetes cluster using the kubectl apply
command. Behind the scenes, Kubernetes verifies the configuration using the Open API V3 schema and its validation webhooks (if any).
But this does not mean that the configuration is synchronized and validated by APISIX. APISIX will convert the declared configuration to APISIX-specific resources and verify it. If the verification fails, the Ingress controller will log an error message and will retry until the desired state is successfully synchronized to APISIX.
This guide will show how you can check the synchronization status of the CRDs.
#
Example with ApisixRouteThis example uses ApisixRoute resources. But this also applies to other APISIX CRDs like ApisixUpstream, ApisixTls, and ApisixClusterConfig.
We can deploy a sample ApisixRoute resource:
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
Once this resource is applied, you can check its synchronization status with its name as shown below:
kubectl describe ar httpbin-route
This will give the status as shown below:
...
Status:
Conditions:
Message: Sync Successfully
Observed Generation: 1
Reason: ResourcesSynced
Status: True
Type: ResourcesAvailable
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ResourcesSynced 50s (x2 over 50s) ApisixIngress ApisixIngress synced successfully
#
TroubleshootingIf you are not able to see the status, please check if you are using:
- An APISIX Ingress controller version
>=1.0
. - The latest CRD definition file.
- The latest RBAC configuration.