Merge pull request #115619 from jprzychodzen/cluster-kcm-ccm

[GCE] [cluster] Split run controllers per controller-manager
This commit is contained in:
Kubernetes Prow Robot 2023-03-14 09:39:34 -07:00 committed by GitHub
commit c2ad27aaa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 4 deletions

View File

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

View File

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

View File

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

View File

@ -1274,6 +1274,11 @@ EOF
if [ -n "${RUN_CONTROLLERS:-}" ]; then if [ -n "${RUN_CONTROLLERS:-}" ]; then
cat >>"$file" <<EOF cat >>"$file" <<EOF
RUN_CONTROLLERS: $(yaml-quote "${RUN_CONTROLLERS}") 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 EOF
fi fi
if [ -n "${PROVIDER_VARS:-}" ]; then if [ -n "${PROVIDER_VARS:-}" ]; then