Skip to content

Commit

Permalink
Add debug logging patch to ClusterClass
Browse files Browse the repository at this point in the history
Signed-off-by: killianmuldoon <kmuldoon@vmware.com>
  • Loading branch information
killianmuldoon committed Sep 25, 2023
1 parent a36712e commit 94eb7d9
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ spec:
value: false
- name: externalCloudProvider
value: true
- name: debugLogging
value: true
clusterNetwork:
services:
cidrBlocks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ spec:
value: true
- name: externalCloudProvider
value: true
- name: debugLogging
value: true
clusterNetwork:
services:
cidrBlocks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ spec:
openAPIV3Schema:
type: boolean
default: false
- name: debugLogging
schema:
openAPIV3Schema:
type: boolean
default: false
patches:
- name: lbImageRepository
definitions:
Expand Down Expand Up @@ -290,13 +295,11 @@ spec:
controlPlane: true
jsonPatches:
- op: add
path: "/spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/kubeletExtraArgs"
value:
cloud-provider: "external"
path: "/spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/kubeletExtraArgs/cloud-provider"
value: "external"
- op: add
path: "/spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/kubeletExtraArgs"
value:
cloud-provider: "external"
path: "/spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/kubeletExtraArgs/cloud-provider"
value: "external"
- name: machineDeploymentExternalCloudProvider
enabledIf: "{{ .externalCloudProvider }}"
description: "Configures kubelet to run with an external cloud provider for machineDeployment nodes."
Expand All @@ -310,9 +313,8 @@ spec:
- '*-worker'
jsonPatches:
- op: add
path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs"
value:
cloud-provider: "external"
path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/cloud-provider"
value: "external"
- selector:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
Expand All @@ -322,9 +324,8 @@ spec:
- '*-worker'
jsonPatches:
- op: add
path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs"
value:
cloud-provider: "external"
path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/cloud-provider"
value: "external"
- name: localEndpointIPv6
enabledIf: "{{ .ipv6Primary }}"
description: "Configures KCP to use IPv6 for its localAPIEndpoint."
Expand Down Expand Up @@ -385,6 +386,57 @@ spec:
namespaces: [kube-system]
path: /etc/kubernetes/kube-apiserver-admission-pss.yaml
enabledIf: '{{ semverCompare ">= v1.24" .builtin.controlPlane.version }}'
- name: controlPlaneDebugLogging
enabledIf: "{{ .debugLogging }}"
description: "Configures control plane components and kubelet to log at v=4."
definitions:
- selector:
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlaneTemplate
matchResources:
controlPlane: true
jsonPatches:
- op: add
path: "/spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/kubeletExtraArgs/v"
value: "4"
- op: add
path: "/spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/kubeletExtraArgs/v"
value: "4"
- op: add
path: "/spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraArgs/v"
value: "4"
- op: add
path: "/spec/template/spec/kubeadmConfigSpec/clusterConfiguration/controllerManager/extraArgs/v"
value: "4"
- op: add
path: "/spec/template/spec/kubeadmConfigSpec/clusterConfiguration/scheduler/extraArgs/v"
value: "4"
- name: workerKubeletDebugLogging
enabledIf: "{{ .debugLogging }}"
description: "Configures worker kubelets to log at v=4."
definitions:
- selector:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
matchResources:
machineDeploymentClass:
names:
- '*-worker'
jsonPatches:
- op: add
path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/v"
value: "4"
- selector:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
matchResources:
machinePoolClass:
names:
- '*-worker'
jsonPatches:
- op: add
path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/v"
value: "4"
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: DockerClusterTemplate
Expand Down Expand Up @@ -452,6 +504,9 @@ spec:
apiServer:
# host.docker.internal is required by kubetest when running on MacOS because of the way ports are proxied.
certSANs: [localhost, host.docker.internal, "::", "::1", "127.0.0.1", "0.0.0.0"]
extraArgs: { v: "2"}
scheduler:
extraArgs: { v: "2"}
initConfiguration:
nodeRegistration: # node registration parameters are automatically injected by CAPD according to the kindest/node image in use.
kubeletExtraArgs: # having a not empty kubeletExtraArgs is required for the externalCloudProvider patch to work
Expand Down

0 comments on commit 94eb7d9

Please sign in to comment.