2

I am running on Vultr public cloud with a CoreOS Kubernetes. I am working on configuring a ingress controller so I can reach my backend SpringBoot service.

I have a Spring Boot service "springboot" running on port 30123.

I have this ingress yaml from the Kubernetes documentation with modified to my service:

ingress.yaml
------------
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: test-ingress
spec:
  backend:
    serviceName: springboot
    servicePort: 31922

kubectl get ing

Name HOSTS ADDRESS PORTS AGE

test-ingress * 80 2m

curl mydns.com Connection refused.

I am not sure if I am understanding how it's supposed to work.

Can someone help?

thanks

Katlock
  • 1,200
  • 1
  • 17
  • 41
  • Did you start an Ingress Controller? The Ingress alone is not enough. It defines what service should serve what requests, but you need to run a Ingress Controller which reads that Ingress and runs a Proxy server (e.g. Nginx) which actually does the work of forwarding requests to your service. See e.g. https://github.com/kubernetes/ingress/tree/master/controllers/nginx – slintes Sep 26 '17 at 07:34
  • I have tried several of the documentations. I wonder if there was some simple example that just show an ingress rule with a ingress controller for a domain name configured. – Katlock Sep 26 '17 at 16:55
  • `servicePort: 31922` It looks like the target service is of type NodePort and it should be of type `ClusterIP`. I don't have experience with Vultr, but the idea is to have the cloud LB directed to the nginx ingress controller. When this part is working, each service is responsible for supplying it's own Ingress rules. The ingress controller is listening in all namespaces for services with certain annotations (for example `kubernetes.io/ingress.class: nginx`). When a new service starts, the ingress controller will auto-update it's internal configuration. – vdimitrov Dec 09 '17 at 23:52

1 Answers1

1

As mentioned by @slintes, did you add an IngressController ? You can add one (nginx ingress controller) easily with the command :

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/cloud/deploy.yaml

By the way in your question you're saying that you have a spring boot app on port 30123 but your ingress points to the 31922 port. Is it normal ?

Hope it helps.

Michaël COLL
  • 1,153
  • 13
  • 18