From a15d6ebed95cdf990991dcf7f8e055afd72ed991 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Wed, 13 Mar 2019 01:56:38 +0200 Subject: [PATCH] kubeadm-troubleshooting: add entry about multi-valued args (#12937) Add TS entry about the case where it's not possible to pass multi-valued arguments to --component-name-extra-args flags from the command line. --- .../independent/troubleshooting-kubeadm.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/content/en/docs/setup/independent/troubleshooting-kubeadm.md b/content/en/docs/setup/independent/troubleshooting-kubeadm.md index edc0f2e9ef..359ce55b74 100644 --- a/content/en/docs/setup/independent/troubleshooting-kubeadm.md +++ b/content/en/docs/setup/independent/troubleshooting-kubeadm.md @@ -261,4 +261,23 @@ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/dock yum install docker-ce-18.06.1.ce-3.el7.x86_64 ``` +## Not possible to pass a comma separated list of values to arguments inside a `--component-extra-args` flag + +`kubeadm init` flags such as `--component-extra-args` allow you to pass custom arguments to a control-plane +component like the kube-apiserver. However, this mechanism is limited due to the underlying type used for parsing +the values (`mapStringString`). + +If you decide to pass an argument that supports multiple, comma-separated values such as +`--apiserver-extra-args "enable-admission-plugins=LimitRanger,NamespaceExists"` this flag will fail with +`flag: malformed pair, expect string=string`. This happens because the list of arguments for +`--apiserver-extra-args` expects `key=value` pairs and in this case `NamespacesExists` is considered +as a key that is missing a value. + +Alternativelly, you can try separating the `key=value` pairs like so: +`--apiserver-extra-args "enable-admission-plugins=LimitRanger,enable-admission-plugins=NamespaceExists"` +but this will result in the key `enable-admission-plugins` only having the value of `NamespaceExists`. + +A known workaround is to use the kubeadm +[configuration file](https://kubernetes.io/docs/setup/independent/control-plane-flags/#apiserver-flags). + {{% /capture %}}