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

Commit

Permalink
Set IPAM config based on specified network plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
caseydavenport committed Nov 2, 2018
1 parent 21f12a1 commit 9af6a1e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# Calico Version v3.1.3
# https://docs.projectcalico.org/v3.1/releases#v3.1.3
# This manifest includes the following component versions:
# calico/node:v3.1.3
# calico/cni:v3.1.3

apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down Expand Up @@ -136,9 +130,7 @@ data:
"datastore_type": "kubernetes",
"nodename": "__KUBERNETES_NODE_NAME__",
"mtu": 1500,
"ipam": {
"type": "azure-vnet-ipam"
},
"ipam": <calicoIPAMConfig>,
"policy": {
"type": "k8s"
},
Expand Down
10 changes: 1 addition & 9 deletions parts/k8s/addons/kubernetesmasteraddons-calico-daemonset.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# Calico Version v3.1.3
# https://docs.projectcalico.org/v3.1/releases#v3.1.3
# This manifest includes the following component versions:
# calico/node:v3.1.3
# calico/cni:v3.1.3

apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down Expand Up @@ -136,9 +130,7 @@ data:
"datastore_type": "kubernetes",
"nodename": "__KUBERNETES_NODE_NAME__",
"mtu": 1500,
"ipam": {
"type": "azure-vnet-ipam"
},
"ipam": <calicoIPAMConfig>,
"policy": {
"type": "k8s"
},
Expand Down
5 changes: 5 additions & 0 deletions parts/k8s/kubernetesmastercustomdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ 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"
{{else}}
sed -i "s|<calicoIPAMConfig>|{\"type\": \"host-local\", \"subnet\": \"usePodCidr\"}|g" "/etc/kubernetes/addons/calico-daemonset.yaml"
{{end}}
{{end}}
{{if eq .OrchestratorProfile.KubernetesConfig.NetworkPlugin "flannel"}}
sed -i "s|<kubeClusterCidr>|{{WrapAsParameter "kubeClusterCidr"}}|g" "/etc/kubernetes/addons/flannel-daemonset.yaml"
Expand Down

0 comments on commit 9af6a1e

Please sign in to comment.