@@ -130,6 +130,18 @@ spec:
130
130
openAPIV3Schema :
131
131
type : boolean
132
132
default : false
133
+ - name : kubeControlPlaneLogLevel
134
+ schema :
135
+ openAPIV3Schema :
136
+ type : string
137
+ description : " Log level for kube-apiserver, kube-scheduler and kube-controller-manager"
138
+ example : " 2"
139
+ - name : kubeletLogLevel
140
+ schema :
141
+ openAPIV3Schema :
142
+ type : string
143
+ description : " Log level for kubelets on control plane and worker nodes"
144
+ example : " 2"
133
145
patches :
134
146
- name : lbImageRepository
135
147
definitions :
@@ -290,13 +302,11 @@ spec:
290
302
controlPlane : true
291
303
jsonPatches :
292
304
- op : add
293
- path : " /spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/kubeletExtraArgs"
294
- value :
295
- cloud-provider : " external"
305
+ path : " /spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/kubeletExtraArgs/cloud-provider"
306
+ value : " external"
296
307
- op : add
297
- path : " /spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/kubeletExtraArgs"
298
- value :
299
- cloud-provider : " external"
308
+ path : " /spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/kubeletExtraArgs/cloud-provider"
309
+ value : " external"
300
310
- name : machineDeploymentExternalCloudProvider
301
311
enabledIf : " {{ .externalCloudProvider }}"
302
312
description : " Configures kubelet to run with an external cloud provider for machineDeployment nodes."
@@ -310,9 +320,8 @@ spec:
310
320
- ' *-worker'
311
321
jsonPatches :
312
322
- op : add
313
- path : " /spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs"
314
- value :
315
- cloud-provider : " external"
323
+ path : " /spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/cloud-provider"
324
+ value : " external"
316
325
- selector :
317
326
apiVersion : bootstrap.cluster.x-k8s.io/v1beta1
318
327
kind : KubeadmConfigTemplate
@@ -322,9 +331,8 @@ spec:
322
331
- ' *-worker'
323
332
jsonPatches :
324
333
- op : add
325
- path : " /spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs"
326
- value :
327
- cloud-provider : " external"
334
+ path : " /spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/cloud-provider"
335
+ value : " external"
328
336
- name : localEndpointIPv6
329
337
enabledIf : " {{ .ipv6Primary }}"
330
338
description : " Configures KCP to use IPv6 for its localAPIEndpoint."
@@ -349,9 +357,8 @@ spec:
349
357
controlPlane : true
350
358
jsonPatches :
351
359
- op : add
352
- path : " /spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraArgs"
353
- value :
354
- admission-control-config-file : " /etc/kubernetes/kube-apiserver-admission-pss.yaml"
360
+ path : " /spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraArgs/admission-control-config-file"
361
+ value : " /etc/kubernetes/kube-apiserver-admission-pss.yaml"
355
362
- op : add
356
363
path : " /spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraVolumes"
357
364
value :
@@ -385,6 +392,74 @@ spec:
385
392
namespaces: [kube-system]
386
393
path: /etc/kubernetes/kube-apiserver-admission-pss.yaml
387
394
enabledIf : ' {{ semverCompare ">= v1.24" .builtin.controlPlane.version }}'
395
+ - name : controlPlaneLogLevel
396
+ enabledIf : " {{ if .kubeControlPlaneLogLevel }}true{{end}}"
397
+ description : " Configures control plane components and kubelet to run at the log level specified in the variable `kubeControlPlaneLogLevel`."
398
+ definitions :
399
+ - selector :
400
+ apiVersion : controlplane.cluster.x-k8s.io/v1beta1
401
+ kind : KubeadmControlPlaneTemplate
402
+ matchResources :
403
+ controlPlane : true
404
+ jsonPatches :
405
+ - op : add
406
+ path : " /spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraArgs/v"
407
+ valueFrom :
408
+ variable : kubeControlPlaneLogLevel
409
+ - op : add
410
+ path : " /spec/template/spec/kubeadmConfigSpec/clusterConfiguration/controllerManager/extraArgs/v"
411
+ valueFrom :
412
+ variable : kubeControlPlaneLogLevel
413
+ - op : add
414
+ path : " /spec/template/spec/kubeadmConfigSpec/clusterConfiguration/scheduler/extraArgs/v"
415
+ valueFrom :
416
+ variable : kubeControlPlaneLogLevel
417
+ - name : controlPlaneKubeletLogLevel
418
+ enabledIf : " {{ if .kubeletLogLevel }}true{{end}}"
419
+ description : " Configures control plane kubelets to log at the level set in the variable `kubeletLogLevel`."
420
+ definitions :
421
+ - selector :
422
+ apiVersion : controlplane.cluster.x-k8s.io/v1beta1
423
+ kind : KubeadmControlPlaneTemplate
424
+ matchResources :
425
+ controlPlane : true
426
+ jsonPatches :
427
+ - op : add
428
+ path : " /spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/kubeletExtraArgs/v"
429
+ valueFrom :
430
+ variable : kubeletLogLevel
431
+ - op : add
432
+ path : " /spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/kubeletExtraArgs/v"
433
+ valueFrom :
434
+ variable : kubeletLogLevel
435
+ - name : workerKubeletLogLevel
436
+ enabledIf : " {{ if .kubeletLogLevel }}true{{end}}"
437
+ description : " Configures worker kubelets to log at the level set in the variable `kubeletLogLevel`."
438
+ definitions :
439
+ - selector :
440
+ apiVersion : bootstrap.cluster.x-k8s.io/v1beta1
441
+ kind : KubeadmConfigTemplate
442
+ matchResources :
443
+ machineDeploymentClass :
444
+ names :
445
+ - ' *-worker'
446
+ jsonPatches :
447
+ - op : add
448
+ path : " /spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/v"
449
+ valueFrom :
450
+ variable : kubeletLogLevel
451
+ - selector :
452
+ apiVersion : bootstrap.cluster.x-k8s.io/v1beta1
453
+ kind : KubeadmConfigTemplate
454
+ matchResources :
455
+ machinePoolClass :
456
+ names :
457
+ - ' *-worker'
458
+ jsonPatches :
459
+ - op : add
460
+ path : " /spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/v"
461
+ valueFrom :
462
+ variable : kubeletLogLevel
388
463
---
389
464
apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
390
465
kind : DockerClusterTemplate
@@ -447,9 +522,17 @@ spec:
447
522
nodeDrainTimeout : 1s
448
523
kubeadmConfigSpec :
449
524
clusterConfiguration :
525
+ # extraArgs must be non-empty for control plane components to enable patches from ClusterClass to work.
450
526
controllerManager :
451
- extraArgs : { enable-hostpath-provisioner: 'true' }
527
+ extraArgs :
528
+ enable-hostpath-provisioner : ' true'
529
+ v : " 0"
530
+ scheduler :
531
+ extraArgs :
532
+ v : " 0"
452
533
apiServer :
534
+ extraArgs :
535
+ v : " 0"
453
536
# host.docker.internal is required by kubetest when running on MacOS because of the way ports are proxied.
454
537
certSANs : [localhost, host.docker.internal, "::", "::1", "127.0.0.1", "0.0.0.0"]
455
538
initConfiguration :
0 commit comments