Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
115 views
in Technique[技术] by (71.8m points)

Moving a kubernetes service from Loadbalancer to Ingress

Currently, we are using a loadbalancer type srevice for routing external requests to one of our pods.

We would like to move this to an ingress type service ( there is already an external load balancer setup along with an ingress controller - and we do have other pods configured to receive external requests via this ingress controller)

What we have now is the below url, used by the clients to connect externally:

ws://streamevents.app.com:7080/stomp
wss://streamevents.app.com:7443/stomp

We would like to move it to

ws://streameventsv2.app.com/stomp
wss://streameventsv2.app.com/stomp

This way, we can free up the loadbalancer IP and do not need specific ports. We do want to support both url's together for a while - since clients are already connecting to the old one. How could we achieve this?

Options I can think of (we use helm):

  • Create a separate chart and deployment with the Ingress service - the old one still uses the LoadBalancer
  • Same chart - expose the service both ways (is this really possible?)
  • Change the current one to Ingress - and somehow also make sure we route requests to the old url to the new ingress (how?)

Or any other possible approaches?

question from:https://stackoverflow.com/questions/65857581/moving-a-kubernetes-service-from-loadbalancer-to-ingress

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I'm guessing you own the helm chart and hence you can make changes to it. If so, you can expose your service both using Ingress and LoadBalancer service. You don't need any changes in any other resources in the helm chart other than adding an Ingress resource. You can remove the LoadBalancer object when you can stop supporting it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...