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

kubeadm init --config is broken #345

Closed
mattmoyer opened this issue Jul 13, 2017 · 8 comments · Fixed by kubernetes/kubernetes#48915
Closed

kubeadm init --config is broken #345

mattmoyer opened this issue Jul 13, 2017 · 8 comments · Fixed by kubernetes/kubernetes#48915
Milestone

Comments

@mattmoyer
Copy link

mattmoyer commented Jul 13, 2017

Is this a BUG REPORT or FEATURE REQUEST?

BUG REPORT

Versions

kubeadm version (use kubeadm version):

kubeadm version: &version.Info{Major:"1", Minor:"8+", GitVersion:"v1.8.0-alpha.1.1104+f5757bce5b2eb1", GitCommit:"f5757bce5b2eb123aa0c2f513f65d3ce7b8ace7f", GitTreeState:"clean", BuildDate:"2017-07-13T23:28:21Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Kubernetes version (use kubectl version): v1.7.0

What happened?

I ran kubeadm init --config /path/to/my/config.yaml (with no additional arguments) and got this output:

[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
[init] Using Kubernetes version: v1.7.0
[init] Using Authorization mode: [Node RBAC]
[init] WARNING: For cloudprovider integrations to work --cloud-provider must be set for all kubelets in the cluster.
	(/etc/systemd/system/kubelet.service.d/10-kubeadm.conf should be edited for this purpose)
[preflight] Running pre-flight checks
[preflight] Starting the kubelet service
can not mix '--config' with other arguments

What you expected to happen?

I expected kubeadm to load my YAML configuration. The can not mix '--config' with other arguments error should only occur if other flags are also passed.

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

  1. Save this to minimal.yaml:
---
apiVersion: kubeadm.k8s.io/v1alpha1
kind: MasterConfiguration
  1. Run kubeadm init --config minimal.yaml

Anything else we need to know?

This was introduced in kubernetes/kubernetes#43558 (13 days ago). That change was also cherry picked into the release-1.7 branch, so we need to be careful to avoid releasing a regression on 1.7.

I'm working on a fix for this.

cc @luxas (Slack discussion from earlier today)

k8s-github-robot pushed a commit to kubernetes/kubernetes that referenced this issue Jul 14, 2017
Automatic merge from submit-queue

kubeadm: fix broken `kubeadm init --config` flag

**What this PR does / why we need it**:
This code was changed in ea19649 (#43558) to validate that `--config` wasn't passed along with other flags. Unfortunately, the implementation was checking `PersistentFlags()`, which was not parsed at the point it was being validated.

The fix is to use `Flags()` instead, which contains the expected data.


**Which issue this PR fixes** fixes kubernetes/kubeadm#345

**Special notes for your reviewer**:
This is a regression that was cherry picked (#48577) into the `release-1.7` branch. We should fix this before the next 1.7 point release.

This is awkward to unit test without restructuring the code. I think this command parsing code would be a good candidate for some higher level tests.

**Release note**:
```release-note
Fix a regression that broke the `--config` flag for `kubeadm init`.
```

/assign @luxas
@luxas
Copy link
Member

luxas commented Jul 14, 2017

Merged to master and cherrypick is approved. Thanks!

@luxas luxas closed this as completed Jul 14, 2017
@jujes
Copy link

jujes commented Jul 15, 2017

@luxas

do you tell me how install previous version on ubuntu???
apt-get install -y kubelet=1.7.0 kubeadm=1.7.0

same issue

root@kube1:~/up/dot# kubeadm init --config ~/up/dot/master-configuration.yml                                                                                                                     
[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.            
[init] Using Kubernetes version: v1.7.1         
[init] Using Authorization modes: [Node RBAC]   
[preflight] Running pre-flight checks           
can not mix '--config' with other arguments  

@jujes
Copy link

jujes commented Jul 17, 2017

@luxas @mattmoyer @caesarxuchao I tried compiling but get this error:
install steps

	sudo su
	apt-get install software-properties-common build-essential
	add-apt-repository ppa:longsleep/golang-backports
	apt-get update
	apt-get install golang-go
	wget https://github.com/kubernetes/kubernetes/archive/v1.7.0.tar.gz
	tar -xzvf v1.7.0.tar.gz && cd kubernetes-1.7.0
	make
        ...... after the error.:
        rm -rf .make/
        make clean

Error

    cmd/gke-certificates-controller                                                                                                                                                              
# k8s.io/kubernetes/cmd/kubelet                                                                                                                                                                  
/usr/lib/go-1.8/pkg/tool/linux_amd64/link: running gcc failed: fork/exec /usr/bin/gcc: cannot allocate memory                                                                                    
                                                                                                                                                                                                 
# k8s.io/kubernetes/federation/cmd/kubefed                                                                                                                                                       
/usr/lib/go-1.8/pkg/tool/linux_amd64/link: running gcc failed: fork/exec /usr/bin/gcc: cannot allocate memory                                                                                    
                                                                                                                                                                                                 
# k8s.io/kubernetes/cmd/gendocs                                                                                                                                                                  
fatal error: runtime: out of memory                                                                                                                                                              
                                                                                                                                                                                                 
runtime stack:  

@mattmoyer
Copy link
Author

@jujes sorry to hear that. It looks like you need more available memory on your build machine.

The fix for this bug should be backported to the next 1.7 point release (1.7.2) sometime soon. Unfortunately, I don't know exactly when that will be available. The PR to watch is kubernetes/kubernetes#48946.

@luxas
Copy link
Member

luxas commented Jul 17, 2017

@mattmoyer Planned sometime this week, depending on test health

@jujes
Copy link

jujes commented Jul 17, 2017

hi @mattmoyer thanks for reply my issue

until sometime soon and from the last 4 days I spend a lot of time trying to work with kubeadm, I think kubeadm is vital piece for beginners like me, following this idea, I sugest offer an clear guide for use stable version or a way to change it for a previus working version...

I need pass etcd: endpoints: into --config file.yaml what is only possible using this file, no way under flag definitions?? @luxas @caesarxuchao

thanks in advance,

@luxas luxas added this to the v1.7 milestone Jul 17, 2017
@jbw976
Copy link

jbw976 commented Jul 18, 2017

I'm working around this issue on Ubuntu by manually installing kubeadm version 1.7.0:

apt-get install kubeadm=1.7.0-00

@luxas note this bug breaks your kubeadm-workshop script: https://github.com/luxas/kubeadm-workshop/blob/master/e2e-script.sh#L1

@luxas
Copy link
Member

luxas commented Jul 18, 2017

@jbw976 I know. Fix is in for v1.7.2 which is coming tomorrow

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

Successfully merging a pull request may close this issue.

4 participants