diff --git a/cluster/addons/calico-policy-controller/typha-deployment.yaml b/cluster/addons/calico-policy-controller/typha-deployment.yaml index 8b4cf0ddc94..2b49b09e5c5 100644 --- a/cluster/addons/calico-policy-controller/typha-deployment.yaml +++ b/cluster/addons/calico-policy-controller/typha-deployment.yaml @@ -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 diff --git a/cluster/gce/container-linux/configure-helper.sh b/cluster/gce/container-linux/configure-helper.sh index d11700cd481..f7bf160cbae 100755 --- a/cluster/gce/container-linux/configure-helper.sh +++ b/cluster/gce/container-linux/configure-helper.sh @@ -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" diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index 988a69967f7..cad49695ba1 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -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"