Kubernetes Igress controller not redirecting to the application

0 votes
I Have an application which is running on apache inside a kubernetes cluster

Application is running on port 8080 on apache and context is /tascaty_dev.

Below is the config file for the apache which is running inside the container :

Listen 8080

<VirtualHost *:8080>

        WSGIDaemonProcess tascaty_dev python-path=/usr/local/lib/python3.8/dist-packages

        <Location /tascaty_dev>

                WSGIProcessGroup tascaty_dev

                WSGIApplicationGroup %{GLOBAL}

        </Location>

        WSGIScriptAlias /tascaty_dev /usr/local/lib/python3.8/dist-packages/tascaty_project/wsgi.py

        <Directory /usr/local/lib/python3.8/dist-packages/tascaty_project/>

                <Files wsgi.py>

                        Require all granted

        </Files>

        </Directory>

        Alias /static /usr/local/lib/python3.8/dist-packages/static

        <Directory /usr/local/lib/python3.8/dist-packages/static>

                Require all granted

        </Directory>

</VirtualHost>

The pod is also exposed using a cluster ip service on port 8080

vagrant@kubemaster:~/apps/tascaty$ kubectl get pods -n tascaty
NAME                                     READY   STATUS    RESTARTS   AGE
tascatyk8s-deployment-865b5865dd-qb6zc   1/1     Running   0          15m
vagrant@kubemaster:~/apps/tascaty$ kubectl get services -n tascaty
NAME                            TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
tascatyk8s-cluster-ip-service   ClusterIP   10.100.133.242   <none>        8080/TCP         2d

i have installed the ingress container using the bleow

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.34.1/deploy/static/provider/baremetal/deploy.yaml

Below is my ingress resource definition file

apiVersion: networking.k8s.io/v1beta1

kind: Ingress

metadata:

  name: tascatyk8s-deployment-ingress

  namespace: tascaty

  annotations:

    kubernetes.io/ingress.class: nginx

    nginx.ingress.kubernetes.io/rewrite-target: /

spec:

  rules:

  - http:

      paths:

      - path: /tascaty_dev

        backend:

          serviceName: tascatyk8s-cluster-ip-service

          servicePort: 8080

when try to access the application using the nginx ingress node port : https://192.168.56.2:31150/tascaty_dev/ i get the apache home page instead of login screen of my application:
Aug 22, 2020 in Kubernetes by Abdul
• 120 points
596 views

1 answer to this question.

0 votes

Hi@Abdul,

I think there is nothing wrong with your steps. Just check the home directory of your Nginx docker image and the file name. By default, your webserver will take an index file. It contains the apache home page. So after the IP address give the file name in your browser. It will work.

answered Aug 24, 2020 by MD
• 95,460 points

Related Questions In Kubernetes

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
• 52,360 points
2,082 views
0 votes
1 answer

Not able to access the kubernetes dashboard

Have you executed this proxy command? kubectl proxy Try ...READ MORE

answered Oct 8, 2018 in Kubernetes by Kalgi
• 52,360 points
1,541 views
+5 votes
2 answers

Redirecting host to service path in kubernetes

What you are trying to do is ...READ MORE

answered Mar 27, 2018 in Kubernetes by DragonLord999
• 8,450 points
3,525 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
• 52,360 points
986 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

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

answered Jan 17, 2019 in Others by anonymous
15,321 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,360 points

reshown Apr 12, 2019 by Kalgi 6,941 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP