Change default network plugin from weave to calico (#4519)

This commit is contained in:
YundongYe 2020-05-13 13:24:16 +08:00 коммит произвёл GitHub
Родитель 861d58a19c
Коммит dd08930431
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 27 добавлений и 7 удалений

Просмотреть файл

@ -93,7 +93,7 @@ docker_image_tag: <% latest-release %>
# quay_image_repo: "quay.io" # quay_image_repo: "quay.io"
# docker_image_repo: "docker.io" # docker_image_repo: "docker.io"
# openpai_kube_network_plugin: weave # openpai_kube_network_plugin: calico
``` ```
###### start kubernetes ###### start kubernetes

Просмотреть файл

@ -91,7 +91,7 @@ docker_image_tag: <% latest-release %>
# quay_image_repo: "quay.io" # quay_image_repo: "quay.io"
# docker_image_repo: "docker.io" # docker_image_repo: "docker.io"
# openpai_kube_network_plugin: weave # openpai_kube_network_plugin: calico
``` ```
###### Check environment requirement ###### 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" # 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" # 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) # 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 # 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 # 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) # 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 # 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 cd ${HOME}/pai-deploy/pai/contrib/kubespray
mkdir -p ${HOME}/pai-deploy/cluster-cfg 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/openpai.yml ${HOME}/pai-deploy/kubespray/inventory/pai/
cp ${HOME}/pai-deploy/cluster-cfg/hosts.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) master_list = csv_reader(args.masterlist)
head_node = master_list[0] 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 = { environment = {
'master': master_list, 'master': master_list,
'worker': csv_reader(args.worklist), 'worker': csv_reader(args.worklist),
'cfg': load_yaml_config(args.configuration), 'cfg': cluster_config,
'head_node': head_node 'head_node': head_node
} }