-
Notifications
You must be signed in to change notification settings - Fork 735
Description
The current implementation of extraArgs in the ControlPlaneComponent is backed by a map[string]string type and this leads to some problems we're currently facing. For example the api-server allows some arguments multiple times (--service-account-key-file and --tls-sni-cert-key). We can't handle this with the extraArgs type as it is a map which of course does not allow the same key twice and thus overrides previous declarations.
Example:
---
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
kubernetesVersion: 1.14.2
apiServer:
extraArgs:
"tls-sni-cert-key": "/etc/kubernetes/pki/apiserver.crt,/etc/kubernetes/pki/apiserver.key"
"tls-sni-cert-key": "/etc/kubernetes/pki/mycert.crt,/etc/kubernetes/pki/mykey.key" # overrides the previous declaration(This is probably also a problem for other control plane components but I haven't checked that.)
Our current approach to solve this, is to "patch" the api-server manifest after the initial setup with kubeadm is complete (ansible playbook). This works quite well as a workaround, but I think kubeadm should allow us to solve this without the need to touch the generated kube-apiserver manifest.
Originally posted by @ghouscht in #1439 (comment)
EDIT by neolit123
-
implemented in this PR for v1beta4
kubeadm add support for structured ExtraArgs kubernetes#119156 -
optimize argument.go logic
kubeadm: Optimize the logic to override the arguments kubernetes#121020 -
TODO
the same problem happens for CLI flags:
kubeadm init phase for apiserver does not accept multi valued flag in extra-args #1413
see the discussion there.