How do I automatically add/remove nodes from NodeBalancer

Is it possible to keep the manually created NodeBalancer updated with new added/removed nodes to the Kubernetes Cluster?

I'm using nginx-ingress with clusterIp configuration

controller:
  admissionWebhooks:
    enabled: false
    failurePolicy: Fail
    port: 8443

    service:
      annotations: {}
      ## Deprecated, instead simply do not provide a clusterIP value
      omitClusterIP: false
      # clusterIP: ""
      externalIPs: []
      loadBalancerIP: "MY_IP_HERE"
      loadBalancerSourceRanges: []
      servicePort: 443
      type: ClusterIP

    patch:
      enabled: true
      image:
        repository: jettech/kube-webhook-certgen
        tag: v1.0.0
        pullPolicy: IfNotPresent
      ## Provide a priority class name to the webhook patching job
      ##
      priorityClassName: ""
      podAnnotations: {}
      nodeSelector: {}
      resources: {}

  service:
    annotations: {}
    ## Deprecated, instead simply do not provide a clusterIP value
    omitClusterIP: false
    # clusterIP: ""

    ## List of IP addresses at which the default backend service is available
    ## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips
    ##
    externalIPs: []

    loadBalancerIP: "MY_IP_HERE"
    loadBalancerSourceRanges: []
    servicePort: 80
    type: ClusterIP

The when I add nodes manually to NodeBalancer with corresponding ports, everything works as expected

But would be great if nodes automatically would be registered/removed in NodeBalancer when I scale

2 Replies

If "scaling" is some event where you can run a program (either manually or on your behalf by some agent), I'm pretty sure you can use the Linode API for this:

https://techdocs.akamai.com/linode-api/reference/post-node-balancer-node/

-- sw

The endpoint for deleting a NodeBalancer node can now be found here:

https://techdocs.akamai.com/linode-api/reference/delete-node-balancer-config-node

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct