LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Containers
User Name
Password
Linux - Containers This forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.

Notices


Reply
  Search this Thread
Old 01-27-2021, 07:18 AM   #1
hesisaboury
Member
 
Registered: Dec 2010
Location: iran
Posts: 199

Rep: Reputation: 0
container scaling and load balancing traffic


Hi,
For one container everything is clear (connect to kafka or other services), but now I scale it up to 5 containers, here is my question, how traffic is load balancing between containers ?

THX
 
Old 01-28-2021, 01:55 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 6,101

Rep: Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894
There are many container technologies, and many container load balancing technologies. You need to provide some information about your configuration. For example, are you using Linux Containers? Docker? Virtuozzo? Proxmox? Kubernetes? Mesos? Docker Swarm?

A few other question you may want to address: How is the application implemented? How do you scale up? What does "load" mean in the context of your application?
 
Old 01-29-2021, 11:47 AM   #3
hesisaboury
Member
 
Registered: Dec 2010
Location: iran
Posts: 199

Original Poster
Rep: Reputation: 0
I'm using kubernetes ( service ) , there are multiple endpoints
 
Old 01-29-2021, 04:59 PM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 6,101

Rep: Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894
How do you scale up? Can you share the manifests?
 
Old 01-30-2021, 01:37 PM   #5
hesisaboury
Member
 
Registered: Dec 2010
Location: iran
Posts: 199

Original Poster
Rep: Reputation: 0
I used HPA , like this
kubectl autoscale deployment bserver --cpu-percent=50 --min=1 --max=10

and it works, under the stress, here I wanted to know how the Kube balance traffic among the new containers, and is there any other approach for load balancing?

Last edited by hesisaboury; 01-30-2021 at 01:47 PM.
 
Old 01-30-2021, 08:57 PM   #6
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 6,101

Rep: Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894
The autoscaler and the deployment abstraction don't balance load. You need a service to do that, or implement your own load balancing.
 
Old 01-31-2021, 02:44 AM   #7
hesisaboury
Member
 
Registered: Dec 2010
Location: iran
Posts: 199

Original Poster
Rep: Reputation: 0
I'm using service, plus autoscaling. I defined a service for one of my microservices and I wanted in case of high load, it scales up to 5. so others still see that microservice through that service I defined, my question is : how traffic is load balancing among those 5 containers? and is there any other way to change it.

I'm not sure, but it seems kube-proxy is load balancing among containers (L4 round robin ) and also there is no way to change it

Last edited by hesisaboury; 01-31-2021 at 03:13 AM.
 
Old 01-31-2021, 09:27 PM   #8
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 6,101

Rep: Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894
Which type is the service?
 
Old 02-02-2021, 04:00 AM   #9
hesisaboury
Member
 
Registered: Dec 2010
Location: iran
Posts: 199

Original Poster
Rep: Reputation: 0
It's a cluster Service, with multiple endpoints
 
Old 02-02-2021, 04:38 AM   #10
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 6,101

Rep: Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894
It's not possible to help you if you don't provide information about your setup. If, for example, the service is of type loadbalancer, it uses load balancing functionality of the cloud in which the K8s cluster is running.

You may also have defined an ingress, which also performs load balancing.
 
Old 02-12-2021, 05:33 AM   #11
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,156
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
As suggested by berndbausch you can use any nginx ingress, istio, linkerd or traefik.
Let us know if you have K8s cluster or its a minikube/microk8s
If you want to know more about Services, Load Balancing, and Networking refer https://kubernetes.io/docs/concepts/...es-networking/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need suggestion for Deploying docker/Kubernetes for auto scaling/ load balancing pix9 Linux - Virtualization and Cloud 3 11-25-2015 07:38 AM
Network traffic load balancing nicklay Linux - Server 5 04-29-2013 11:53 AM
outbound web traffic load balancing across multiple nics univaco Linux - Networking 5 01-21-2009 02:25 PM
traffic shaping and link load balancing d4rksid3 Linux - Networking 7 10-22-2008 11:34 PM
Load Balancing Traffic Between Two Switches LinuxGeek Linux - Networking 3 04-11-2006 09:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Containers

All times are GMT -5. The time now is 09:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration