Can create Kongingress by k8s CRD api

In my case ,i want use java api to create kongingress ,find a lot of things , i got k8s provide crd module to get&create crd.
I use CustomObjectsApi.listClusterCustomObject get kongingress config ,but when i use CustomObjectsApi.createClusterCustomObject api, k8s return 404 not found ;
Is my code wrong or is need setting some config

get kongingress code :
CustomObjectsApi apiInstance = new CustomObjectsApi();
String group = “”;
String version = “v1”;
String plural = “kongingresses”;
String pretty = “ture”;
String fieldSelector = “metadata.namespace=” + buId;
try {
Object result = apiInstance.listClusterCustomObject(group, version, plural, null,
null, fieldSelector, null, null,
null, null, null);
String listCluster = JSONObject.toJSONString(result);
JSONObject jsonObject = JSONObject.parseObject(listCluster);
if (null == jsonObject.getJSONArray(“items”) || jsonObject.getJSONArray(“items”).isEmpty()) {
return false;
} else {
return true;
} catch (Exception e) {
log.error(“Get KongIngress error,” + buId, e);
throw new RuntimeException(“Get KongIngress error,” + buId, e);

return message:

create kongingress code :
CustomObjectsApi apiInstance = new CustomObjectsApi();
String group = “”;
String version = “v1”;
String plural = “kongingresses”;
Object createRs = apiInstance.createClusterCustomObject(group, version, plural, ingressYaml, null, null,

ingressYaml like:
kind: KongIngress
name: https-only
namespace: testbu001

  • https
    https_redirect_status_code: 302

error message:
io.kubernetes.client.openapi.ApiException: Not Found
at io.kubernetes.client.openapi.ApiClient.handleResponse(
at io.kubernetes.client.openapi.ApiClient.execute(
at io.kubernetes.client.openapi.apis.CustomObjectsApi.createClusterCustomObjectWithHttpInfo(
at io.kubernetes.client.openapi.apis.CustomObjectsApi.createClusterCustomObject(

We unfortunately aren’t able to help you write a Java application to do this or assist with using the Kubernetes client libraries, but in general, yes, this should be possible: if you’ve installed our CRDs into your cluster, a Kubernetes API client issuing a well-formed request to the API server should be able to create a KongIngress resource.

That “Not Found” error likely indicates that you either haven’t actually installed the KongIngress CRD (and the API server doesn’t recognize attempts to create those resources) or that the client’s API server location setting isn’t correct (it’s sending an HTTP request to some other HTTP server, which doesn’t recognize the Kubernetes API routes and returns a 404).