# 404 Error while creating KongConsumer using kubernetes API with python

**URL:** <https://discuss.konghq.com/t/404-error-while-creating-kongconsumer-using-kubernetes-api-with-python/8038>\
**Category:** Questions\
**Tags:** kubernetes\
**Created:** [March 12, 2021, 3:01pm UTC](https://discuss.konghq.com/t/404-error-while-creating-kongconsumer-using-kubernetes-api-with-python/8038 "2021-03-12T15:01:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amit\_gadhia](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/amit_gadhia/32/2638_2.png) [@amit\_gadhia](https://discuss.konghq.com/u/amit_gadhia)\
**Post date:** [March 12, 2021, 3:01pm UTC](https://discuss.konghq.com/t/404-error-while-creating-kongconsumer-using-kubernetes-api-with-python/8038/1 "2021-03-12T15:01:15Z")

</div>

I installed Kong ingress in EKS its working. Now i want to create Customer using python with Kubernetes API

**Code:-**

```
def main():
config.load_kube_config()
api = client.CustomObjectsApi()

my_resouces = {
    "apiVersion": "configuration.konghq.com/v1",
    "kind": "KongConsumer",
    "metadata": {"name": "testuser", "annotations": {"kubernetes.io/ingress.class": "kong"}},
    "username": "testuser"
}
# Create the resouce
api.create_namespaced_custom_object(
    group="configuration.konghq.com",
    version="v1",
    namespace="default",
    plural="kong",
    body=my_resouces,
)

```

**Error -:**

Reason: Not Found  
HTTP response headers: HTTPHeaderDict({‘Audit-Id’: ‘663afc53414-ec59-4467-aeeb-13c654baef84’, ‘Cache-Control’: ‘no-cache, private’, ‘Content-Type’: ‘text/plain; charset=utf-8’, ‘X-Content-Type-Options’: ‘nosniff’, ‘Date’: ‘Fri, 12 Mar 2021 14:37:46 GMT’, ‘Content-Length’: ‘19’})  
HTTP response body: 404 page not found

---

<div class="post-metadata">

**Author:** ![traines](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/traines/32/158_2.png) [@traines](https://discuss.konghq.com/u/traines)\
**Post date:** [March 15, 2021, 9:24pm UTC](https://discuss.konghq.com/t/404-error-while-creating-kongconsumer-using-kubernetes-api-with-python/8038/2 "2021-03-15T21:24:07Z")

</div>

Are you able to create KongConsumers using other clients (e.g. kubectl), and are you able to create other resources using the Python client?

The plural for that CRD looks wrong (it should be `kongconsumers` rather than `kong`), but other than that we wouldn’t be able to provide much assistance–we aren’t familiar with the Python API server client.

---

<div class="post-metadata">

**Author:** ![amit\_gadhia](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/amit_gadhia/32/2638_2.png) [@amit\_gadhia](https://discuss.konghq.com/u/amit_gadhia)\
**Post date:** [March 16, 2021, 11:45am UTC](https://discuss.konghq.com/t/404-error-while-creating-kongconsumer-using-kubernetes-api-with-python/8038/3 "2021-03-16T11:45:54Z")

</div>

Thankyou For you response.  
Much appreciated

---

<div class="post-metadata">

**Author:** ![Balaji\_SA](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/balaji_sa/32/3493_2.png) [@Balaji\_SA](https://discuss.konghq.com/u/Balaji_SA)\
**Post date:** [June 22, 2022, 1:03pm UTC](https://discuss.konghq.com/t/404-error-while-creating-kongconsumer-using-kubernetes-api-with-python/8038/4 "2022-06-22T13:03:23Z")

</div>

if you inspect the create\_namespaced\_custom\_object function , it will be making a http post call to the api endpoint /apis/group\_name/version/plurals which is not a path in the api server.
