kubernetes ingress not accessible

0 votes

I have a small kubernetes cluster on localhost in linux. 

 In my deployment file I defined an ingress, which should make the services, which are deployed in the cluster, accessible from the outside. Deployment.yml:

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: foo-service-deployment
spec:
  replicas: 2
  template:
    metadata:
      labels:
        app: foo-service
    spec:
      containers:
        - name: foo-service
          image: images/fooservice
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 7778
---
apiVersion: v1
kind: Service
metadata:
  name: foo-service-service
spec:
  ports:
    - port: 7778
  selector:
    app: foo-service
  type: NodePort
---    
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: api-gateway-ingress
spec:
  rules:
  - host:
    http:
      paths:
      - path: /foo
        backend:
          serviceName: foo-service-service
          servicePort: 7779
      - path: /bar
        backend:
          serviceName: bar-service-service
          servicePort: 7776

I can not access the services. kubectl describe shows the following for my ingress:

Name:           api-gateway-ingress
Namespace:      default
Address:        
Default backend:    default-http-backend:80 (<none>)
Rules:
  Host  Path    Backends
  ----  ----    --------
  * 
        /foo    foo-service-service:7779 (<none>)
        /bar    bar-service-service:7776 (<none>)
Annotations:
Events: <none>

Whats the issue?

Sep 7, 2018 in Kubernetes by lina
• 8,110 points
27 views

1 answer to this question.

0 votes

You need to set up an ingress controller for the ingress to work.

Use this documentation from the official website as guidance.

answered Sep 7, 2018 by Kalgi
• 41,990 points

Related Questions In Kubernetes

0 votes
1 answer

Pod not sharing directory - Kubernetes volume Hostpath

he issue was on the volume definition, ...READ MORE

answered Aug 28, 2018 in Kubernetes by Kalgi
• 41,990 points
299 views
0 votes
1 answer

Not able to access kubernetes api from a pod in azure

Follow these steps Add --bind-address=0.0.0.0 option to the line https://github.com/kubernetes/kubernetes/blob/v1.2.0/docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-main-nodes-template.yml#L218  Created ...READ MORE

answered Aug 30, 2018 in Kubernetes by Kalgi
• 41,990 points
76 views
0 votes
2 answers

DNS does not resolve with NGINX in Kubernetes

adding to @kalgi's answer Using just the hostname ...READ MORE

answered Aug 30, 2018 in Kubernetes by Nilesh
• 6,880 points
614 views
0 votes
1 answer

Error saying "The specified bucket does not exist" in kubernetes

Bucket is created in another region. Looks like ...READ MORE

answered Aug 31, 2018 in Kubernetes by Kalgi
• 41,990 points
430 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
2,966 views
+3 votes
1 answer
0 votes
2 answers

Not able to expose port 80 on the host, kubernetes ingress

I was facing the same error. The nginix ...READ MORE

answered Sep 11, 2018 in Kubernetes by Kalgi
• 41,990 points
86 views
0 votes
1 answer

Kubernetes Ingress not resolving backend service

I think you're trying to access the ingress ...READ MORE

answered Oct 1, 2018 in Kubernetes by Kalgi
• 41,990 points
410 views