Answers: <p><a href="https://doc.traefik.io/traefik/" rel="nofollow noreferrer">https://doc.traefik.io/traefik/</a> seems to fit your usecase.</p>
  <p>&quot; Traefik is an open-source Edge Router that makes publishing your services a fun and easy experience. It receives requests on behalf of your system and finds out which components are responsible for handling them. &quot;</p>
  
Answers: CC BY-SA 4.0
Answers: 2023-04-14T14:11:04.753Z
Answers: 2023-04-14T14:11:04.753Z
Answers: tintin
Body: <p>I am new to K8S and need help deploying multiple instances of the same app. Each instance needs to be isolated in its own namespace and must have two exposed services (backend and frontend) accessible via a unique subdomain for each instance.</p>
  <p>I want to use an Ingress Controller to redirect traffic to the appropriate services based on the subdomain. However, the problem is that the Ingress Controller cannot access other namespaces, which means it does not know about the other instances of the app.</p>
  <p>I thought about putting the Ingress Controller in the kube-system namespace, but I don't think this is a good practice.</p>
  <p>Here is an example of the NGINX Ingress Controller that I have started to use (so that you have an idea of what I want to do):</p>
  <pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1
  kind: Ingress
  metadata:
    name: ingress
    annotations:
      nginx.ingress.kubernetes.io/ingress.class: nginx
  spec:
    ingressClassName: nginx
    rules:
      - host: sub-01.my-domain.com
        http:
          paths:
            - path: /api/
              pathType: Prefix
              backend:
                service:
                  name: sub-01-backend-service
                  port:
                    number: 30000
            - path: /
              pathType: Prefix
              backend:
                service:
                  name: sub-01-frontend-service
                  port:
                    number: 80
      - host: sub-02.my-domain.com
        http:
          paths:
            - path: /api/
              pathType: Prefix
              backend:
                service:
                  name: sub-02-backend-service
                  port:
                    number: 30000
            - path: /
              pathType: Prefix
              backend:
                service:
                  name: sub-02-frontend-service
                  port:
                    number: 80
  </code></pre>
  <p>I have also heard about ISTIO, but I am not sure how it could solve my problem.</p>
  <p>If you have any ideas or suggestions for solving this problem, I am all ears.</p>
  <p>Thanks in advance for your help.</p>
  
Tags: <kubernetes><ingress><kubernetes-helm><istio><ingress-nginx>
Title: K8S: How to manage incoming traffic for multiple instances of the same app with isolated namespaces and unique subdomains using an Ingress Controller?
UserDisplayName: Kardier
ThreadText: # K8S: How to manage incoming traffic for multiple instances of the same app with isolated namespaces and unique subdomains using an Ingress Controller?
  
  (Asked by: username_0 on 2023-04-12)
  
  I am new to K8S and need help deploying multiple instances of the same app. Each instance needs to be isolated in its own namespace and must have two exposed services (backend and frontend) accessible via a unique subdomain for each instance.
  
  I want to use an Ingress Controller to redirect traffic to the appropriate services based on the subdomain. However, the problem is that the Ingress Controller cannot access other namespaces, which means it does not know about the other instances of the app.
  
  I thought about putting the Ingress Controller in the kube-system namespace, but I don't think this is a good practice.
  
  Here is an example of the NGINX Ingress Controller that I have started to use (so that you have an idea of what I want to do):
  
  ```yaml
  apiVersion: networking.k8s.io/v1
  kind: Ingress
  metadata:
    name: ingress
    annotations:
      nginx.ingress.kubernetes.io/ingress.class: nginx
  spec:
    ingressClassName: nginx
    rules:
      - host: sub-01.my-domain.com
        http:
          paths:
            - path: /api/
              pathType: Prefix
              backend:
                service:
                  name: sub-01-backend-service
                  port:
                    number: 30000
            - path: /
              pathType: Prefix
              backend:
                service:
                  name: sub-01-frontend-service
                  port:
                    number: 80
      - host: sub-02.my-domain.com
        http:
          paths:
            - path: /api/
              pathType: Prefix
              backend:
                service:
                  name: sub-02-backend-service
                  port:
                    number: 30000
            - path: /
              pathType: Prefix
              backend:
                service:
                  name: sub-02-frontend-service
                  port:
                    number: 80
  
  ```
  
  I have also heard about ISTIO, but I am not sure how it could solve my problem.
  
  If you have any ideas or suggestions for solving this problem, I am all ears.
  
  Thanks in advance for your help.
  
  **Tags:** kubernetes, ingress, kubernetes-helm, istio, ingress-nginx
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-04-14. Score: 0
  
  <https://doc.traefik.io/traefik/> seems to fit your usecase.
  
  " Traefik is an open-source Edge Router that makes publishing your services a fun and easy experience. It receives requests on behalf of your system and finds out which components are responsible for handling them. "
  
  
  ---
  
  