Configurable image_repo and extra_vars (#4528)

* Configurable image_repo and extra_vars

* Configurable image_repo and extra_vars
This commit is contained in:
YundongYe 2020-05-18 11:56:51 +08:00 коммит произвёл GitHub
Родитель fdcc098e8b
Коммит bdf7f49902
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 38 добавлений и 2 удалений

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

@ -92,8 +92,16 @@ docker_image_tag: <% latest-release %>
# kube_image_repo: "gcr.io/google-containers"
# quay_image_repo: "quay.io"
# docker_image_repo: "docker.io"
# etcd_image_repo: "quay.io/coreos/etcd"
# pod_infra_image_repo: "gcr.io/google_containers/pause-{{ image_arch }}"
# 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: calico
# openpai_kubespray_extra_var:
# kay: value
# key: value
```
###### start kubernetes

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

@ -90,8 +90,16 @@ docker_image_tag: <% latest-release %>
# kube_image_repo: "gcr.io/google-containers"
# quay_image_repo: "quay.io"
# docker_image_repo: "docker.io"
# etcd_image_repo: "quay.io/coreos/etcd"
# pod_infra_image_repo: "gcr.io/google_containers/pause-{{ image_arch }}"
# 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: calico
# openpai_kubespray_extra_var:
# kay: value
# key: value
```
###### Check environment requirement

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

@ -58,7 +58,13 @@ docker_image_tag: <% latest-release %>
# kube_image_repo: "gcr.io/google-containers"
# quay_image_repo: "quay.io"
# docker_image_repo: "docker.io"
# etcd_image_repo: "quay.io/coreos/etcd"
# pod_infra_image_repo: "gcr.io/google_containers/pause-{{ image_arch }}"
# 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: calico
# openpai_kubespray_extra_var:
# kay: value
# key: value

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

@ -378,6 +378,14 @@ kube_image_repo: "{{ env['cfg']['kube_image_repo'] }}"
quay_image_repo: "{{ env['cfg']['quay_image_repo'] }}"
{%- endif %}
{%- if 'etcd_image_repo' in env['cfg'] %}
etcd_image_repo: "{{ env['cfg']['etcd_image_repo'] }}"
{%- endif %}
{%- if 'pod_infra_image_repo' in env['cfg'] %}
pod_infra_image_repo: "{{ env['cfg']['pod_infra_image_repo'] }}"
{%- endif %}
{%- if 'docker_image_repo' in env['cfg'] %}
docker_image_repo: "{{ env['cfg']['docker_image_repo'] }}"
{%- endif %}
@ -393,3 +401,9 @@ 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('calico') }}
{%- if 'openpai_kubespray_extra_var' in env['cfg'] %}
{% for key in env['cfg']['openpai_kubespray_extra_var'] %}
{{ key }}: "{{ env['cfg']['openpai_kubespray_extra_var'][key] }}"
{% endfor %}
{%- endif %}