Skip to content

Commit

Permalink
Config calico_vxlan_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
xinnj committed Jun 17, 2024
1 parent 39576b1 commit b9cafdb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 0 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ default_vars:
download_keep_remote_cache: false
container_manager_on_localhost: 'docker'
image_command_tool_on_localhost: 'docker'
calico_vxlan_mode: 'CrossSubnet'
helm_enabled: true
ingress_nginx_enabled: true
ingress_nginx_extra_args:
Expand Down
13 changes: 13 additions & 0 deletions network.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ func initFlexNetwork() {
err = yaml.Unmarshal(data, &clusterVars)
check(err)

var calicoVxlanMode string
if extraVars["calico_vxlan_mode"] == nil {
calicoVxlanMode = "Always"
} else {
calicoVxlanMode = extraVars["calico_vxlan_mode"].(string)
}
calicoVxlanModes := []string{"Always", "CrossSubnet"}
initialOption := slices.Index(calicoVxlanModes, calicoVxlanMode)
formNetwork.AddDropDown("Calico Vxlan Mode: ", calicoVxlanModes, initialOption, func(option string, optionIndex int) {
calicoVxlanMode = option
})

var serviceCidr, podCidr string
if extraVars["kube_service_addresses"] == nil {
serviceCidr = clusterVars["kube_service_addresses"].(string)
Expand Down Expand Up @@ -105,6 +117,7 @@ func initFlexNetwork() {
}
}

extraVars["calico_vxlan_mode"] = calicoVxlanMode
extraVars["kube_service_addresses"] = serviceCidr
extraVars["kube_pods_subnet"] = podCidr
saveInventory()
Expand Down

0 comments on commit b9cafdb

Please sign in to comment.