Kubernetes architecture

5/7/2019

Is it possible to simplify this chain that runs on bare metal:

  1. StatefulSet with replicas count that will change over the time
  2. Service
  3. Nginx-ingress with proxy-next-upstream: "error http_502 timeout invalid_header non_idempotent"
  4. Pod with Nginx for caching and many other things that ingress can't do
  5. Service type: LoadBalancer
  6. MetalLB

Is it possible to simplify this stack?

-- Jonas
kubernetes

1 Answer

5/7/2019

Yes if you turn nginx into sidecar (deploy in every pod) + remove ingress. Cache is not shared in this case:

  1. StatefulSet with replicas count that will change over the time
  2. Sidecar (means in every replica) with nginx for caching and many other things that ingress can't do, including the ingress settings you used. Proxy pass to localhost in this case.
  3. Service: LoadBalancer
  4. MetalLB

Or if you need a common cache - just throw away the ingress:

  1. StatefulSet
  2. ServiceA (pointing to StatefulSet): ClusterIP
  3. nginx with caching and hacks. Proxy pass to ServiceA.namespace.svc.cluster.local
  4. ServiceB (pointing to nginx deployment): LoadBalancer
  5. MetalLB
-- Max Lobur
Source: StackOverflow