Skip to content

Commit c080701

Browse files
authoredOct 14, 2024··
Merge pull request #19790 from fbyrne/feature/19788
Adds support for kubeadm.k8s.io/v1beta4 available since k8s v1.31
2 parents c090344 + b9d2e2c commit c080701

20 files changed

+349
-133
lines changed
 

‎hack/update/kubernetes_version/templates/v1beta3/containerd-api-port.yaml renamed to ‎hack/update/kubernetes_version/templates/v1beta4/containerd-api-port.yaml

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,30 +14,36 @@ nodeRegistration:
1414
criSocket: unix:///run/containerd/containerd.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
apiServer:
2324
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2425
extraArgs:
25-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
26+
- name: "enable-admission-plugins"
27+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
2628
controllerManager:
2729
extraArgs:
28-
allocate-node-cidrs: "true"
29-
leader-elect: "false"
30+
- name: "allocate-node-cidrs"
31+
value: "true"
32+
- name: "leader-elect"
33+
value: "false"
3034
scheduler:
3135
extraArgs:
32-
leader-elect: "false"
36+
- name: "leader-elect"
37+
value: "false"
3338
certificatesDir: /var/lib/minikube/certs
3439
clusterName: mk
3540
controlPlaneEndpoint: control-plane.minikube.internal:12345
3641
etcd:
3742
local:
3843
dataDir: /var/lib/minikube/etcd
3944
extraArgs:
40-
proxy-refresh-interval: "70000"
45+
- name: "proxy-refresh-interval"
46+
value: "70000"
4147
kubernetesVersion: v1.23.0
4248
networking:
4349
dnsDomain: cluster.local

‎hack/update/kubernetes_version/templates/v1beta3/containerd-pod-network-cidr.yaml renamed to ‎hack/update/kubernetes_version/templates/v1beta4/containerd-pod-network-cidr.yaml

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,30 +14,36 @@ nodeRegistration:
1414
criSocket: unix:///run/containerd/containerd.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
apiServer:
2324
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2425
extraArgs:
25-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
26+
- name: "enable-admission-plugins"
27+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
2628
controllerManager:
2729
extraArgs:
28-
allocate-node-cidrs: "true"
29-
leader-elect: "false"
30+
- name: "allocate-node-cidrs"
31+
value: "true"
32+
- name: "leader-elect"
33+
value: "false"
3034
scheduler:
3135
extraArgs:
32-
leader-elect: "false"
36+
- name: "leader-elect"
37+
value: "false"
3338
certificatesDir: /var/lib/minikube/certs
3439
clusterName: mk
3540
controlPlaneEndpoint: control-plane.minikube.internal:8443
3641
etcd:
3742
local:
3843
dataDir: /var/lib/minikube/etcd
3944
extraArgs:
40-
proxy-refresh-interval: "70000"
45+
- name: "proxy-refresh-interval"
46+
value: "70000"
4147
kubernetesVersion: v1.23.0
4248
networking:
4349
dnsDomain: cluster.local

‎hack/update/kubernetes_version/templates/v1beta3/containerd.yaml renamed to ‎hack/update/kubernetes_version/templates/v1beta4/containerd.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,15 +14,17 @@ nodeRegistration:
1414
criSocket: unix:///run/containerd/containerd.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
apiServer:
2324
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2425
extraArgs:
25-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
26+
- name: "enable-admission-plugins"
27+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
2628
controllerManager:
2729
extraArgs:
2830
allocate-node-cidrs: "true"

‎hack/update/kubernetes_version/templates/v1beta3/crio-options-gates.yaml renamed to ‎hack/update/kubernetes_version/templates/v1beta4/crio-options-gates.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,15 +14,17 @@ nodeRegistration:
1414
criSocket: unix:///var/run/crio/crio.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
apiServer:
2324
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2425
extraArgs:
25-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
26+
- name: "enable-admission-plugins"
27+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
2628
fail-no-swap: "true"
2729
feature-gates: "a=b"
2830
controllerManager:

‎hack/update/kubernetes_version/templates/v1beta3/crio.yaml renamed to ‎hack/update/kubernetes_version/templates/v1beta4/crio.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,15 +14,17 @@ nodeRegistration:
1414
criSocket: unix:///var/run/crio/crio.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
apiServer:
2324
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2425
extraArgs:
25-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
26+
- name: "enable-admission-plugins"
27+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
2628
controllerManager:
2729
extraArgs:
2830
allocate-node-cidrs: "true"

‎hack/update/kubernetes_version/templates/v1beta3/default.yaml renamed to ‎hack/update/kubernetes_version/templates/v1beta4/default.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,15 +14,17 @@ nodeRegistration:
1414
criSocket: unix:///var/run/dockershim.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
apiServer:
2324
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2425
extraArgs:
25-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
26+
- name: "enable-admission-plugins"
27+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
2628
controllerManager:
2729
extraArgs:
2830
allocate-node-cidrs: "true"

‎hack/update/kubernetes_version/templates/v1beta3/dns.yaml renamed to ‎hack/update/kubernetes_version/templates/v1beta4/dns.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,15 +14,17 @@ nodeRegistration:
1414
criSocket: unix:///var/run/dockershim.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
apiServer:
2324
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2425
extraArgs:
25-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
26+
- name: "enable-admission-plugins"
27+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
2628
controllerManager:
2729
extraArgs:
2830
allocate-node-cidrs: "true"

‎hack/update/kubernetes_version/templates/v1beta3/image-repository.yaml renamed to ‎hack/update/kubernetes_version/templates/v1beta4/image-repository.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,16 +14,18 @@ nodeRegistration:
1414
criSocket: unix:///var/run/dockershim.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
imageRepository: test/repo
2324
apiServer:
2425
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2526
extraArgs:
26-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
27+
- name: "enable-admission-plugins"
28+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
2729
controllerManager:
2830
extraArgs:
2931
allocate-node-cidrs: "true"

‎hack/update/kubernetes_version/templates/v1beta3/options.yaml renamed to ‎hack/update/kubernetes_version/templates/v1beta4/options.yaml

+20-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,33 +14,42 @@ nodeRegistration:
1414
criSocket: unix:///var/run/dockershim.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
apiServer:
2324
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2425
extraArgs:
25-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
26-
fail-no-swap: "true"
26+
- name: "enable-admission-plugins"
27+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
28+
- name: "fail-no-swap"
29+
value: "true"
2730
controllerManager:
2831
extraArgs:
29-
allocate-node-cidrs: "true"
30-
kube-api-burst: "32"
31-
leader-elect: "false"
32+
- name: "allocate-node-cidrs"
33+
value: "true"
34+
- name: "kube-api-burst"
35+
value: "32"
36+
- name: "leader-elect"
37+
value: "false"
3238
scheduler:
3339
extraArgs:
34-
leader-elect: "false"
35-
scheduler-name: "mini-scheduler"
40+
- name: "leader-elect"
41+
value: "false"
42+
- name: "scheduler-name"
43+
value: "mini-scheduler"
3644
certificatesDir: /var/lib/minikube/certs
3745
clusterName: mk
3846
controlPlaneEndpoint: control-plane.minikube.internal:8443
3947
etcd:
4048
local:
4149
dataDir: /var/lib/minikube/etcd
4250
extraArgs:
43-
proxy-refresh-interval: "70000"
51+
- name: "proxy-refresh-interval"
52+
value: "70000"
4453
kubernetesVersion: v1.23.0
4554
networking:
4655
dnsDomain: cluster.local
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
/*
2+
Copyright 2024 The Kubernetes Authors All rights reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package ktmpl
18+
19+
import "text/template"
20+
21+
// V1Beta4 is kubeadm config template for Kubernetes v1.31.0+
22+
var V1Beta4 = template.Must(template.New("configTmpl-v1beta4").Funcs(template.FuncMap{
23+
"printMapInOrder": printMapInOrder,
24+
}).Parse(`apiVersion: kubeadm.k8s.io/v1beta4
25+
kind: InitConfiguration
26+
localAPIEndpoint:
27+
advertiseAddress: {{.AdvertiseAddress}}
28+
bindPort: {{.APIServerPort}}
29+
bootstrapTokens:
30+
- groups:
31+
- system:bootstrappers:kubeadm:default-node-token
32+
ttl: 24h0m0s
33+
usages:
34+
- signing
35+
- authentication
36+
nodeRegistration:
37+
criSocket: {{if .CRISocket}}{{if .PrependCriSocketUnix}}unix://{{end}}{{.CRISocket}}{{else}}{{if .PrependCriSocketUnix}}unix://{{end}}/var/run/dockershim.sock{{end}}
38+
name: "{{.NodeName}}"
39+
kubeletExtraArgs:
40+
- name: "node-ip"
41+
value: "{{.NodeIP}}"
42+
taints: []
43+
---
44+
apiVersion: kubeadm.k8s.io/v1beta4
45+
kind: ClusterConfiguration
46+
{{ if .ImageRepository}}imageRepository: {{.ImageRepository}}
47+
{{end}}{{range .ComponentOptions}}{{.Component}}:
48+
{{- range $k, $v := .Pairs }}
49+
{{$k}}: {{$v}}
50+
{{- end}}
51+
extraArgs:
52+
{{- range $key, $val := .ExtraArgs }}
53+
- name: "{{$key}}"
54+
value: "{{$val}}"
55+
{{- end}}
56+
{{end -}}
57+
{{if .FeatureArgs}}featureGates:
58+
{{range $i, $val := .FeatureArgs}}{{$i}}: {{$val}}
59+
{{end -}}{{end -}}
60+
certificatesDir: {{.CertDir}}
61+
clusterName: mk
62+
controlPlaneEndpoint: {{.ControlPlaneAddress}}:{{.APIServerPort}}
63+
etcd:
64+
local:
65+
dataDir: {{.EtcdDataDir}}
66+
extraArgs:
67+
- name: "proxy-refresh-interval"
68+
value: "70000"
69+
{{- range $key, $val := .EtcdExtraArgs }}
70+
- name: "{{$key}}"
71+
value: "{{$val}}"
72+
{{- end}}
73+
kubernetesVersion: {{.KubernetesVersion}}
74+
networking:
75+
dnsDomain: {{if .DNSDomain}}{{.DNSDomain}}{{else}}cluster.local{{end}}
76+
podSubnet: "{{.PodSubnet }}"
77+
serviceSubnet: {{.ServiceCIDR}}
78+
---
79+
apiVersion: kubelet.config.k8s.io/v1beta1
80+
kind: KubeletConfiguration
81+
authentication:
82+
x509:
83+
clientCAFile: {{.ClientCAFile}}
84+
cgroupDriver: {{.CgroupDriver}}
85+
{{- range $key, $val := .KubeletConfigOpts}}
86+
{{$key}}: {{$val}}
87+
{{- end}}
88+
clusterDomain: "{{if .DNSDomain}}{{.DNSDomain}}{{else}}cluster.local{{end}}"
89+
# disable disk resource management by default
90+
imageGCHighThresholdPercent: 100
91+
evictionHard:
92+
nodefs.available: "0%"
93+
nodefs.inodesFree: "0%"
94+
imagefs.available: "0%"
95+
failSwapOn: false
96+
staticPodPath: {{.StaticPodPath}}{{if .ResolvConfSearchRegression}}
97+
resolvConf: /etc/kubelet-resolv.conf{{end}}
98+
---
99+
apiVersion: kubeproxy.config.k8s.io/v1alpha1
100+
kind: KubeProxyConfiguration
101+
clusterCIDR: "{{.PodSubnet }}"
102+
metricsBindAddress: 0.0.0.0:10249
103+
conntrack:
104+
maxPerCore: 0
105+
# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_established"
106+
tcpEstablishedTimeout: 0s
107+
# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_close"
108+
tcpCloseWaitTimeout: 0s
109+
{{- range $i, $val := printMapInOrder .KubeProxyOptions ": " }}
110+
{{$val}}
111+
{{- end}}
112+
`))

‎pkg/minikube/bootstrapper/bsutil/kubeadm.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,15 @@ func GenerateKubeadmYAML(cc config.ClusterConfig, n config.Node, r cruntime.Mana
172172
if version.GTE(semver.MustParse("1.23.0")) {
173173
configTmpl = ktmpl.V1Beta3
174174
}
175-
// TODO: support v1beta4 kubeadm config when released - refs: https://kubernetes.io/docs/reference/config-api/kubeadm-config.v1beta4/ and https://github.com/kubernetes/kubeadm/issues/2890
175+
// v1beta4 isn't required until v1.31.
176+
if version.GTE(semver.MustParse("1.31.0")) {
177+
// Support v1beta4 kubeadm config
178+
// refs:
179+
// - https://kubernetes.io/blog/2024/08/23/kubernetes-1-31-kubeadm-v1beta4/
180+
// - https://kubernetes.io/docs/reference/config-api/kubeadm-config.v1beta4/
181+
// - https://github.com/kubernetes/kubeadm/issues/2890
182+
configTmpl = ktmpl.V1Beta4
183+
}
176184

177185
if version.GTE(semver.MustParse("1.24.0-alpha.2")) {
178186
opts.PrependCriSocketUnix = true

‎pkg/minikube/bootstrapper/bsutil/testdata/v1.31/containerd-api-port.yaml

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,30 +14,36 @@ nodeRegistration:
1414
criSocket: unix:///run/containerd/containerd.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
apiServer:
2324
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2425
extraArgs:
25-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
26+
- name: "enable-admission-plugins"
27+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
2628
controllerManager:
2729
extraArgs:
28-
allocate-node-cidrs: "true"
29-
leader-elect: "false"
30+
- name: "allocate-node-cidrs"
31+
value: "true"
32+
- name: "leader-elect"
33+
value: "false"
3034
scheduler:
3135
extraArgs:
32-
leader-elect: "false"
36+
- name: "leader-elect"
37+
value: "false"
3338
certificatesDir: /var/lib/minikube/certs
3439
clusterName: mk
3540
controlPlaneEndpoint: control-plane.minikube.internal:12345
3641
etcd:
3742
local:
3843
dataDir: /var/lib/minikube/etcd
3944
extraArgs:
40-
proxy-refresh-interval: "70000"
45+
- name: "proxy-refresh-interval"
46+
value: "70000"
4147
kubernetesVersion: v1.31.0
4248
networking:
4349
dnsDomain: cluster.local

‎pkg/minikube/bootstrapper/bsutil/testdata/v1.31/containerd-pod-network-cidr.yaml

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,30 +14,36 @@ nodeRegistration:
1414
criSocket: unix:///run/containerd/containerd.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
apiServer:
2324
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2425
extraArgs:
25-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
26+
- name: "enable-admission-plugins"
27+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
2628
controllerManager:
2729
extraArgs:
28-
allocate-node-cidrs: "true"
29-
leader-elect: "false"
30+
- name: "allocate-node-cidrs"
31+
value: "true"
32+
- name: "leader-elect"
33+
value: "false"
3034
scheduler:
3135
extraArgs:
32-
leader-elect: "false"
36+
- name: "leader-elect"
37+
value: "false"
3338
certificatesDir: /var/lib/minikube/certs
3439
clusterName: mk
3540
controlPlaneEndpoint: control-plane.minikube.internal:8443
3641
etcd:
3742
local:
3843
dataDir: /var/lib/minikube/etcd
3944
extraArgs:
40-
proxy-refresh-interval: "70000"
45+
- name: "proxy-refresh-interval"
46+
value: "70000"
4147
kubernetesVersion: v1.31.0
4248
networking:
4349
dnsDomain: cluster.local

‎pkg/minikube/bootstrapper/bsutil/testdata/v1.31/containerd.yaml

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,30 +14,36 @@ nodeRegistration:
1414
criSocket: unix:///run/containerd/containerd.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
apiServer:
2324
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2425
extraArgs:
25-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
26+
- name: "enable-admission-plugins"
27+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
2628
controllerManager:
2729
extraArgs:
28-
allocate-node-cidrs: "true"
29-
leader-elect: "false"
30+
- name: "allocate-node-cidrs"
31+
value: "true"
32+
- name: "leader-elect"
33+
value: "false"
3034
scheduler:
3135
extraArgs:
32-
leader-elect: "false"
36+
- name: "leader-elect"
37+
value: "false"
3338
certificatesDir: /var/lib/minikube/certs
3439
clusterName: mk
3540
controlPlaneEndpoint: control-plane.minikube.internal:8443
3641
etcd:
3742
local:
3843
dataDir: /var/lib/minikube/etcd
3944
extraArgs:
40-
proxy-refresh-interval: "70000"
45+
- name: "proxy-refresh-interval"
46+
value: "70000"
4147
kubernetesVersion: v1.31.0
4248
networking:
4349
dnsDomain: cluster.local

‎pkg/minikube/bootstrapper/bsutil/testdata/v1.31/crio-options-gates.yaml

+26-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,36 +14,48 @@ nodeRegistration:
1414
criSocket: unix:///var/run/crio/crio.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
apiServer:
2324
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2425
extraArgs:
25-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
26-
fail-no-swap: "true"
27-
feature-gates: "a=b"
26+
- name: "enable-admission-plugins"
27+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
28+
- name: "fail-no-swap"
29+
value: "true"
30+
- name: "feature-gates"
31+
value: "a=b"
2832
controllerManager:
2933
extraArgs:
30-
allocate-node-cidrs: "true"
31-
feature-gates: "a=b"
32-
kube-api-burst: "32"
33-
leader-elect: "false"
34+
- name: "allocate-node-cidrs"
35+
value: "true"
36+
- name: "feature-gates"
37+
value: "a=b"
38+
- name: "kube-api-burst"
39+
value: "32"
40+
- name: "leader-elect"
41+
value: "false"
3442
scheduler:
3543
extraArgs:
36-
feature-gates: "a=b"
37-
leader-elect: "false"
38-
scheduler-name: "mini-scheduler"
44+
- name: "feature-gates"
45+
value: "a=b"
46+
- name: "leader-elect"
47+
value: "false"
48+
- name: "scheduler-name"
49+
value: "mini-scheduler"
3950
certificatesDir: /var/lib/minikube/certs
4051
clusterName: mk
4152
controlPlaneEndpoint: control-plane.minikube.internal:8443
4253
etcd:
4354
local:
4455
dataDir: /var/lib/minikube/etcd
4556
extraArgs:
46-
proxy-refresh-interval: "70000"
57+
- name: "proxy-refresh-interval"
58+
value: "70000"
4759
kubernetesVersion: v1.31.0
4860
networking:
4961
dnsDomain: cluster.local

‎pkg/minikube/bootstrapper/bsutil/testdata/v1.31/crio.yaml

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,30 +14,36 @@ nodeRegistration:
1414
criSocket: unix:///var/run/crio/crio.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
apiServer:
2324
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2425
extraArgs:
25-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
26+
- name: "enable-admission-plugins"
27+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
2628
controllerManager:
2729
extraArgs:
28-
allocate-node-cidrs: "true"
29-
leader-elect: "false"
30+
- name: "allocate-node-cidrs"
31+
value: "true"
32+
- name: "leader-elect"
33+
value: "false"
3034
scheduler:
3135
extraArgs:
32-
leader-elect: "false"
36+
- name: "leader-elect"
37+
value: "false"
3338
certificatesDir: /var/lib/minikube/certs
3439
clusterName: mk
3540
controlPlaneEndpoint: control-plane.minikube.internal:8443
3641
etcd:
3742
local:
3843
dataDir: /var/lib/minikube/etcd
3944
extraArgs:
40-
proxy-refresh-interval: "70000"
45+
- name: "proxy-refresh-interval"
46+
value: "70000"
4147
kubernetesVersion: v1.31.0
4248
networking:
4349
dnsDomain: cluster.local

‎pkg/minikube/bootstrapper/bsutil/testdata/v1.31/default.yaml

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,30 +14,36 @@ nodeRegistration:
1414
criSocket: unix:///var/run/dockershim.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
apiServer:
2324
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2425
extraArgs:
25-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
26+
- name: "enable-admission-plugins"
27+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
2628
controllerManager:
2729
extraArgs:
28-
allocate-node-cidrs: "true"
29-
leader-elect: "false"
30+
- name: "allocate-node-cidrs"
31+
value: "true"
32+
- name: "leader-elect"
33+
value: "false"
3034
scheduler:
3135
extraArgs:
32-
leader-elect: "false"
36+
- name: "leader-elect"
37+
value: "false"
3338
certificatesDir: /var/lib/minikube/certs
3439
clusterName: mk
3540
controlPlaneEndpoint: control-plane.minikube.internal:8443
3641
etcd:
3742
local:
3843
dataDir: /var/lib/minikube/etcd
3944
extraArgs:
40-
proxy-refresh-interval: "70000"
45+
- name: "proxy-refresh-interval"
46+
value: "70000"
4147
kubernetesVersion: v1.31.0
4248
networking:
4349
dnsDomain: cluster.local

‎pkg/minikube/bootstrapper/bsutil/testdata/v1.31/dns.yaml

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,30 +14,36 @@ nodeRegistration:
1414
criSocket: unix:///var/run/dockershim.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
apiServer:
2324
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2425
extraArgs:
25-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
26+
- name: "enable-admission-plugins"
27+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
2628
controllerManager:
2729
extraArgs:
28-
allocate-node-cidrs: "true"
29-
leader-elect: "false"
30+
- name: "allocate-node-cidrs"
31+
value: "true"
32+
- name: "leader-elect"
33+
value: "false"
3034
scheduler:
3135
extraArgs:
32-
leader-elect: "false"
36+
- name: "leader-elect"
37+
value: "false"
3338
certificatesDir: /var/lib/minikube/certs
3439
clusterName: mk
3540
controlPlaneEndpoint: control-plane.minikube.internal:8443
3641
etcd:
3742
local:
3843
dataDir: /var/lib/minikube/etcd
3944
extraArgs:
40-
proxy-refresh-interval: "70000"
45+
- name: "proxy-refresh-interval"
46+
value: "70000"
4147
kubernetesVersion: v1.31.0
4248
networking:
4349
dnsDomain: minikube.local

‎pkg/minikube/bootstrapper/bsutil/testdata/v1.31/image-repository.yaml

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,31 +14,37 @@ nodeRegistration:
1414
criSocket: unix:///var/run/dockershim.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
imageRepository: test/repo
2324
apiServer:
2425
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2526
extraArgs:
26-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
27+
- name: "enable-admission-plugins"
28+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
2729
controllerManager:
2830
extraArgs:
29-
allocate-node-cidrs: "true"
30-
leader-elect: "false"
31+
- name: "allocate-node-cidrs"
32+
value: "true"
33+
- name: "leader-elect"
34+
value: "false"
3135
scheduler:
3236
extraArgs:
33-
leader-elect: "false"
37+
- name: "leader-elect"
38+
value: "false"
3439
certificatesDir: /var/lib/minikube/certs
3540
clusterName: mk
3641
controlPlaneEndpoint: control-plane.minikube.internal:8443
3742
etcd:
3843
local:
3944
dataDir: /var/lib/minikube/etcd
4045
extraArgs:
41-
proxy-refresh-interval: "70000"
46+
- name: "proxy-refresh-interval"
47+
value: "70000"
4248
kubernetesVersion: v1.31.0
4349
networking:
4450
dnsDomain: cluster.local

‎pkg/minikube/bootstrapper/bsutil/testdata/v1.31/options.yaml

+20-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kubeadm.k8s.io/v1beta3
1+
apiVersion: kubeadm.k8s.io/v1beta4
22
kind: InitConfiguration
33
localAPIEndpoint:
44
advertiseAddress: 1.1.1.1
@@ -14,33 +14,42 @@ nodeRegistration:
1414
criSocket: unix:///var/run/dockershim.sock
1515
name: "mk"
1616
kubeletExtraArgs:
17-
node-ip: 1.1.1.1
17+
- name: "node-ip"
18+
value: "1.1.1.1"
1819
taints: []
1920
---
20-
apiVersion: kubeadm.k8s.io/v1beta3
21+
apiVersion: kubeadm.k8s.io/v1beta4
2122
kind: ClusterConfiguration
2223
apiServer:
2324
certSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
2425
extraArgs:
25-
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
26-
fail-no-swap: "true"
26+
- name: "enable-admission-plugins"
27+
value: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
28+
- name: "fail-no-swap"
29+
value: "true"
2730
controllerManager:
2831
extraArgs:
29-
allocate-node-cidrs: "true"
30-
kube-api-burst: "32"
31-
leader-elect: "false"
32+
- name: "allocate-node-cidrs"
33+
value: "true"
34+
- name: "kube-api-burst"
35+
value: "32"
36+
- name: "leader-elect"
37+
value: "false"
3238
scheduler:
3339
extraArgs:
34-
leader-elect: "false"
35-
scheduler-name: "mini-scheduler"
40+
- name: "leader-elect"
41+
value: "false"
42+
- name: "scheduler-name"
43+
value: "mini-scheduler"
3644
certificatesDir: /var/lib/minikube/certs
3745
clusterName: mk
3846
controlPlaneEndpoint: control-plane.minikube.internal:8443
3947
etcd:
4048
local:
4149
dataDir: /var/lib/minikube/etcd
4250
extraArgs:
43-
proxy-refresh-interval: "70000"
51+
- name: "proxy-refresh-interval"
52+
value: "70000"
4453
kubernetesVersion: v1.31.0
4554
networking:
4655
dnsDomain: cluster.local

0 commit comments

Comments
 (0)
Please sign in to comment.