From 62a8961d8fdbdf6c05a50c56eb03927aa259c00b Mon Sep 17 00:00:00 2001 From: rongzhang Date: Sun, 23 Dec 2018 00:15:09 +0800 Subject: [PATCH] Fix installation using CRIO about download images failed --- .../download/templates/kubeadm-images.yaml.j2 | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/roles/download/templates/kubeadm-images.yaml.j2 b/roles/download/templates/kubeadm-images.yaml.j2 index f15fe0fef..2e0d9ef61 100644 --- a/roles/download/templates/kubeadm-images.yaml.j2 +++ b/roles/download/templates/kubeadm-images.yaml.j2 @@ -1,3 +1,16 @@ +{% if kube_version is version('v1.12.0', '>=') %} +apiVersion: kubeadm.k8s.io/v1beta1 +kind: InitConfiguration +nodeRegistration: +{% if container_manager == 'crio' %} + criSocket: /var/run/crio/crio.sock +{% elif container_manager == 'rkt' %} + criSocket: /var/run/rkt.sock +{% else %} + criSocket: /var/run/dockershim.sock +{% endif %} +--- +{% endif %} {% if kube_version is version('v1.11.0', '<') %} apiVersion: kubeadm.k8s.io/v1alpha1 {% elif kube_version is version('v1.11.0', '>=') and kube_version is version('v1.12.0', '<') %} @@ -14,3 +27,13 @@ kind: ClusterConfiguration {% endif %} imageRepository: {{ kube_image_repo }} kubernetesVersion: {{ kube_version }} +{% if kube_version is version('v1.12.0', '<') %} +nodeRegistration: +{% if container_manager == 'crio' %} + criSocket: /var/run/crio/crio.sock +{% elif container_manager == 'rkt' %} + criSocket: /var/run/rkt.sock +{% else %} + criSocket: /var/run/dockershim.sock +{% endif %} +{% endif %}