Score:0

How to redirect the port in ingress?

cn flag

In that ingress section of AKS, we can add routes to multiple application but all having container port as 80 only. With Ingress, our application is using port 8080. But with ingress, even if I keep servicePort as 8080, it is not working.

Like, adding routes to multiple apps with different ports for their service.

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: nginxapp1-ingress-service
spec:  
  rules:
  - http:
      paths:
      - path: /
        backend:
          serviceName: testing
          servicePort: 8080
Wytrzymały Wiktor avatar
it flag
Hello @SaraJune. Could you please add some information? - Which ingress controller are you using, spec of your pod/deployment, service.
Sara June avatar
cn flag
azure default one. I got reference from this https://github.com/stacksimplify/azure-aks-kubernetes-masterclass/tree/master/09-Ingress-Basic
Andrew Skorkin avatar
tr flag
As I can see from [01-NginxApp1-Deployment.yml](https://github.com/stacksimplify/azure-aks-kubernetes-masterclass/blob/master/09-Ingress-Basic/kube-manifests/01-NginxApp1-Deployment.yml) and [02-NginxApp1-ClusterIP-Service.yml](https://github.com/stacksimplify/azure-aks-kubernetes-masterclass/blob/master/09-Ingress-Basic/kube-manifests/02-NginxApp1-ClusterIP-Service.yml) files, port: 80. Did you change it for your pod and service to 8080, since you try to use servicePort: 8080 in your Ingress?
Sara June avatar
cn flag
Yeah I have done that, but still same issue. The container is 80, And the service I kept to 8080 with containerport 80
Andrew Skorkin avatar
tr flag
Sorry for delay. Have you solved this problem?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.