@@ -82,15 +82,6 @@ build() {
8282 export PATH=" ${PWD} /_output/bin:$PATH "
8383}
8484
85- check_structured_log_support () {
86- case " ${KUBE_VERSION} " in
87- v1.1[0-8].* )
88- echo " $1 is only supported on versions >= v1.19, got ${KUBE_VERSION} "
89- exit 1
90- ;;
91- esac
92- }
93-
9485# up a cluster with kind
9586create_cluster () {
9687 # Grab the version of the cluster we're about to start
@@ -99,30 +90,6 @@ create_cluster() {
9990 # Default Log level for all components in test clusters
10091 KIND_CLUSTER_LOG_LEVEL=${KIND_CLUSTER_LOG_LEVEL:- 4}
10192
102- # potentially enable --logging-format
103- CLUSTER_LOG_FORMAT=${CLUSTER_LOG_FORMAT:- }
104- scheduler_extra_args=" \" v\" : \" ${KIND_CLUSTER_LOG_LEVEL} \" "
105- controllerManager_extra_args=" \" v\" : \" ${KIND_CLUSTER_LOG_LEVEL} \" "
106- apiServer_extra_args=" \" v\" : \" ${KIND_CLUSTER_LOG_LEVEL} \" "
107- if [ -n " $CLUSTER_LOG_FORMAT " ]; then
108- check_structured_log_support " CLUSTER_LOG_FORMAT"
109- scheduler_extra_args=" ${scheduler_extra_args}
110- \" logging-format\" : \" ${CLUSTER_LOG_FORMAT} \" "
111- controllerManager_extra_args=" ${controllerManager_extra_args}
112- \" logging-format\" : \" ${CLUSTER_LOG_FORMAT} \" "
113- apiServer_extra_args=" ${apiServer_extra_args}
114- \" logging-format\" : \" ${CLUSTER_LOG_FORMAT} \" "
115- fi
116- kubelet_extra_args=" \" v\" : \" ${KIND_CLUSTER_LOG_LEVEL} \"
117- \" container-log-max-files\" : \" 10\"
118- \" container-log-max-size\" : \" 100Mi\" "
119- KUBELET_LOG_FORMAT=${KUBELET_LOG_FORMAT:- $CLUSTER_LOG_FORMAT }
120- if [ -n " $KUBELET_LOG_FORMAT " ]; then
121- check_structured_log_support " KUBECTL_LOG_FORMAT"
122- kubelet_extra_args=" ${kubelet_extra_args}
123- \" logging-format\" : \" ${KUBELET_LOG_FORMAT} \" "
124- fi
125-
12693 # JSON or YAML map injected into featureGates config
12794 feature_gates=" ${FEATURE_GATES:- {\} } "
12895 # --runtime-config argument value passed to the API server, again as a map
@@ -146,29 +113,75 @@ nodes:
146113featureGates: ${feature_gates}
147114runtimeConfig: ${runtime_config}
148115kubeadmConfigPatches:
116+ # v1beta4 for the future (v1.35.0+ ?)
117+ # https://github.com/kubernetes-sigs/kind/issues/3847
118+ # TODO: drop v1beta3 when we no longer need versions that use it
119+ - |
120+ kind: ClusterConfiguration
121+ apiVersion: kubeadm.k8s.io/v1beta4
122+ metadata:
123+ name: config
124+ apiServer:
125+ extraArgs:
126+ - name: "v"
127+ value: "${KIND_CLUSTER_LOG_LEVEL} "
128+ controllerManager:
129+ extraArgs:
130+ - name: "v"
131+ value: "${KIND_CLUSTER_LOG_LEVEL} "
132+ scheduler:
133+ extraArgs:
134+ - name: "v"
135+ value: "${KIND_CLUSTER_LOG_LEVEL} "
136+ ---
137+ kind: InitConfiguration
138+ nodeRegistration:
139+ kubeletExtraArgs:
140+ - name: "v"
141+ value: "${KIND_CLUSTER_LOG_LEVEL} "
142+ - name: "container-log-max-files"
143+ value: "10"
144+ - name: "container-log-max-size"
145+ value: "100Mi"
146+ ---
147+ kind: JoinConfiguration
148+ nodeRegistration:
149+ kubeletExtraArgs:
150+ - name: "v"
151+ value: "${KIND_CLUSTER_LOG_LEVEL} "
152+ - name: "container-log-max-files"
153+ value: "10"
154+ - name: "container-log-max-size"
155+ value: "100Mi"
156+ # v1beta3 for v1.23.0 ... ?
149157- |
150158 kind: ClusterConfiguration
159+ apiVersion: kubeadm.k8s.io/v1beta3
151160 metadata:
152161 name: config
153162 apiServer:
154163 extraArgs:
155- ${apiServer_extra_args}
164+ "v": " ${KIND_CLUSTER_LOG_LEVEL} "
156165 controllerManager:
157166 extraArgs:
158- ${controllerManager_extra_args}
167+ "v": " ${KIND_CLUSTER_LOG_LEVEL} "
159168 scheduler:
160169 extraArgs:
161- ${scheduler_extra_args}
170+ "v": " ${KIND_CLUSTER_LOG_LEVEL} "
162171 ---
163172 kind: InitConfiguration
164173 nodeRegistration:
165174 kubeletExtraArgs:
166- ${kubelet_extra_args}
175+ "v": "${KIND_CLUSTER_LOG_LEVEL} "
176+ "container-log-max-files": "10"
177+ "container-log-max-size": "100Mi"
167178 ---
168179 kind: JoinConfiguration
169180 nodeRegistration:
170181 kubeletExtraArgs:
171- ${kubelet_extra_args}
182+ "v": "${KIND_CLUSTER_LOG_LEVEL} "
183+ "container-log-max-files": "10"
184+ "container-log-max-size": "100Mi"
172185EOF
173186 # NOTE: must match the number of workers above
174187 NUM_NODES=2
0 commit comments