mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Merge pull request #47669 from caseydavenport/fix-typha
Automatic merge from submit-queue Set Typha replica count to 0 when Calico is not enabled **What this PR does / why we need it**: A replacement for https://github.com/kubernetes/kubernetes/pull/47624, which turned out not to be the right fix. **Which issue this PR fixes** https://github.com/kubernetes/kubernetes/issues/47622 **Release note**: ```release-note NONE ```
This commit is contained in:
commit
c5f38f4478
@ -20,8 +20,6 @@ spec:
|
|||||||
tolerations:
|
tolerations:
|
||||||
- key: CriticalAddonsOnly
|
- key: CriticalAddonsOnly
|
||||||
operator: Exists
|
operator: Exists
|
||||||
nodeSelector:
|
|
||||||
projectcalico.org/ds-ready: "true"
|
|
||||||
hostNetwork: true
|
hostNetwork: true
|
||||||
containers:
|
containers:
|
||||||
- image: calico/typha:v0.2.2
|
- image: calico/typha:v0.2.2
|
||||||
|
@ -66,10 +66,6 @@ function get-calico-typha-replicas {
|
|||||||
if [[ "${NUM_NODES}" -gt "500" ]]; then
|
if [[ "${NUM_NODES}" -gt "500" ]]; then
|
||||||
typha_count=5
|
typha_count=5
|
||||||
fi
|
fi
|
||||||
if [[ "${NETWORK_POLICY_PROVIDER:-}" != "calico" ]]; then
|
|
||||||
# We're not configured to use Calico, so don't start any Typhas.
|
|
||||||
typha_count=0
|
|
||||||
fi
|
|
||||||
echo "${typha_count}"
|
echo "${typha_count}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1268,6 +1264,13 @@ function start-kube-addons {
|
|||||||
sed -i -e "s@__CALICO_NODE_CPU__@$(get-calico-node-cpu)@g" "${ds_file}"
|
sed -i -e "s@__CALICO_NODE_CPU__@$(get-calico-node-cpu)@g" "${ds_file}"
|
||||||
sed -i -e "s@__CALICO_TYPHA_CPU__@$(get-calico-typha-cpu)@g" "${typha_dep_file}"
|
sed -i -e "s@__CALICO_TYPHA_CPU__@$(get-calico-typha-cpu)@g" "${typha_dep_file}"
|
||||||
sed -i -e "s@__CALICO_TYPHA_REPLICAS__@$(get-calico-typha-replicas)@g" "${typha_dep_file}"
|
sed -i -e "s@__CALICO_TYPHA_REPLICAS__@$(get-calico-typha-replicas)@g" "${typha_dep_file}"
|
||||||
|
else
|
||||||
|
# If not configured to use Calico, the set the typha replica count to 0, but only if the
|
||||||
|
# addon is present.
|
||||||
|
local -r typha_dep_file="${dst_dir}/calico-policy-controller/typha-deployment.yaml"
|
||||||
|
if [[ -e $typha_dep_file ]]; then
|
||||||
|
sed -i -e "s@__CALICO_TYPHA_REPLICAS__@0@g" "${typha_dep_file}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ "${ENABLE_DEFAULT_STORAGE_CLASS:-}" == "true" ]]; then
|
if [[ "${ENABLE_DEFAULT_STORAGE_CLASS:-}" == "true" ]]; then
|
||||||
setup-addon-manifests "addons" "storage-class/gce"
|
setup-addon-manifests "addons" "storage-class/gce"
|
||||||
|
@ -64,10 +64,6 @@ function get-calico-typha-replicas {
|
|||||||
if [[ "${NUM_NODES}" -gt "500" ]]; then
|
if [[ "${NUM_NODES}" -gt "500" ]]; then
|
||||||
typha_count=5
|
typha_count=5
|
||||||
fi
|
fi
|
||||||
if [[ "${NETWORK_POLICY_PROVIDER:-}" != "calico" ]]; then
|
|
||||||
# We're not configured to use Calico, so don't start any Typhas.
|
|
||||||
typha_count=0
|
|
||||||
fi
|
|
||||||
echo "${typha_count}"
|
echo "${typha_count}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1698,6 +1694,13 @@ function start-kube-addons {
|
|||||||
sed -i -e "s@__CALICO_NODE_CPU__@$(get-calico-node-cpu)@g" "${ds_file}"
|
sed -i -e "s@__CALICO_NODE_CPU__@$(get-calico-node-cpu)@g" "${ds_file}"
|
||||||
sed -i -e "s@__CALICO_TYPHA_CPU__@$(get-calico-typha-cpu)@g" "${typha_dep_file}"
|
sed -i -e "s@__CALICO_TYPHA_CPU__@$(get-calico-typha-cpu)@g" "${typha_dep_file}"
|
||||||
sed -i -e "s@__CALICO_TYPHA_REPLICAS__@$(get-calico-typha-replicas)@g" "${typha_dep_file}"
|
sed -i -e "s@__CALICO_TYPHA_REPLICAS__@$(get-calico-typha-replicas)@g" "${typha_dep_file}"
|
||||||
|
else
|
||||||
|
# If not configured to use Calico, the set the typha replica count to 0, but only if the
|
||||||
|
# addon is present.
|
||||||
|
local -r typha_dep_file="${dst_dir}/calico-policy-controller/typha-deployment.yaml"
|
||||||
|
if [[ -e $typha_dep_file ]]; then
|
||||||
|
sed -i -e "s@__CALICO_TYPHA_REPLICAS__@0@g" "${typha_dep_file}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ "${ENABLE_DEFAULT_STORAGE_CLASS:-}" == "true" ]]; then
|
if [[ "${ENABLE_DEFAULT_STORAGE_CLASS:-}" == "true" ]]; then
|
||||||
setup-addon-manifests "addons" "storage-class/gce"
|
setup-addon-manifests "addons" "storage-class/gce"
|
||||||
|
Loading…
Reference in New Issue
Block a user