Open bjethwan opened 4 years ago
See https://github.com/kubernetes/kubeadm/issues/1601 This is broken in kubeadm and should be fixed in a new api - v1beta3.
Until then, one workaround for you is to go in the kind nodes and patch the manifest manually to add the flag that kubeadm omitted.
I also noticed that extra args for etcd
do not work in v1beta2
.
A kind cluster created with the below configuration results in unsafe-no-fsync
flag not used. If I change apiVersion
to kubeadm.k8s.io/v1beta3
it works.
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
kubeadmConfigPatches:
- |
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
metadata:
name: config
etcd:
local:
extraArgs:
unsafe-no-fsync: "true"
nodes:
- role: control-plane
Is this likely related to the same issue in kubeadm?
Would it make sense to add a warning to kind docs that v1beta3
should be used for these patches?
Is this likely related to the same issue in kubeadm?
No, this is just because of the Kubernetes version, kind uses the latest available config version for kubeadm, which varies by kubernetes version
For stable fields, you can write. patch like this:
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
kubeadmConfigPatches:
- |
kind: ClusterConfiguration
metadata:
name: config
etcd:
local:
extraArgs:
unsafe-no-fsync: "true"
nodes:
- role: control-plane
(apiVersion
omitted from the patch) and kind will permit it and match based on kind: ClusterConfiguration
and patch, but using the api version would allow you to do this:
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
kubeadmConfigPatches:
- |
apiVersion: kubeadm.k8s.io/v1beta3
kind: ClusterConfiguration
metadata:
name: config
etcd:
local:
extraArgs:
unsafe-no-fsync: "true"
- |
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
metadata:
name: config
etcd:
local:
extraArgs:
unsafe-no-fsync: "true"
nodes:
- role: control-plane
(and have different results for different API levels)
EDIT: this issue is about what happens if you try to specify multiple values for a flag
Thanks a lot for that explanation @BenTheElder that makes sense! I guess then we might actually skip the apiVersion
field for configs that are meant to work for different Kubernetes versions (I realized that setting it to kubeadm.k8s.io/v1beta3
makes it work for 1.24, but not work for 1.21.. whereas without the apiVersion
the same config works for both 👍🏼 )
Sorry for hijacking an unrelated issue.
kind version kind v0.8.1 go1.14.2 darwin/amd64
Issue: Nodes stay in NotReady state indefinitely.
Kind/kubeadm missed to write "service-account-key-file", when k8s docs state that it can appear multiple times in kube-apiserver command line args.
Everything starts working when I do this step manually docker exec -it kind-control-plane bash root@kind-control-plane:/# vi /etc/kubernetes/manifests/kube-apiserver.yaml
Update this line - --service-account-key-file=/etc/kubernetes/pki/sa.pub
exit