-
Notifications
You must be signed in to change notification settings - Fork 715
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 phase for apiserver does not accept multi valued flag in extra-args #1413
Comments
this is a bug. we need to set NoSplit=false in the meantime the workaround and actual recommended method to handle the extra arguments is to use the kubeadm configuration file: |
@neolit123 can i take this issue? |
@RA489 is working on this |
@neolit123 Actually we need to set We can deprecate this flag and, either make the users use the config file, or introduce a new Also, what we do for this flag has to be done for the |
@rosti IIUC if we want Multiple flag invocations like --apiserver-extra-args "Arg1=Val1" --apiserver-extra-args "Arg2=Val2" then we need to set 'NoSplit=true' and when it is invoked as comma-separated key-value pairs |
@RA489 precisely. In this issue the user cannot specify an API server parameter that can take multiple comma separated values (that would be |
@rosti i see what you mean. with both true and false it would not work. this:
sets the value for plugins to
i vote for the later. |
/assign i will write a quick note about this in the Troubleshoot docs and move this item outside of 1.14 in terms of code changes. |
sent this docs PR: might as well close this eventually as adding new custom flag for this is not ideal, but for now punting to next cycle. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/lifecycle frozen |
merging this issue with: both config and CLI flags are not handled correctly in this regard. |
BUG REPORT
Versions
kubeadm version (use
kubeadm version
):kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.1", GitCommit:"eec55b9ba98609a46fee712359c7b5b365bdd920", GitTreeState:"clean", BuildDate:"2018-12-13T10:36:44Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}
Environment:
Hardware
Kubernetes version (use
kubectl version
):Cloud provider or hardware configuration:
Hardware: 1x1 cluster. 8 cpu, 16 GB memory
OS (e.g. from /etc/os-release):
NAME="CentOS Linux"
VERSION="7 (Core)"
Kernel (e.g.
uname -a
):3.10.0-693.2.2.el7.x86_64
What happened?
executing
kubeadm init phase control-plane apiserver --apiserver-extra-args "enable-admission-plugins=LimitRanger,NamespaceExists"
throwing following error.apiserver-extra-args
expects map[string]string which will be comma separated nameX=valueX pairs.however the
enable-admission-plugins
is a multi valued flag for api-server. so kubeadm errors out if the value of the flag is multi valued as shown in example above.What you expected to happen?
kubeadm init phase control-plane apiserver
flag--apiserver-extra-args
should be able to accept extra args with multi valued flag.How to reproduce it (as minimally and precisely as possible)?
Fail: execute with multi valued flag.
kubeadm init phase control-plane apiserver --apiserver-extra-args "enable-admission-plugins=LimitRanger,NamespaceExists"
Pass: execute with single valued flag.
kubeadm init phase control-plane apiserver --apiserver-extra-args "enable-admission-plugins=LimitRanger"
Anything else we need to know?
After little bit exploring the code:
The flag
--apiserver-extra-args
is instance of MapStringString (https://github.com/kubernetes/apiserver/blob/master/pkg/util/flag/map_string_string.go#L30) withNoSplit=false
which will not accept multi valued flag.The flag initialization: https://github.com/kubernetes/kubernetes/blob/release-1.13/cmd/kubeadm/app/cmd/options/generic.go#L49
Please also suggest if there is any work around until this issue is resolved.
The text was updated successfully, but these errors were encountered: