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

specifying node-cidr-mask-size as a controllerManagerExtra arg did not take precedence #724

Closed
tmjd opened this issue Mar 7, 2018 · 4 comments

Comments

@tmjd
Copy link

tmjd commented Mar 7, 2018

What keywords did you search in kubeadm issues before filing this one?

controllerManagerExtraArgs, node-cidr-mask-size

Is this a BUG REPORT or FEATURE REQUEST?

BUG REPORT

Versions

kubeadm version (use kubeadm version): v1.9.3

Environment:

  • Kubernetes version (use kubectl version): v1.9.3
  • Cloud provider or hardware configuration: VirtualBox
  • OS (e.g. from /etc/os-release):
    NAME="Container Linux by CoreOS"
    ID=coreos
    VERSION=1576.4.0
    VERSION_ID=1576.4.0
    BUILD_ID=2017-12-06-0449
    PRETTY_NAME="Container Linux by CoreOS 1576.4.0 (Ladybug)"
    ANSI_COLOR="38;5;75"
    HOME_URL="https://coreos.com/"
    BUG_REPORT_URL="https://issues.coreos.com"
    COREOS_BOARD="amd64-usr"
    
  • Kernel (e.g. uname -a): Linux k8s-master 4.13.16-coreos-r2 kubeadm join on slave node fails preflight checks #1 SMP Wed Dec 6 04:27:34 UTC 2017 x86_64 Intel(R) Xeon(R) CPU E3-1505M v5 @ 2.80GHz GenuineIntel GNU/Linux
  • Others:

What happened?

I was specifying node-cidr-mask-size in a kubeadm config file under controllerManagerExtraArgs to set the flag. kube-controller-manager was started with 2 instances of --node-cidr-mask-size being passed to it. The 2nd instance was the default that kubeadm adds and overrode the value I was attempting to set.

What you expected to happen?

kube-controller-manager should have been started with one instance of --node-cidr-mask-size or at least the one I specified would be the 2nd so that it would take precedence.

How to reproduce it (as minimally and precisely as possible)?

  1. Run kubeadm init --config=myconfig.yaml with the following as the contents of the file myconfig.yaml
apiVersion: kubeadm.k8s.io/v1alpha1
kind: MasterConfiguration
api:  
  advertiseAddress: "fd10::101"
networking:
  serviceSubnet: fd30::0/110   
  podSubnet: "fd20:0::/120"    
controllerManagerExtraArgs:
  node-cidr-mask-size: "120" 
  1. Check the flags that kube-controller-manager is started with.

Anything else we need to know?

This was an issue for me when trying to use kubeadm to setup an IPv6 cluster and specify a podSubnet.

@XANi
Copy link

XANi commented Mar 23, 2018

still present in 1.9.6.

It should really be just an option under networking key, currently it just puts --node-cidr-mask-size in config twice, at start and at end

@jstangroome
Copy link

jstangroome commented Mar 26, 2018

@tmjd I've worked around it by moving the networking.podSubnet to controllerManagerExtraArgs.cluster-cidr and adding allocate-node-cidrs too, just like the kubeadm code would have if podSubnet had been specified directly.

Modifying your original example, it becomes:

apiVersion: kubeadm.k8s.io/v1alpha1
kind: MasterConfiguration
api:  
  advertiseAddress: "fd10::101"
networking:
  serviceSubnet: fd30::0/110   
  # MOVED BELOW podSubnet: "fd20:0::/120"    
controllerManagerExtraArgs:
  allocate-node-cidrs: "true"
  cluster-cidr: "fd20:0::/120"
  node-cidr-mask-size: "120"

This workaround is essentially circumventing kubeadm's if statement here:
https://github.com/kubernetes/kubernetes/blob/86a58202b68d04b2e31b56db80b4d2a4dec77c93/cmd/kubeadm/app/phases/controlplane/manifests.go#L336-L342

I doesn't appear that kubeadm uses the podSubnet for anything else other than validation but I could be wrong.

Would still prefer to be able to override the node cidr mask size in a more supported fashion though.

jstangroome added a commit to jstangroome/kubernetes that referenced this issue Mar 29, 2018
k8s-github-robot pushed a commit to kubernetes/kubernetes that referenced this issue Apr 4, 2018
…drmasksize

Automatic merge from submit-queue (batch tested with PRs 61705, 61609, 62103, 62113, 62115). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Support overriding the --node-cidr-mask-size arg passed to kube-controller-manager

Fixes: kubernetes/kubeadm#724

**Release note**:
```release-note
kubeadm config can now override the Node CIDR Mask Size passed to kube-controller-manager.
```
@jstangroome
Copy link

@tmjd Fix should land in next kubeadm release from master.

@Hazmes
Copy link

Hazmes commented Jun 13, 2018

What is the status on this?
I am currently setting up a Kubernetes Cluster with:

kubeadm version: &version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.4", GitCommit:"5ca598b4ba5abb89bb773071ce452e33fb66339d", GitTreeState:"clean", BuildDate:"2018-06-06T08:00:59Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

The Issue is still occurring here.

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

No branches or pull requests

4 participants