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

Pool independent IPs #52

Closed
geekflyer opened this issue May 30, 2019 · 5 comments · Fixed by #53
Closed

Pool independent IPs #52

geekflyer opened this issue May 30, 2019 · 5 comments · Fixed by #53
Assignees
Labels
enhancement New feature or request

Comments

@geekflyer
Copy link
Contributor

geekflyer commented May 30, 2019

We have a gke cluster with multiple node pools. We would like to assign static IPs to all nodes in the cluster.

Currently it seems the only way to achieve this is to reserve multiple static IPs and then exlusively pre-allocate each IP to a specific nodepool via the kubeip-node-pool=<pool_name> label.

This is kind of problematic since whenever we change the number of pools or rename pools (sometimes it's necessary to replace one pool with another in order add for example a new oauth permission etc.) we also have to update the labels of all static IPs used in that cluster.

Would it be possible to simply have a single / cluster-wide "pool of ip addresses" which is used to satisfy the static IP address needs of multiple or all node pools in a specific cluster?

I.e. imagine this:

  1. We reserve 20 static IPs and label them with kubeip: <clusterName>
  2. We create a cluster with 3 nodepools with random names, each nodepool having 5 nodes (i.e. 15 total)
  3. Kubeip auto assigns static IPs to all 15 nodes.

I'm fine still having to specify KUBEIP_NODEPOOL and KUBEIP_ADDITIONALNODEPOOLS if that's really required but it'd like to avoid "exlusively" tying a set of IPs to a single nodepool.

@avivl
Copy link
Contributor

avivl commented May 30, 2019

Pool independent IPs

@avivl avivl self-assigned this May 30, 2019
@avivl avivl added the enhancement New feature or request label May 30, 2019
avivl added a commit that referenced this issue May 30, 2019
A new variable AllNodePools was introduced. Defaults to False. Once set
to true all node pools in the cluster will be monitored  and will get an
available static ip from the pool
Fixes #52
@avivl avivl closed this as completed in #53 May 30, 2019
@avivl
Copy link
Contributor

avivl commented May 30, 2019

@geekflyer A new variable AllNodePools was introduced. Defaults to False. Once set
to true all node pools in the cluster will be monitored and will get an
available static ip from the pool

@geekflyer
Copy link
Contributor Author

geekflyer commented Jun 1, 2019

@avivl I just tried out the latest version of kubeip and unfortunately this still doesn't work.
I'm getting this error message when I'm trying to use KUBEIP_ALLNODEPOOLS: 'true':

kubeip-5c7888cfbb-7rwt5 kubeip time="2019-06-01T19:45:36Z" level=info msg="kubeip controller synced and ready" pkg=kubeip-node
kubeip-5c7888cfbb-7rwt5 kubeip time="2019-06-01T19:45:36Z" level=info msg="Found un assigned node gke-api-cluster-dev--default-pool-2d1-af3a5afd-m57f in pool%!(EXTRA string=default-pool-2d136f4)" function=processAllNodes pkg=kubeip
kubeip-5c7888cfbb-7rwt5 kubeip time="2019-06-01T19:45:36Z" level=info msg="Working on gke-api-cluster-dev--default-pool-2d1-af3a5afd-m57f in zone us-west1-b" function=Kubeip pkg=kubeip
kubeip-5c7888cfbb-7rwt5 kubeip time="2019-06-01T19:45:37Z" level=info msg="no free address found"

I think the problem lies here:

var filter string
if strings.ToLower(pool) == strings.ToLower(config.NodePool) {
filter = "(labels." + config.LabelKey + "=" + config.LabelValue + ")" + " AND (-labels." + config.LabelKey + "-node-pool:*)"
} else {
filter = "(labels." + config.LabelKey + "=" + config.LabelValue + ")" + " AND " + "(labels." + config.LabelKey + "-node-pool=" +pool + ")"
}

The logic there is still filtering for IPs which are labeled with the target pool name.

@geekflyer
Copy link
Contributor Author

created a PR #54 which should fix this

avivl added a commit that referenced this issue Jun 2, 2019
@avivl
Copy link
Contributor

avivl commented Jun 2, 2019

@geekflyer thanks good catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants