зеркало из https://github.com/microsoft/pai.git
Change default network plugin from weave to calico (#4519)
This commit is contained in:
Родитель
861d58a19c
Коммит
dd08930431
|
@ -93,7 +93,7 @@ docker_image_tag: <% latest-release %>
|
|||
# quay_image_repo: "quay.io"
|
||||
# docker_image_repo: "docker.io"
|
||||
|
||||
# openpai_kube_network_plugin: weave
|
||||
# openpai_kube_network_plugin: calico
|
||||
```
|
||||
|
||||
###### start kubernetes
|
||||
|
|
|
@ -91,7 +91,7 @@ docker_image_tag: <% latest-release %>
|
|||
# quay_image_repo: "quay.io"
|
||||
# docker_image_repo: "docker.io"
|
||||
|
||||
# openpai_kube_network_plugin: weave
|
||||
# openpai_kube_network_plugin: calico
|
||||
```
|
||||
|
||||
###### Check environment requirement
|
||||
|
|
|
@ -61,4 +61,4 @@ docker_image_tag: <% latest-release %>
|
|||
# kubeadm_download_url: "https://storage.googleapis.com/kubernetes-release/release/{{ kubeadm_version }}/bin/linux/{{ image_arch }}/kubeadm"
|
||||
# hyperkube_download_url: "https://storage.googleapis.com/kubernetes-release/release/{{ kube_version }}/bin/linux/{{ image_arch }}/hyperkube"
|
||||
|
||||
# openpai_kube_network_plugin: weave
|
||||
# openpai_kube_network_plugin: calico
|
|
@ -161,7 +161,7 @@ k8s_image_pull_policy: Always
|
|||
|
||||
# Choose network plugin (cilium, calico, contiv, weave or flannel. Use cni for generic cni plugin)
|
||||
# Can also be set to 'cloud', which lets the cloud provider setup appropriate routing
|
||||
kube_network_plugin: weave
|
||||
kube_network_plugin: calico
|
||||
|
||||
|
||||
# Setting multi_networking to true will install Multus: https://github.com/intel/multus-cni
|
||||
|
|
|
@ -392,4 +392,4 @@ hyperkube_download_url: "{{ env['cfg']['hyperkube_download_url'] }}"
|
|||
|
||||
# Choose network plugin (cilium, calico, contiv, weave or flannel. Use cni for generic cni plugin)
|
||||
# Can also be set to 'cloud', which lets the cloud provider setup appropriate routing
|
||||
kube_network_plugin: {{ env["cfg"]['openpai_kube_network_plugin'] | default('weave') }}
|
||||
kube_network_plugin: {{ env["cfg"]['openpai_kube_network_plugin'] | default('calico') }}
|
|
@ -20,7 +20,7 @@ done
|
|||
|
||||
cd ${HOME}/pai-deploy/pai/contrib/kubespray
|
||||
mkdir -p ${HOME}/pai-deploy/cluster-cfg
|
||||
python3 ${HOME}/pai-deploy/pai/contrib/kubespray/script/k8s-generator.py -m ${MASTER_LIST} -w ${WORKER_LIST} -c ${CLUSTER_CONFIG} -o ${HOME}/pai-deploy/cluster-cfg
|
||||
python3 ${HOME}/pai-deploy/pai/contrib/kubespray/script/k8s-generator.py -m ${MASTER_LIST} -w ${WORKER_LIST} -c ${CLUSTER_CONFIG} -o ${HOME}/pai-deploy/cluster-cfg || exit $?
|
||||
|
||||
cp ${HOME}/pai-deploy/cluster-cfg/openpai.yml ${HOME}/pai-deploy/kubespray/inventory/pai/
|
||||
cp ${HOME}/pai-deploy/cluster-cfg/hosts.yml ${HOME}/pai-deploy/kubespray/inventory/pai/
|
||||
|
|
|
@ -87,11 +87,31 @@ def main():
|
|||
|
||||
master_list = csv_reader(args.masterlist)
|
||||
head_node = master_list[0]
|
||||
cluster_config = load_yaml_config(args.configuration)
|
||||
|
||||
if 'openpai_kube_network_plugin' not in cluster_config or cluster_config['openpai_kube_network_plugin'] != 'weave':
|
||||
count_input = 0
|
||||
while True:
|
||||
user_input = raw_input("Are your cluster is in Azure cloud or not? (Y/N) (case sensitive)")
|
||||
if user_input == "N":
|
||||
break
|
||||
elif user_input == "Y":
|
||||
break
|
||||
else:
|
||||
print(" Please type Y or N. It's case sensitive.")
|
||||
count_input = count_input + 1
|
||||
if count_input == 3:
|
||||
logger.warning("3 Times......... Sorry, we will force stopping your operation.")
|
||||
sys.exit(1)
|
||||
if user_input == "Y" and cluster_config['openpai_kube_network_plugin'] == 'calico':
|
||||
logger.warning("Azure does not support calico, please change the openpai_kube_network_plugin to weave")
|
||||
logger.warning("https://docs.projectcalico.org/reference/public-cloud/azure#why-doesnt-azure-support-calico-networking")
|
||||
sys.exit(1)
|
||||
|
||||
environment = {
|
||||
'master': master_list,
|
||||
'worker': csv_reader(args.worklist),
|
||||
'cfg': load_yaml_config(args.configuration),
|
||||
'cfg': cluster_config,
|
||||
'head_node': head_node
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче