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:
Kubernetes Submit Queue 2017-06-19 15:06:02 -07:00 committed by GitHub
commit c5f38f4478
3 changed files with 14 additions and 10 deletions

View File

@ -20,8 +20,6 @@ spec:
tolerations:
- key: CriticalAddonsOnly
operator: Exists
nodeSelector:
projectcalico.org/ds-ready: "true"
hostNetwork: true
containers:
- image: calico/typha:v0.2.2

View File

@ -66,10 +66,6 @@ function get-calico-typha-replicas {
if [[ "${NUM_NODES}" -gt "500" ]]; then
typha_count=5
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}"
}
@ -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_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}"
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
if [[ "${ENABLE_DEFAULT_STORAGE_CLASS:-}" == "true" ]]; then
setup-addon-manifests "addons" "storage-class/gce"

View File

@ -64,10 +64,6 @@ function get-calico-typha-replicas {
if [[ "${NUM_NODES}" -gt "500" ]]; then
typha_count=5
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}"
}
@ -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_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}"
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
if [[ "${ENABLE_DEFAULT_STORAGE_CLASS:-}" == "true" ]]; then
setup-addon-manifests "addons" "storage-class/gce"