1.

How to forward port `8080 (container) -> 8080 (service) -> 8080 (ingress) -> 80 (browser)` how is it done?

Answer»

The ingress is exposing PORT 80 EXTERNALLY for the browser to access, and connecting to a service that listens on 8080. The ingress will listen on port 80 by default. An "ingress controller" is a pod that receives external TRAFFIC and HANDLES the ingress  and is configured by an ingress resource For this you need to configure ingress selector and if no 'ingress controller selector' is specified then no ingress controller will CONTROL the ingress.

simple ingress Config will look like

  • host: abc.org
  • http:
  • paths:
  • backend:
  • serviceName: abc-service
  • servicePort: 8080
  • Then the service will look like
  • kind: Service
  • apiVersion: v1
  • metadata:
  • name: abc-service
  • spec:
  • ports:
  • protocol: TCP
  • port: 8080 # this is the port the service listens on
  • targetPort: 8080


Discussion

No Comment Found

Related InterviewSolutions