0

For the setup details:

  • Kubernetes Cluster (1 Master with ip .222 - 2 Nodes) in a VMWare environment
  • Installed Ingress Controller, sample app from NGINXINC REPO

Problem & Question:

  • Unable to access the application from outside the Kubernetes Cluster
  • What do i miss ?

Configuration:

kubectl get svc

output

 NAME         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
coffee-svc   ClusterIP   10.109.97.144   <none>        80/TCP    60m

A Curl from inside the Master ( with ip .222)

curl http://10.109.97.144/coffee

output

Server address: 10.36.0.5:80
Server name: coffee-bbd45c6-82w6t
Date: 08/May/2019:09:09:29 +0000
URI: /coffee
Request ID: a9602071f75126323a48efeb3552bb55

the ingress

kubectl get ingress

NAME           HOSTS                   ADDRESS   PORTS     AGE
cafe-ingress   test.me.at                        80, 443   62m
  • Goal: Access the service from a different machine from the browser:

ps: I also tried a curl with

curl http://test.me.at/coffee 

output

Failed connect to test.me.at:80; Connection refused

Add1: kubectl -n nginx-ingress get svc

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) default-http-backend ClusterIP 10.111.28.170 <none> 80/TCP nginx-ingress NodePort 10.101.248.204 <none> 80:31080/TCP, 443:31443/TCP

Mchoeti
  • 536
  • 1
  • 8
  • 24
  • can you paste output of "kubectl -n nginx-ingress get svc" ? – Vasili Angapov May 08 '19 at 14:23
  • Ensure that the service fronting your ingress controller is exposed outside the cluster on the ports you expect to access your services from. – frankgreco May 08 '19 at 17:43
  • @VasilyAngapov this is the output NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) default-http-backend ClusterIP 10.111.28.170 80/TCP nginx-ingress NodePort 10.101.248.204 80:31080/TCP,443:31443/TCP – Mchoeti May 08 '19 at 18:53

1 Answers1

0

you should use NodePort to expose the service. If you use ClusterIp you can not curl from other machine

yasin lachini
  • 5,188
  • 6
  • 33
  • 56