From 5f2bb3319b79315bead7d19b401176772e358d0a Mon Sep 17 00:00:00 2001 From: Anthony Haussmann Date: Fri, 23 Sep 2016 17:44:09 +0200 Subject: [PATCH 1/4] Correct nslookup command Change nslookup command to check the right cluster_name --- roles/kubernetes-apps/ansible/templates/kubedns-rc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kubernetes-apps/ansible/templates/kubedns-rc.yml b/roles/kubernetes-apps/ansible/templates/kubedns-rc.yml index e58639deb..8e80b0e9a 100644 --- a/roles/kubernetes-apps/ansible/templates/kubedns-rc.yml +++ b/roles/kubernetes-apps/ansible/templates/kubedns-rc.yml @@ -91,7 +91,7 @@ spec: # net memory requested by the pod constant. memory: 50Mi args: - - -cmd=nslookup kubernetes.default.svc.cluster.local 127.0.0.1 >/dev/null && nslookup kubernetes.default.svc.cluster.local 127.0.0.1:10053 >/dev/null + - -cmd=nslookup kubernetes.default.svc.{{ cluster_name }} 127.0.0.1 >/dev/null && nslookup kubernetes.default.svc.{{ cluster_name }} 127.0.0.1:10053 >/dev/null - -port=8080 - -quiet ports: From a3fe1e78dfad0d1d888e5822344bb383659484ed Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Mon, 26 Sep 2016 12:02:19 +0300 Subject: [PATCH 2/4] Copy hyperkube CNI plugins when using weave --- roles/network_plugin/weave/tasks/main.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/roles/network_plugin/weave/tasks/main.yml b/roles/network_plugin/weave/tasks/main.yml index eb56d8c9b..25a9837db 100644 --- a/roles/network_plugin/weave/tasks/main.yml +++ b/roles/network_plugin/weave/tasks/main.yml @@ -9,6 +9,26 @@ notify: - restart docker +- name: Weave | Determine hyperkube cni to use depending of the version of kube + set_fact: + use_hyperkube_cni: > + {%- if kube_version | version_compare('v1.3.4','>=') -%} + true + {%- elif kube_version | version_compare('v1.3.4','<') -%} + false + {%- else -%} + {{ ErrorCannotRecognizeVersion }} + {%- endif -%} + +- name: Weave | Copy cni plugins from hyperkube + command: "/usr/bin/docker run --rm -v /opt/cni/bin:/cnibindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /bin/cp -r /opt/cni/bin/. /cnibindir/" + register: cni_task_result + until: cni_task_result.rc == 0 + retries: 4 + delay: "{{ retry_stagger | random + 3 }}" + changed_when: false + when: "{{ use_hyperkube_cni|bool }}" + - name: Weave | Install weave command: rsync -piu "{{ local_release_dir }}/weave/bin/weave" "{{ bin_dir }}/weave" changed_when: false From e4a48cf53b2e02ea42923ca90e4ffe4992bdbde8 Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Thu, 22 Sep 2016 12:52:04 +0300 Subject: [PATCH 3/4] Add Docker 1.12.1 version --- roles/docker/vars/debian.yml | 2 +- roles/docker/vars/fedora.yml | 2 +- roles/docker/vars/ubuntu-16.04.yml | 4 ++-- roles/docker/vars/ubuntu.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/docker/vars/debian.yml b/roles/docker/vars/debian.yml index 6574f451f..192517097 100644 --- a/roles/docker/vars/debian.yml +++ b/roles/docker/vars/debian.yml @@ -6,7 +6,7 @@ docker_versioned_pkg: 1.9: docker-engine=1.9.1-0~{{ ansible_distribution_release|lower }} 1.10: docker-engine=1.10.3-0~{{ ansible_distribution_release|lower }} 1.11: docker-engine=1.11.2-0~{{ ansible_distribution_release|lower }} - 1.12: docker-engine=1.12.0-0~{{ ansible_distribution_release|lower }} + 1.12: docker-engine=1.12.1-0~{{ ansible_distribution_release|lower }} docker_package_info: pkg_mgr: apt diff --git a/roles/docker/vars/fedora.yml b/roles/docker/vars/fedora.yml index a6aaf7f56..3fd06b4b3 100644 --- a/roles/docker/vars/fedora.yml +++ b/roles/docker/vars/fedora.yml @@ -5,7 +5,7 @@ docker_versioned_pkg: 1.9: docker-1:1.9.1 1.10: docker-1:1.10.1 1.11: docker-1:1.11.2 - 1.12: docker-1:1.12.0 + 1.12: docker-1:1.12.1 docker_package_info: pkg_mgr: dnf diff --git a/roles/docker/vars/ubuntu-16.04.yml b/roles/docker/vars/ubuntu-16.04.yml index 690e447c3..208fe5edc 100644 --- a/roles/docker/vars/ubuntu-16.04.yml +++ b/roles/docker/vars/ubuntu-16.04.yml @@ -2,11 +2,11 @@ docker_version: 1.11 docker_kernel_min_version: '3.2' -# https://apt.dockerproject.org/repo/dists/ubuntu-trusty/main/filelist +# https://apt.dockerproject.org/repo/dists/ubuntu-xenial/main/filelist docker_versioned_pkg: latest: docker-engine 1.11: docker-engine=1.11.1-0~{{ ansible_distribution_release|lower }} - 1.12: docker-engine=1.12.0-0~{{ ansible_distribution_release|lower }} + 1.12: docker-engine=1.12.1-0~{{ ansible_distribution_release|lower }} docker_package_info: pkg_mgr: apt diff --git a/roles/docker/vars/ubuntu.yml b/roles/docker/vars/ubuntu.yml index 0f92d23c1..1bf8a44a0 100644 --- a/roles/docker/vars/ubuntu.yml +++ b/roles/docker/vars/ubuntu.yml @@ -7,7 +7,7 @@ docker_versioned_pkg: 1.9: docker-engine=1.9.0-0~{{ ansible_distribution_release|lower }} 1.10: docker-engine=1.10.3-0~{{ ansible_distribution_release|lower }} 1.11: docker-engine=1.11.1-0~{{ ansible_distribution_release|lower }} - 1.12: docker-engine=1.12.0-0~{{ ansible_distribution_release|lower }} + 1.12: docker-engine=1.12.1-0~{{ ansible_distribution_release|lower }} docker_package_info: pkg_mgr: apt From 7dde23e60baec32d63851cc2aea29d9f56b31afb Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 26 Sep 2016 13:47:34 +0200 Subject: [PATCH 4/4] Add more DNS docs Signed-off-by: Bogdan Dobrelya --- docs/dns-stack.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/dns-stack.md b/docs/dns-stack.md index ae631a44b..8d72d9e2c 100644 --- a/docs/dns-stack.md +++ b/docs/dns-stack.md @@ -1,6 +1,38 @@ K8s DNS stack by Kargo ====================== +Kargo configures a [Kubernetes DNS](http://kubernetes.io/docs/admin/dns/) +[cluster add-on](http://releases.k8s.io/master/cluster/addons/README.md) +to serve as an authoritative DNS server for a given ``dns_domain`` and its +``svc, default.svc`` default subdomains (a total of ``ndots: 5`` max levels). + +Note, additional search (sub)domains may be defined in the ``searchdomains`` +var. And additional recursive DNS resolvers in the `` upstream_dns_servers``, +``nameservers`` vars. Intranet DNS resolvers should be specified in the first +place, followed by external resolvers, for example: + +``` +skip_dnsmasq: true +nameservers: [8.8.8.8] +upstream_dns_servers: [172.18.32.6] +``` +or +``` +skip_dnsmasq: false +upstream_dns_servers: [172.18.32.6, 172.18.32.7, 8.8.8.8, 8.8.8.4] +``` + +Remember the limitations (the vars are explained below): + +* the ``searchdomains`` have a limitation of a 6 names and 256 chars + length. Due to default ``svc, default.svc`` subdomains, the actual + limits are a 4 names and 239 chars respectively. +* the ``nameservers`` have a limitation of a 3 servers, although there + is a way to mitigate that with the ``upstream_dns_servers``, + see below. Anyway, the ``nameservers`` can take no more than a two + custom DNS servers because of one slot is reserved for a Kubernetes + cluster needs. + Here is an approximate picture of how DNS things working and being configured by Kargo ansible playbooks: