DataONEorg / k8s-cluster

Documentation on the DataONE Kubernetes cluster
Apache License 2.0
2 stars 1 forks source link

Configure ingress controller for multiple ingresses #13

Closed gothub closed 2 years ago

gothub commented 2 years ago

An NGINX ingress controller is being used to route traffic from clients to k8s services. The configuration needs to be updated to take advantage of the controller's capability of routing traffic to services running in different k8s namespaces. Currently those services (in dev k8s) are:

Also, the ingresses themselves should be managed by the developer responsible for each service.

gothub commented 2 years ago

The NGINX ingress controller (NIC) requires that an IngressClass is defined for the ingress controller. This associates the NIC with one class of ingress. When the NIC is started, it is told which class of ingress to use by using the --ingress-class=<ingress class name> argument, for example --ingress-class=nginx. The NIC will inspect ingress objects from all namespaces and use the ones that have a class name that matches the one it is using. The ingress objects are defined in the same namespace as the services that they route to, so for example, the metadig ingress is defined in the metadig namespace, where the metadig-controller service is. Note that the NIC will continue to scan for ingress objects and add them as required. A separate ingress object would be defined for gnis in the gnis namespace, and so on for other DataONE services.

Annotated versions of the NIC manifest files will be checked into the control-plane directory.

gothub commented 2 years ago

With the 6326f972bfb8988a2028a1fcc6242c8bd5d636d8 commit, the NGINX Ingress Controller installed on the prod and dev clusters now supports Ingress objects from any namespace, provided they are configured as described in the control-plane.md document.