Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
chore: Update calico to 3.5 and allow calico to work with azure CNI (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
song-jiang authored and jackfrancis committed Apr 1, 2019
1 parent 57e4a41 commit 4b9a5bd
Show file tree
Hide file tree
Showing 10 changed files with 2,876 additions and 2,710 deletions.
929 changes: 478 additions & 451 deletions parts/k8s/addons/1.10/kubernetesmasteraddons-calico-daemonset.yaml

Large diffs are not rendered by default.

929 changes: 478 additions & 451 deletions parts/k8s/addons/1.11/kubernetesmasteraddons-calico-daemonset.yaml

Large diffs are not rendered by default.

929 changes: 478 additions & 451 deletions parts/k8s/addons/1.7/kubernetesmasteraddons-calico-daemonset.yaml

Large diffs are not rendered by default.

929 changes: 478 additions & 451 deletions parts/k8s/addons/1.8/kubernetesmasteraddons-calico-daemonset.yaml

Large diffs are not rendered by default.

929 changes: 478 additions & 451 deletions parts/k8s/addons/1.9/kubernetesmasteraddons-calico-daemonset.yaml

Large diffs are not rendered by default.

927 changes: 478 additions & 449 deletions parts/k8s/addons/kubernetesmasteraddons-calico-daemonset.yaml

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions parts/k8s/kubernetesconfigs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,10 @@ configureCNI() {
retrycmd_if_failure 120 5 25 modprobe br_netfilter || exit $ERR_MODPROBE_FAIL
echo -n "br_netfilter" > /etc/modules-load.d/br_netfilter.conf
if [[ "${NETWORK_PLUGIN}" = "azure" ]]; then
if [[ "${NETWORK_POLICY}" != "calico" ]]; then
mv $CNI_BIN_DIR/10-azure.conflist $CNI_CONFIG_DIR/
chmod 600 $CNI_CONFIG_DIR/10-azure.conflist
mv $CNI_BIN_DIR/10-azure.conflist $CNI_CONFIG_DIR/
chmod 600 $CNI_CONFIG_DIR/10-azure.conflist
if [[ "${NETWORK_POLICY}" == "calico" ]]; then
sed -i 's#"mode":"bridge"#"mode":"transparent"#g' $CNI_CONFIG_DIR/10-azure.conflist
fi
/sbin/ebtables -t nat --list
fi
Expand Down
3 changes: 2 additions & 1 deletion parts/k8s/kubernetesmastercustomdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,10 @@ MASTER_ARTIFACTS_CONFIG_PLACEHOLDER
{{if eq .OrchestratorProfile.KubernetesConfig.NetworkPolicy "calico"}}
sed -i "s|<kubeClusterCidr>|{{WrapAsParameter "kubeClusterCidr"}}|g" /etc/kubernetes/addons/calico-daemonset.yaml
{{if eq .OrchestratorProfile.KubernetesConfig.NetworkPlugin "azure"}}
sed -i "s|<calicoIPAMConfig>|{\"type\": \"azure-vnet-ipam\"}|g" /etc/kubernetes/addons/calico-daemonset.yaml
sed -i "/initContainers/,/cni-net-dir/d" /etc/kubernetes/addons/calico-daemonset.yaml
{{else}}
sed -i "s|<calicoIPAMConfig>|{\"type\": \"host-local\", \"subnet\": \"usePodCidr\"}|g" /etc/kubernetes/addons/calico-daemonset.yaml
sed -i "s|azv|cali|g" /etc/kubernetes/addons/calico-daemonset.yaml
{{end}}
{{end}}
{{if eq .OrchestratorProfile.KubernetesConfig.NetworkPlugin "flannel"}}
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,5 +364,5 @@ func azureNetworkPolicyAddonEnabled(o *OrchestratorProfile) *bool {
}

func azureCNINetworkMonitorAddonEnabled(o *OrchestratorProfile) *bool {
return to.BoolPtr(o.IsAzureCNI())
return to.BoolPtr(o.IsAzureCNI() && o.KubernetesConfig.NetworkPolicy != NetworkPolicyCalico)
}
2 changes: 1 addition & 1 deletion pkg/engine/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const (
NetworkPluginAzure = "azure"
// NetworkPluginKubenet is the string expression for kubenet network plugin
NetworkPluginKubenet = "kubenet"
// NetworkPluginFlannel is the string expression for flannel network policy config option
// NetworkPluginFlannel is the string expression for flannel network plugin
NetworkPluginFlannel = "flannel"
// DefaultKubeHeapsterDeploymentAddonName is the name of the kube-heapster-deployment addon
DefaultKubeHeapsterDeploymentAddonName = "kube-heapster-deployment"
Expand Down

0 comments on commit 4b9a5bd

Please sign in to comment.