Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoadBalancer should be defined as a label, not a ReplicaSet. #29

Open
siloneco opened this issue Jan 13, 2023 · 0 comments
Open

LoadBalancer should be defined as a label, not a ReplicaSet. #29

siloneco opened this issue Jan 13, 2023 · 0 comments

Comments

@siloneco
Copy link
Contributor

In the current Kuvel, ReplicaSet is regarded as a LoadBalancer, and load balance is performed to the pods under it. This is inconvenient when you want to load balance across ReplicaSet. In addition, due to the specification of k8s, when ReplicaSet is created under Deployment or StatefulSet, the label of ReplicaSet inherits the label of the Pod, so it is difficult to set that the label is given only to ReplicaSet and not to Pod. This makes the configuration of LoadBalancer difficult.

From 3.0.0, I would like to solve this problem and set up LoadBalancer by Pod's label. The name of the load balancer will be defined as the label value, and players will be load balanced to all pods with the same label value. Due to this change, pods with LoadBalancer specified will always specify a number after preferred-server-name. For example, pods that were previously registered as test-server when replica was 1 will now be registered as test-server-1.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: test-deployment
  namespace: minecraft
spec:
  selector:
    matchLabels:
      app: test
  template:
    metadata:
      labels:
        app: test
        kuvel.azisaba.net/enable-server-discovery: "true"
        kuvel.azisaba.net/preferred-server-name: "test-server" # will be registered as `test-server-1`
        kuvel.azisaba.net/load-balancer: "test-server"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant