Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Add flag to pass cluster CIDR to bootkube render #236

Closed
dhawal55 opened this issue Dec 15, 2016 · 5 comments
Closed

Add flag to pass cluster CIDR to bootkube render #236

dhawal55 opened this issue Dec 15, 2016 · 5 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/P1

Comments

@dhawal55
Copy link
Contributor

dhawal55 commented Dec 15, 2016

When I run bootkube to render assets, it assumes service-cluster-ip-range to be 10.3.0.0/24 and allocates etcd clusterIP and kube-dns clusterIP from that range. Make this as a parameter that can be passed to bootkube render.

Why does kube-proxy daemonset need to pass --cluster-cidr to hyperkube proxy image? Documentation says "It is used to bridge traffic coming from outside of the cluster". How does it work when using flanneld (its value is same as that set in etcd for /coreos.com/network/config Network value) and can this be made a parameter too so if not passed, it will not be set?

@aaronlevy
Copy link
Contributor

The --cluster-cidr is so that the proxy can properly setup iptables MASQUERADE rules for the pod network (cluster cidr is for the pod-network, where service-cluster-ip-range is for the service IPs)

@dhawal55
Copy link
Contributor Author

dhawal55 commented Jan 3, 2017

@aaronlevy thanks for clarifying this.

@aaronlevy
Copy link
Contributor

From an offline discussion I wanted to track some of the plans for this:

The first step is going to be to change bootkube start to try and introspect the expected pod/service cidrs by directly reading the rendered control-plane templates. Assuming all assets have been rendered correctly, the internal bootkube control-plane will just use these same values (which protects us from having to make sure bootkube render and bootkube start both use the same flags -- which could lead to problems if you happen to use the wrong flags with existing assets).

Initially this just means that render will still output the same default values, but start will get those values from the rendered templates, rather than being hard-coded. @dghubble is going to start working on this soon.

The next step would be to update bootkube render to support custom pod/service CIDRs - and properly rendering those options into all affected components (apiserver, controller-manager, proxy, kubelet, dns, etc.) - then once that step is done, bootkube will just use those updated values.

As a note, some of the other options discussed:

The issue with this approach is that it makes TLS bootstrapping difficult. The kubelet would start, then wait to be able to contact an api-server - but that api-server is a static pod waiting to be started by the kubelet. This would mean we would either need to do a 2 step process with the kubelet (let it start static pods, then kill it and let it start normally to do TLS bootstrap) - or mimic the TLS bootstrap functionality in bootkube itself. This seemed like a lot of new complexity which we don't need to immediately solve.

  • Another option discussed was generating a config file which would be used by both render and start. This essentially would mean doing something like bootkube init, which would generate a config with default values. A user could then change those values, run bootkube render to generate all assets, then also run bootkube start which would use the same config file (so all state could be persisted between commands). This also seemed overly complex initially, even though we may want something like this in the future (similar discussed more in: Provide a generic mechanism for flag customizations #106)

/cc @sym3try @Quentin-M

@Quentin-M Quentin-M reopened this Feb 14, 2017
@aaronlevy aaronlevy added kind/feature Categorizes issue or PR as related to a new feature. priority/P1 labels Feb 14, 2017
@aaronlevy
Copy link
Contributor

This should be closed by: #318

@dhawal55
Copy link
Contributor Author

This is awesome!! Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/P1
Projects
None yet
Development

No branches or pull requests

3 participants