You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.5 KiB

Explicitely set etcd endpoint in kubeadm-images.yaml (#4063) Currently, the task `container_download | download images for kubeadm config images` fetches etcd image even though it's not required (etcd is bootstrapped by kubespray, not kubeadm). `kubeadm-images.yaml` is only a subset of `kubeadm-config.yaml`, therefore ``kubeadm config images pull` will try to get all this list (including etcd) ``` # kubeadm config images list --config /etc/kubernetes/kubeadm-images.yaml k8s.gcr.io/kube-apiserver:v1.13.2 k8s.gcr.io/kube-controller-manager:v1.13.2 k8s.gcr.io/kube-scheduler:v1.13.2 k8s.gcr.io/kube-proxy:v1.13.2 k8s.gcr.io/pause:3.1 k8s.gcr.io/etcd:3.2.24 k8s.gcr.io/coredns:1.2.6 ``` When using the `kubeadm-config.yaml` though, it doesn't list etcd image: ``` # kubeadm config images list --config /etc/kubernetes/kubeadm-config.yaml k8s.gcr.io/kube-apiserver:v1.13.2 k8s.gcr.io/kube-controller-manager:v1.13.2 k8s.gcr.io/kube-scheduler:v1.13.2 k8s.gcr.io/kube-proxy:v1.13.2 k8s.gcr.io/pause:3.1 k8s.gcr.io/coredns:1.2.6 ``` This change just adds the etcd endpoints in the `kubeadm-images.yaml` to give a hint to kubeadm it doesn't need etcd image for its boostrapping as etcd is "external". I confess it is a ugly hack, a better way would be to use a single `kubeadm-config.yaml` for both tasks, but they are triggered by different roles (`kubeadm-images.yaml` is used by download, `kubeadm-config.yaml` by kubernetes/master) at different steps and I didn't want to refactor too many things to prevent breakage. This is specially useful for offline installation where a whitelist of container images is mirrored on a local private container registry. `k8s.gcr.io/etcd` and `quay.io/coreos/etcd` are two different repositories hosting the same images but using *different tags*! * coreos/etcd:v3.2.24 * k8s.gcr.io/etcd:3.2.24 (note the missing 'v' in the tag name)
5 years ago
  1. {% if kube_version is version('v1.12.0', '>=') %}
  2. {% if kube_version is version('v1.12.0', '>=') and kube_version is version('v1.13.0', '<') %}
  3. apiVersion: kubeadm.k8s.io/v1alpha3
  4. {% else %}
  5. apiVersion: kubeadm.k8s.io/v1beta1
  6. {% endif %}
  7. kind: InitConfiguration
  8. nodeRegistration:
  9. {% if container_manager == 'crio' %}
  10. criSocket: /var/run/crio/crio.sock
  11. {% elif container_manager == 'rkt' %}
  12. criSocket: /var/run/rkt.sock
  13. {% else %}
  14. criSocket: /var/run/dockershim.sock
  15. {% endif %}
  16. ---
  17. {% endif %}
  18. {% if kube_version is version('v1.11.0', '<') %}
  19. apiVersion: kubeadm.k8s.io/v1alpha1
  20. {% elif kube_version is version('v1.11.0', '>=') and kube_version is version('v1.12.0', '<') %}
  21. apiVersion: kubeadm.k8s.io/v1alpha2
  22. {% elif kube_version is version('v1.12.0', '>=') and kube_version is version('v1.13.0', '<') %}
  23. apiVersion: kubeadm.k8s.io/v1alpha3
  24. {% else %}
  25. apiVersion: kubeadm.k8s.io/v1beta1
  26. {% endif %}
  27. {% if kube_version is version('v1.12.0', '<') %}
  28. kind: MasterConfiguration
  29. {% else %}
  30. kind: ClusterConfiguration
  31. {% endif %}
  32. imageRepository: {{ kube_image_repo }}
  33. kubernetesVersion: {{ kube_version }}
  34. etcd:
  35. external:
  36. endpoints:
  37. {% for endpoint in etcd_access_addresses.split(',') %}
  38. - {{ endpoint }}
  39. {% endfor %}
  40. {% if kube_version is version('v1.12.0', '<') %}
  41. nodeRegistration:
  42. {% if container_manager == 'crio' %}
  43. criSocket: /var/run/crio/crio.sock
  44. {% elif container_manager == 'rkt' %}
  45. criSocket: /var/run/rkt.sock
  46. {% else %}
  47. criSocket: /var/run/dockershim.sock
  48. {% endif %}
  49. {% endif %}