mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 22:40:35 +00:00
Merge pull request #135016 from BenTheElder/kubeadm-kind-v1beta4
prepare kind configs for kubeadm v1beta4
This commit is contained in:
@@ -8,9 +8,48 @@ containerdConfigPatches:
|
||||
enable_cdi = true
|
||||
nodes:
|
||||
- role: control-plane
|
||||
kubeadmConfigPatches:
|
||||
- role: worker
|
||||
- role: worker
|
||||
- role: worker
|
||||
kubeadmConfigPatches:
|
||||
# v1beta4 for the future (v1.35.0+ ?)
|
||||
# https://github.com/kubernetes-sigs/kind/issues/3847
|
||||
# TODO: drop v1beta3 when kind makes the switch
|
||||
- |
|
||||
kind: ClusterConfiguration
|
||||
apiVersion: kubeadm.k8s.io/v1beta4
|
||||
scheduler:
|
||||
extraArgs:
|
||||
- name: "v"
|
||||
value: "5"
|
||||
- name: "vmodule"
|
||||
value: "allocator=6,dynamicresources=6" # structured/allocator.go, DRA scheduler plugin
|
||||
controllerManager:
|
||||
extraArgs:
|
||||
- name: "v"
|
||||
value: "5"
|
||||
- name: "vmodule"
|
||||
value: "controller=6" # resourceclaim/controller.go - should have renamed it when copying the controller it was based on!
|
||||
apiServer:
|
||||
extraArgs:
|
||||
runtime-config: "resource.k8s.io/v1alpha3=true,resource.k8s.io/v1beta1=true,resource.k8s.io/v1beta2=true"
|
||||
- |
|
||||
kind: InitConfiguration
|
||||
apiVersion: kubeadm.k8s.io/v1beta4
|
||||
nodeRegistration:
|
||||
kubeletExtraArgs:
|
||||
- name: "v"
|
||||
value: "5"
|
||||
- |
|
||||
kind: JoinConfiguration
|
||||
nodeRegistration:
|
||||
kubeletExtraArgs:
|
||||
- name: "v"
|
||||
value: "5"
|
||||
# v1beta3 for v1.23.0 ... ?
|
||||
- |
|
||||
kind: ClusterConfiguration
|
||||
apiVersion: kubeadm.k8s.io/v1beta3
|
||||
scheduler:
|
||||
extraArgs:
|
||||
v: "5"
|
||||
@@ -24,25 +63,10 @@ nodes:
|
||||
runtime-config: "resource.k8s.io/v1alpha3=true,resource.k8s.io/v1beta1=true,resource.k8s.io/v1beta2=true"
|
||||
- |
|
||||
kind: InitConfiguration
|
||||
apiVersion: kubeadm.k8s.io/v1beta3
|
||||
nodeRegistration:
|
||||
kubeletExtraArgs:
|
||||
v: "5"
|
||||
- role: worker
|
||||
kubeadmConfigPatches:
|
||||
- |
|
||||
kind: JoinConfiguration
|
||||
nodeRegistration:
|
||||
kubeletExtraArgs:
|
||||
v: "5"
|
||||
- role: worker
|
||||
kubeadmConfigPatches:
|
||||
- |
|
||||
kind: JoinConfiguration
|
||||
nodeRegistration:
|
||||
kubeletExtraArgs:
|
||||
v: "5"
|
||||
- role: worker
|
||||
kubeadmConfigPatches:
|
||||
- |
|
||||
kind: JoinConfiguration
|
||||
nodeRegistration:
|
||||
|
||||
@@ -21,8 +21,39 @@ nodes:
|
||||
readOnly: true
|
||||
propagation: None
|
||||
kubeadmConfigPatches:
|
||||
# v1beta4 for the future (v1.35.0+ ?)
|
||||
# https://github.com/kubernetes-sigs/kind/issues/3847
|
||||
# TODO: drop v1beta3 when kind makes the switch
|
||||
- |
|
||||
kind: ClusterConfiguration
|
||||
apiVersion: kubeadm.k8s.io/v1beta4
|
||||
apiServer:
|
||||
extraArgs:
|
||||
- name: "encryption-provider-config"
|
||||
value: "/etc/kubernetes/encryption-config.yaml"
|
||||
- name: "v"
|
||||
value: "5"
|
||||
extraVolumes:
|
||||
- name: encryption-config
|
||||
hostPath: "/etc/kubernetes/encryption-config.yaml"
|
||||
mountPath: "/etc/kubernetes/encryption-config.yaml"
|
||||
readOnly: true
|
||||
pathType: File
|
||||
- name: sock-path
|
||||
hostPath: "/tmp"
|
||||
mountPath: "/tmp"
|
||||
scheduler:
|
||||
extraArgs:
|
||||
- name: "v"
|
||||
value: "5"
|
||||
controllerManager:
|
||||
extraArgs:
|
||||
- name: "v"
|
||||
value: "5"
|
||||
# v1beta3 for v1.23.0 ... ?
|
||||
- |
|
||||
kind: ClusterConfiguration
|
||||
apiVersion: kubeadm.k8s.io/v1beta3
|
||||
apiServer:
|
||||
extraArgs:
|
||||
encryption-provider-config: "/etc/kubernetes/encryption-config.yaml"
|
||||
|
||||
@@ -28,8 +28,6 @@ set -o errexit -o nounset -o xtrace
|
||||
# parallel testing is enabled. Using LABEL_FILTER instead of combining SKIP and
|
||||
# FOCUS is recommended (more expressive, easier to read than regexp).
|
||||
#
|
||||
# GA_ONLY: true - limit to GA APIs/features as much as possible
|
||||
# false - (default) APIs and features left at defaults
|
||||
# FEATURE_GATES:
|
||||
# JSON or YAML encoding of a string/bool map: {"FeatureGateA": true, "FeatureGateB": false}
|
||||
# Enables or disables feature gates in the entire cluster.
|
||||
@@ -84,74 +82,16 @@ build() {
|
||||
export PATH="${PWD}/_output/bin:$PATH"
|
||||
}
|
||||
|
||||
check_structured_log_support() {
|
||||
case "${KUBE_VERSION}" in
|
||||
v1.1[0-8].*)
|
||||
echo "$1 is only supported on versions >= v1.19, got ${KUBE_VERSION}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# up a cluster with kind
|
||||
create_cluster() {
|
||||
# Grab the version of the cluster we're about to start
|
||||
KUBE_VERSION="$(docker run --rm --entrypoint=cat "kindest/node:latest" /kind/version)"
|
||||
|
||||
# Default Log level for all components in test clusters
|
||||
KIND_CLUSTER_LOG_LEVEL=${KIND_CLUSTER_LOG_LEVEL:-4}
|
||||
|
||||
# potentially enable --logging-format
|
||||
CLUSTER_LOG_FORMAT=${CLUSTER_LOG_FORMAT:-}
|
||||
scheduler_extra_args=" \"v\": \"${KIND_CLUSTER_LOG_LEVEL}\""
|
||||
controllerManager_extra_args=" \"v\": \"${KIND_CLUSTER_LOG_LEVEL}\""
|
||||
apiServer_extra_args=" \"v\": \"${KIND_CLUSTER_LOG_LEVEL}\""
|
||||
if [ -n "$CLUSTER_LOG_FORMAT" ]; then
|
||||
check_structured_log_support "CLUSTER_LOG_FORMAT"
|
||||
scheduler_extra_args="${scheduler_extra_args}
|
||||
\"logging-format\": \"${CLUSTER_LOG_FORMAT}\""
|
||||
controllerManager_extra_args="${controllerManager_extra_args}
|
||||
\"logging-format\": \"${CLUSTER_LOG_FORMAT}\""
|
||||
apiServer_extra_args="${apiServer_extra_args}
|
||||
\"logging-format\": \"${CLUSTER_LOG_FORMAT}\""
|
||||
fi
|
||||
kubelet_extra_args=" \"v\": \"${KIND_CLUSTER_LOG_LEVEL}\""
|
||||
KUBELET_LOG_FORMAT=${KUBELET_LOG_FORMAT:-$CLUSTER_LOG_FORMAT}
|
||||
if [ -n "$KUBELET_LOG_FORMAT" ]; then
|
||||
check_structured_log_support "KUBECTL_LOG_FORMAT"
|
||||
kubelet_extra_args="${kubelet_extra_args}
|
||||
\"logging-format\": \"${KUBELET_LOG_FORMAT}\""
|
||||
fi
|
||||
|
||||
# JSON or YAML map injected into featureGates config
|
||||
feature_gates="${FEATURE_GATES:-{\}}"
|
||||
# --runtime-config argument value passed to the API server, again as a map
|
||||
runtime_config="${RUNTIME_CONFIG:-{\}}"
|
||||
|
||||
case "${GA_ONLY:-false}" in
|
||||
false)
|
||||
:
|
||||
;;
|
||||
true)
|
||||
if [ "${feature_gates}" != "{}" ]; then
|
||||
echo "GA_ONLY=true and FEATURE_GATES=${feature_gates} are mutually exclusive."
|
||||
exit 1
|
||||
fi
|
||||
if [ "${runtime_config}" != "{}" ]; then
|
||||
echo "GA_ONLY=true and RUNTIME_CONFIG=${runtime_config} are mutually exclusive."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Limiting to GA APIs and features for ${KUBE_VERSION}"
|
||||
feature_gates='{"AllAlpha":false,"AllBeta":false}'
|
||||
runtime_config='{"api/alpha":"false", "api/beta":"false"}'
|
||||
;;
|
||||
*)
|
||||
echo "\$GA_ONLY set to '${GA_ONLY}'; supported values are true and false (default)"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# create the config file
|
||||
cat <<EOF > "${ARTIFACTS}/kind-config.yaml"
|
||||
# config for 1 control plane node and 2 workers (necessary for conformance)
|
||||
@@ -170,29 +110,63 @@ nodes:
|
||||
featureGates: ${feature_gates}
|
||||
runtimeConfig: ${runtime_config}
|
||||
kubeadmConfigPatches:
|
||||
# v1beta4 for the future (v1.35.0+ ?)
|
||||
# https://github.com/kubernetes-sigs/kind/issues/3847
|
||||
# TODO: drop v1beta3 when kind makes the switch
|
||||
- |
|
||||
kind: ClusterConfiguration
|
||||
apiVersion: kubeadm.k8s.io/v1beta4
|
||||
metadata:
|
||||
name: config
|
||||
apiServer:
|
||||
extraArgs:
|
||||
${apiServer_extra_args}
|
||||
- name: "v"
|
||||
value: "${KIND_CLUSTER_LOG_LEVEL}"
|
||||
controllerManager:
|
||||
extraArgs:
|
||||
${controllerManager_extra_args}
|
||||
- name: "v"
|
||||
value: "${KIND_CLUSTER_LOG_LEVEL}"
|
||||
scheduler:
|
||||
extraArgs:
|
||||
${scheduler_extra_args}
|
||||
- name: "v"
|
||||
value: "${KIND_CLUSTER_LOG_LEVEL}"
|
||||
---
|
||||
kind: InitConfiguration
|
||||
nodeRegistration:
|
||||
kubeletExtraArgs:
|
||||
${kubelet_extra_args}
|
||||
- name: "v"
|
||||
value: "${KIND_CLUSTER_LOG_LEVEL}"
|
||||
---
|
||||
kind: JoinConfiguration
|
||||
nodeRegistration:
|
||||
kubeletExtraArgs:
|
||||
${kubelet_extra_args}
|
||||
- name: "v"
|
||||
value: "${KIND_CLUSTER_LOG_LEVEL}"
|
||||
# v1beta3 for v1.23.0 ... ?
|
||||
- |
|
||||
kind: ClusterConfiguration
|
||||
apiVersion: kubeadm.k8s.io/v1beta3
|
||||
metadata:
|
||||
name: config
|
||||
apiServer:
|
||||
extraArgs:
|
||||
"v": "${KIND_CLUSTER_LOG_LEVEL}"
|
||||
controllerManager:
|
||||
extraArgs:
|
||||
"v": "${KIND_CLUSTER_LOG_LEVEL}"
|
||||
scheduler:
|
||||
extraArgs:
|
||||
"v": "${KIND_CLUSTER_LOG_LEVEL}"
|
||||
---
|
||||
kind: InitConfiguration
|
||||
nodeRegistration:
|
||||
kubeletExtraArgs:
|
||||
"v": "${KIND_CLUSTER_LOG_LEVEL}"
|
||||
---
|
||||
kind: JoinConfiguration
|
||||
nodeRegistration:
|
||||
kubeletExtraArgs:
|
||||
"v": "${KIND_CLUSTER_LOG_LEVEL}"
|
||||
EOF
|
||||
# NOTE: must match the number of workers above
|
||||
NUM_NODES=2
|
||||
|
||||
Reference in New Issue
Block a user