0

I'm using Kubernetes Ingress on GCP to route traffic to different HTTP services.

TLDR: Is there a way to control a single Ingress object by adding rules to it from multiple different spec files? We want to allow each microservice to deploy it's own routing rules but only have a single (or few) Ingress instance.

Services should be exposed under th Background: One key reason for using Kubernetes to deploy HTTP microservices is our teams can deploy each service independently and even deploy new services without changing any central configuration.

In an environment where there are many (dozens, hundreds?) of HTTP endpoints, each managed and deployed independently, routing becomes an issue; Ingress "should" solve this but we do not want to manage the routing configuration separately or centrally from the services.

shevron
  • 326
  • 2
  • 4
  • 10
  • 1
    with nginx ingress controller you can use "Mergeable Ingress Types Support" – c4f4t0r Sep 29 '19 at 20:18
  • @c4f4t0r - thanks. No way to do this with the GCP Ingress Controller? I suppose I could deploy the nginx controller but was hoping to keep things more native. – shevron Sep 30 '19 at 07:34
  • @Tranvu Xuannhat answer gives all the informations you need – c4f4t0r Sep 30 '19 at 10:25
  • Hi @shevron what do you mean by `even deploy new services without changing any central configuration` You mean without modifying ingress rules? In ingress `The maximum number of rules for a URL map is 50. This means that you can specify a maximum of 50 rules in an Ingress`. – Mark Sep 30 '19 at 13:35
  • @Hanx I mean that ingress routing rules will be modified in a decentralized manner - not in a single file that defines the Ingress object (and thus is separate from each microservice's configuration) but in a way that allows each microservice to define it's own route. – shevron Oct 02 '19 at 15:24

1 Answers1

2

There is noway to do control one single Ingress object by adding rules to it from multiple different spec files with GKE Ingress Controller now.

I would say that the GKE Ingress Controller implementation is simply to support you to create K8s Ingress resource with its utilities from the native K8s.

To do something more complex, you need to use other implementations:

  • Nginx-ingress controller's "Mergeable Ingress Types Support", like what c4f4t0r recommend.

  • Istio ingress gateway, this one I feel it is more simple than Nginx ingress controller. And you can modify your HTTP rules in each Deployment through Virtual Service

For GCP, I would consider using Istio since it is an option when you create cluster now.