From a5137affebf614c00a443472e2eb1514ebe4f5e8 Mon Sep 17 00:00:00 2001 From: Chad Swenson Date: Mon, 17 Oct 2016 11:19:38 -0500 Subject: [PATCH 1/3] Hostname alias fixes Change the kubelet --hostname-override flag to use the ansible_hostname variable which should be more consistent with the value required by cloud providers Add ansible_hostname alias to /etc/hosts when it is different from inventory_hostname to overcome node name limitations see https://github.com/kubernetes/kubernetes/issues/22770 Signed-off-by: Chad Swenson --- roles/kubernetes/node/templates/kubelet.j2 | 2 +- roles/kubernetes/preinstall/tasks/etchosts.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/kubernetes/node/templates/kubelet.j2 b/roles/kubernetes/node/templates/kubelet.j2 index f55feefa9..39283c9a2 100644 --- a/roles/kubernetes/node/templates/kubelet.j2 +++ b/roles/kubernetes/node/templates/kubelet.j2 @@ -14,7 +14,7 @@ KUBELET_ADDRESS="--address={{ ip | default("0.0.0.0") }}" # The port for the info server to serve on # KUBELET_PORT="--port=10250" # You may leave this blank to use the actual hostname -KUBELET_HOSTNAME="--hostname-override={{ inventory_hostname }}" +KUBELET_HOSTNAME="--hostname-override={{ ansible_hostname }}" {% if inventory_hostname in groups['kube-master'] and inventory_hostname not in groups['kube-node'] %} KUBELET_REGISTER_NODE="--register-node=false" {% endif %} diff --git a/roles/kubernetes/preinstall/tasks/etchosts.yml b/roles/kubernetes/preinstall/tasks/etchosts.yml index 6f21ffa8f..5c5e1a45f 100644 --- a/roles/kubernetes/preinstall/tasks/etchosts.yml +++ b/roles/kubernetes/preinstall/tasks/etchosts.yml @@ -4,7 +4,7 @@ dest: /etc/hosts block: |- {% for item in groups['all'] -%} - {{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(hostvars[item].ansible_default_ipv4.address)) }} {{ item }} + {{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(hostvars[item].ansible_default_ipv4.address)) }}{% if (item != hostvars[item]['ansible_hostname']) %} {{ hostvars[item]['ansible_hostname'] }}{% endif %} {{ item }} {% endfor %} state: present create: yes From d8b06f3e2feb134cbb1b75d8a070fce959dc2a31 Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Tue, 18 Oct 2016 14:28:28 +0400 Subject: [PATCH 2/3] Ignore changes on check resolvconf task --- roles/dnsmasq/tasks/resolvconf.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/dnsmasq/tasks/resolvconf.yml b/roles/dnsmasq/tasks/resolvconf.yml index c018e9771..b24ef17ab 100644 --- a/roles/dnsmasq/tasks/resolvconf.yml +++ b/roles/dnsmasq/tasks/resolvconf.yml @@ -3,6 +3,7 @@ shell: which resolvconf register: resolvconf ignore_errors: yes + changed_when: false - name: target resolv.conf file set_fact: From f320b79c0c44019b9335a67d8cb3724123860c2d Mon Sep 17 00:00:00 2001 From: Pablo Moreno Date: Mon, 14 Nov 2016 02:04:13 +0000 Subject: [PATCH 3/3] Adds missing ip based on internal ip, for etcd --- contrib/terraform/terraform.py | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/terraform/terraform.py b/contrib/terraform/terraform.py index 10a35c22a..e8434c883 100755 --- a/contrib/terraform/terraform.py +++ b/contrib/terraform/terraform.py @@ -309,6 +309,7 @@ def openstack_host(resource, module_name): attrs = { 'access_ip_v4': raw_attrs['access_ip_v4'], 'access_ip_v6': raw_attrs['access_ip_v6'], + 'ip': raw_attrs['network.0.fixed_ip_v4'], 'flavor': parse_dict(raw_attrs, 'flavor', sep='_'), 'id': raw_attrs['id'],