APIRule v2 Doesn't Contain Rules ​
Symptom ​
An APIRule custom resource (CR) does not contain the rules field, for example:
kubectl get apirules.gateway.kyma-project.io -n $NAMESPACE $APIRULE_NAME -oyamlapiVersion: gateway.kyma-project.io/v2
kind: APIRule
metadata:
name: httpbin
namespace: test
spec:
gateway: kyma-system/kyma-gateway
hosts:
- httpbin.local.kyma.dev
service:
name: httpbin
namespace: test
port: 8000
status:
lastProcessedTime: "2025-04-25T11:16:11Z"
state: ReadyCause ​
The APIRule was originally created using version v1beta1, and you haven't yet migrated it to version v2. Since the latest stable version of the APIRule in the Kubernetes API is now v2, running the kubectl get command without specifying a version of APIRule assumes version v2.
To display the resource in version v2, a conversion from v1beta1 to v2 is performed. This conversion only affects the displayed resource's textual format and does not modify the resource in the cluster. If the full conversion is possible, the rules field is presented in the output. However, if the conversion cannot be completed, the rules are missing, and the original rules are stored in the resource's annotations.
Solution ​
To make sure that support for your APIRules is maintained, you must migrate them to version v2. To learn how to do this, follow the APIRule migration guide.
Specify explicitly v1beta1 version when requesting the APIRule resource to obtain the complete configuration, including the rules field:
kubectl get apirules.v1beta1.gateway.kyma-project.io -n $NAMESPACE $APIRULE_NAME -oyaml