# Kong Ingress Set Service Port to something other than 80

**URL:** <https://discuss.konghq.com/t/kong-ingress-set-service-port-to-something-other-than-80/5548>\
**Category:** Questions\
**Tags:** kubernetes\
**Created:** [February 14, 2020, 7:39pm UTC](https://discuss.konghq.com/t/kong-ingress-set-service-port-to-something-other-than-80/5548 "2020-02-14T19:39:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jett\_Anderson](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/jett_anderson/32/1719_2.png) [@Jett\_Anderson](https://discuss.konghq.com/u/Jett_Anderson)\
**Post date:** [February 14, 2020, 7:39pm UTC](https://discuss.konghq.com/t/kong-ingress-set-service-port-to-something-other-than-80/5548/1 "2020-02-14T19:39:33Z")

</div>

I’m trying to use Kong custom resources, like the KongIngress resource, to send information on a post to a webhook directly onto a RabbitMQ exchange. I’m using a custom kong plugin to accomplish this, and everything works fine in a local docker-compose environment, but when I deploy to kubernetes, the plugin registers that it’s sending an amqp request to rabbitmq.default.5672.svc:80. My rabbit service uses port 5672 and the kube service name on the Ingress is rabbitmq, but I want the port to be 5672, not 80. Is there a way to do this? In my local environment I was able to use dbless declarative config in kong to create a kong service with a url of localhost:5672 and it was able to connect to Rabbit, but I suspect the port 80 thing in kubernetes is messing with the ability to connect to Rabbit.

EDIT: If it helps, the custom plugin is showing that kong.router.get\_service().host is rabbitmq.default.5672.svc, and kong.router.get\_service().port is 80, which I don’t understand.

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [February 15, 2020, 12:06am UTC](https://discuss.konghq.com/t/kong-ingress-set-service-port-to-something-other-than-80/5548/2 "2020-02-15T00:06:20Z")

</div>

You can safely that. We have been meaning to fix it but it is a low priority issue. It throws a lot of users off.

The port to be used is present in the `targets` because Kong is also doing loadbalancing in case of being an Ingress Controller.

---

<div class="post-metadata">

**Author:** ![Jett\_Anderson](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/jett_anderson/32/1719_2.png) [@Jett\_Anderson](https://discuss.konghq.com/u/Jett_Anderson)\
**Post date:** [February 18, 2020, 4:07pm UTC](https://discuss.konghq.com/t/kong-ingress-set-service-port-to-something-other-than-80/5548/3 "2020-02-18T16:07:03Z")

</div>

The `targets`, is this something I can set in a kong configuration or a kubernetes ingress resource? Or will I just have to find another way around the plugin?

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [February 18, 2020, 4:55pm UTC](https://discuss.konghq.com/t/kong-ingress-set-service-port-to-something-other-than-80/5548/4 "2020-02-18T16:55:23Z")

</div>

> The `targets` , is this something I can set in a kong configuration or a kubernetes ingress resource?

No.

What is it you are trying to do?

---

<div class="post-metadata">

**Author:** ![Jett\_Anderson](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/jett_anderson/32/1719_2.png) [@Jett\_Anderson](https://discuss.konghq.com/u/Jett_Anderson)\
**Post date:** [February 18, 2020, 5:51pm UTC](https://discuss.konghq.com/t/kong-ingress-set-service-port-to-something-other-than-80/5548/5 "2020-02-18T17:51:54Z")

</div>

I am trying to get json data hitting an endpoint, say on [example.com/api/v1](http://example.com/api/v1), and route that data via a custom plugin to communicate that json POSTed data via AMQP to a rabbitmq service on port 5672, in kubernetes. I have kong configured with the custom plugin and working locally using kong’s declarative config to make the Kong service url be localhost:5672. I have the KongIngress resource with the Ingress resource pointing to a backend rabbitmq service with a service port of 5672, which ends up through kube getting a host name of rabbitmq.default.5672.svc, and a port number of 80. I need a way to send the data to 5672, not 80, because the plugin is failing to connect to the backend service with that hostname and port combo.

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [February 18, 2020, 11:38pm UTC](https://discuss.konghq.com/t/kong-ingress-set-service-port-to-something-other-than-80/5548/6 "2020-02-18T23:38:15Z")

</div>

Can you supply the port and host information as part of the plugin configuration?
