Add IP var
This commit is contained in:
parent
f6e4cc530c
commit
3bf74530ce
7 changed files with 9 additions and 9 deletions
|
@ -4,7 +4,7 @@
|
||||||
when: kube_network_plugin is defined and kube_network_plugin == "calico"
|
when: kube_network_plugin is defined and kube_network_plugin == "calico"
|
||||||
|
|
||||||
- name: Configure calico/docker bridge
|
- name: Configure calico/docker bridge
|
||||||
shell: /etc/network/if-up.d/create_cbr
|
command: /etc/network/if-up.d/create_cbr
|
||||||
when: kube_network_plugin is defined and kube_network_plugin == "calico"
|
when: kube_network_plugin is defined and kube_network_plugin == "calico"
|
||||||
|
|
||||||
- name: Configure docker to use cbr0 bridge
|
- name: Configure docker to use cbr0 bridge
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
- docker-engine=1.8.3-0~{{ ansible_distribution_release }}
|
- docker-engine=1.8.3-0~{{ ansible_distribution_release }}
|
||||||
|
|
||||||
- name: Copy default docker configuration
|
- name: Copy default docker configuration
|
||||||
template: src=default-docker.j2 dest=/etc/default/docker
|
template: src=default-docker.j2 dest=/etc/default/docker backup=yes
|
||||||
notify: restart docker
|
notify: restart docker
|
||||||
|
|
||||||
- name: Copy Docker systemd unit file
|
- name: Copy Docker systemd unit file
|
||||||
copy: src=systemd-docker.service dest=/lib/systemd/system/docker.service
|
copy: src=systemd-docker.service dest=/lib/systemd/system/docker.service backup=yes
|
||||||
notify: restart docker
|
notify: restart docker
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
args:
|
args:
|
||||||
creates: "{{ kube_cert_dir }}/server.crt"
|
creates: "{{ kube_cert_dir }}/server.crt"
|
||||||
environment:
|
environment:
|
||||||
MASTER_IP: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
|
MASTER_IP: "{{ hostvars[inventory_hostname]['ip'] | default(hostvars[inventory_hostname]['ansible_default_ipv4']['address']) }}"
|
||||||
MASTER_NAME: "{{ inventory_hostname }}"
|
MASTER_NAME: "{{ inventory_hostname }}"
|
||||||
DNS_DOMAIN: "{{ dns_domain }}"
|
DNS_DOMAIN: "{{ dns_domain }}"
|
||||||
SERVICE_CLUSTER_IP_RANGE: "{{ kube_service_addresses }}"
|
SERVICE_CLUSTER_IP_RANGE: "{{ kube_service_addresses }}"
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
KUBE_API_ADDRESS="--insecure-bind-address=0.0.0.0"
|
KUBE_API_ADDRESS="--insecure-bind-address=0.0.0.0"
|
||||||
|
|
||||||
# The port on the local server to listen on.
|
# The port on the local server to listen on.
|
||||||
KUBE_API_PORT="--insecure-port=8080 --secure-port={{ kube_master_port }}"
|
KUBE_API_PORT="--insecure-port={{kube_master_insecure_port}} --secure-port={{ kube_master_port }}"
|
||||||
|
|
||||||
# KUBELET_PORT="--kubelet_port=10250"
|
# KUBELET_PORT="--kubelet_port=10250"
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ contexts:
|
||||||
clusters:
|
clusters:
|
||||||
- cluster:
|
- cluster:
|
||||||
certificate-authority: {{ kube_cert_dir }}/ca.crt
|
certificate-authority: {{ kube_cert_dir }}/ca.crt
|
||||||
server: http://{{ groups['kube-master'][0] }}:8080
|
server: http://{{ groups['kube-master'][0] }}:{{kube_master_insecure_port}}
|
||||||
name: {{ cluster_name }}
|
name: {{ cluster_name }}
|
||||||
users:
|
users:
|
||||||
- name: proxy
|
- name: proxy
|
||||||
|
|
|
@ -5,7 +5,7 @@ preferences: {}
|
||||||
clusters:
|
clusters:
|
||||||
- cluster:
|
- cluster:
|
||||||
certificate-authority: {{ kube_cert_dir }}/ca.crt
|
certificate-authority: {{ kube_cert_dir }}/ca.crt
|
||||||
server: https://{{ groups['kube-master'][0] }}:443
|
server: https://{{ groups['kube-master'][0] }}:{{kube_master_port}}
|
||||||
name: {{ cluster_name }}
|
name: {{ cluster_name }}
|
||||||
contexts:
|
contexts:
|
||||||
- context:
|
- context:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#! /usr/bin/bash
|
#! /usr/bin/bash
|
||||||
# This node's IPv4 address
|
# This node's IPv4 address
|
||||||
CALICO_IPAM=true
|
CALICO_IPAM=true
|
||||||
DEFAULT_IPV4={{ ansible_default_ipv4.address }}
|
DEFAULT_IPV4={{ip | default(ansible_default_ipv4.address) }}
|
||||||
|
|
||||||
{% if inventory_hostname in groups['kube-node'] %}
|
{% if inventory_hostname in groups['kube-node'] %}
|
||||||
# The kubernetes master IP
|
# The kubernetes master IP
|
||||||
|
@ -12,7 +12,7 @@ KUBERNETES_MASTER={{ groups['kube-master'][0] }}
|
||||||
ETCD_AUTHORITY={{ groups['kube-master'][0] }}:4001
|
ETCD_AUTHORITY={{ groups['kube-master'][0] }}:4001
|
||||||
|
|
||||||
# The kubernetes-apiserver location - used by the calico plugin
|
# The kubernetes-apiserver location - used by the calico plugin
|
||||||
KUBE_API_ROOT=http://{{ groups['kube-master'][0] }}:8080/api/v1/
|
KUBE_API_ROOT=http://{{ groups['kube-master'][0] }}:{{kube_master_insecure_port}}/api/v1/
|
||||||
|
|
||||||
# Location of the calicoctl binary - used by the calico plugin
|
# Location of the calicoctl binary - used by the calico plugin
|
||||||
CALICOCTL_PATH="{{ bin_dir }}/calicoctl"
|
CALICOCTL_PATH="{{ bin_dir }}/calicoctl"
|
||||||
|
|
Loading…
Reference in a new issue