I used the guide to set up Kong on my Kubernetes cluster running on Docker Desktop. I have a Kubernetes Service named quick-links-service
which is exposed on port 3000
. I created an Ingress resource for this Service with the path value set to /quick-links
, using the Kong Ingress controller. Additionally, I added a corresponding Service and Route for quick-links-service
using the Kong Dashboard.
However, when I try to access http://localhost/quick-links
, I receive a "502 - Bad Gateway" error message with the following response:
{
"message": "An invalid response was received from the upstream server"
}
quick-links-service.yaml
apiVersion: v1
kind: Service
metadata:
name: quick-links-service
spec:
selector:
app: quick-links
ports:
- name: quick-links
protocol: TCP
port: 3000
targetPort: 3000
type: ClusterIP
quick-links-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: quick-links-ingress
annotations:
kubernetes.io/ingress.class: kong
spec:
rules:
- http:
paths:
- path: /quick-links
pathType: Prefix
backend:
service:
name: quick-links-service
port:
name: quick-links