Split run controllers per controller-manager

This commit is contained in:
Jakub Przychodzeń 2023-02-08 14:40:04 +00:00
parent b0171f77f6
commit 544456608f
5 changed files with 14 additions and 4 deletions

View File

@ -45,6 +45,7 @@ rules:
verbs:
- get
- update
- patch
- apiGroups:
- ""
resources:

View File

@ -255,6 +255,9 @@ if [[ (( "${KUBE_FEATURE_GATES:-}" == *"AllAlpha=true"* ) || ( "${KUBE_FEATURE_G
RUN_CONTROLLERS="${RUN_CONTROLLERS:-*,endpointslice}"
fi
# By default disable gkenetworkparamset controller in CCM
RUN_CCM_CONTROLLERS="${RUN_CCM_CONTROLLERS:-*,-gkenetworkparamset}"
# List of the set of feature gates recognized by the GCP CCM
export CCM_FEATURE_GATES="APIListChunking,APIPriorityAndFairness,APIResponseCompression,APIServerIdentity,APIServerTracing,AllAlpha,AllBeta,CustomResourceValidationExpressions,KMSv2,OpenAPIEnums,OpenAPIV3,RemainingItemCount,ServerSideFieldValidation,StorageVersionAPI,StorageVersionHash"

View File

@ -156,6 +156,9 @@ if [[ (( "${KUBE_FEATURE_GATES:-}" = *"AllAlpha=true"* ) || ( "${KUBE_FEATURE_GA
RUN_CONTROLLERS=${RUN_CONTROLLERS:-*,endpointslice}
fi
# By default disable gkenetworkparamset controller in CCM
RUN_CCM_CONTROLLERS="${RUN_CCM_CONTROLLERS:-*,-gkenetworkparamset}"
# Optional: set feature gates
# shellcheck disable=SC2034 # Variables sourced in other scripts.
FEATURE_GATES=${KUBE_FEATURE_GATES:-}

View File

@ -2246,7 +2246,6 @@ function start-kube-controller-manager {
cp "${src_file}" /etc/kubernetes/manifests
}
# (TODO/cloud-provider-gcp): Figure out how to inject
# Starts cloud controller manager.
# It prepares the log file, loads the docker image, calculates variables, sets them
# in the manifest file, and then copies the manifest file to /etc/kubernetes/manifests.
@ -2309,8 +2308,8 @@ function start-cloud-controller-manager {
echo "None of the given feature gates (${FEATURE_GATES}) were found to be safe to pass to the CCM"
fi
fi
if [[ -n "${RUN_CONTROLLERS:-}" ]]; then
params+=("--controllers=${RUN_CONTROLLERS}")
if [[ -n "${RUN_CCM_CONTROLLERS:-}" ]]; then
params+=("--controllers=${RUN_CCM_CONTROLLERS}")
fi
echo "Converting manifest for cloud provider controller-manager"
@ -3572,7 +3571,6 @@ function main() {
log-wrap 'StartKonnectivityServer' start-konnectivity-server
fi
log-wrap 'StartKubeControllerManager' start-kube-controller-manager
# (TODO/cloud-provider-gcp): Figure out how to inject
if [[ "${CLOUD_PROVIDER_FLAG:-gce}" == "external" ]]; then
log-wrap 'StartCloudControllerManager' start-cloud-controller-manager
fi

View File

@ -1278,6 +1278,11 @@ EOF
if [ -n "${RUN_CONTROLLERS:-}" ]; then
cat >>"$file" <<EOF
RUN_CONTROLLERS: $(yaml-quote "${RUN_CONTROLLERS}")
EOF
fi
if [ -n "${RUN_CCM_CONTROLLERS:-}" ]; then
cat >>"$file" <<EOF
RUN_CCM_CONTROLLERS: $(yaml-quote "${RUN_CCM_CONTROLLERS}")
EOF
fi
if [ -n "${PROVIDER_VARS:-}" ]; then