Ingress configuration for k8s in different namespaces

后端 未结 3 883
刺人心
刺人心 2020-12-15 07:22

I need to configure Ingress Nginx on azure k8s, and my question is if is possible to have ingress configured in one namespace et. ingress-nginx and some serivces in other na

3条回答
  •  无人及你
    2020-12-15 08:20

    I would like to simplify the answer a bit further for those who are reletively new to Kubernetes and its ingress options in particular. There are 2 separate things that need to be present for ingress to work:

    1. Ingress Controller(essentially a separate Pod/Deployment along with a Service that can be used to utilize routing and proxying. Based on nginx container for example);
    2. Ingress rules(a separate Kubernetes resourse with kind: Ingress. Will only take effect if Ingress Controller is already deployed)

    Now, Ingress Controller can be deployed in any namespace and is, in fact, usually deployed in a namespace separate from your app services. It can out-of-the-box see Ingress rules in all namespaces in the cluster and will pick them up.
    The Ingress rules, however, must reside in the namespace where the app that they configure reside.

    There are some workarounds for that, but this is the most common approach.

提交回复
热议问题