Fix docker
parent
f368faf66b
commit
323155b0e1
|
@ -13,7 +13,7 @@
|
||||||
with_items:
|
with_items:
|
||||||
- aufs-tools
|
- aufs-tools
|
||||||
- cgroupfs-mount
|
- cgroupfs-mount
|
||||||
- docker-engine=1.8.3-0~{{ ansible_distribution_release }}
|
- docker-engine=1.9.0-0~{{ ansible_distribution_release }}
|
||||||
|
|
||||||
- name: Copy default docker configuration
|
- name: Copy default docker configuration
|
||||||
template: src=default-docker.j2 dest=/etc/default/docker backup=yes
|
template: src=default-docker.j2 dest=/etc/default/docker backup=yes
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
#DOCKER="/usr/local/bin/docker"
|
#DOCKER="/usr/local/bin/docker"
|
||||||
|
|
||||||
# Use DOCKER_OPTS to modify the daemon startup options.
|
# Use DOCKER_OPTS to modify the daemon startup options.
|
||||||
#{% if kube_network_plugin is defined and kube_network_plugin == "calico" %}
|
{% if kube_network_plugin is defined and kube_network_plugin == "calico" %}
|
||||||
#DOCKER_OPTS="--bridge=cbr0 --iptables=false --ip-masq=false"
|
DOCKER_OPTS="--bridge=cbr0 --iptables=false --ip-masq=false"
|
||||||
#{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# If you need Docker to use an HTTP proxy, it can also be specified here.
|
# If you need Docker to use an HTTP proxy, it can also be specified here.
|
||||||
#export http_proxy="http://127.0.0.1:3128/"
|
#export http_proxy="http://127.0.0.1:3128/"
|
||||||
|
|
|
@ -31,6 +31,7 @@ kube_cert_group: kube-cert
|
||||||
dns_domain: "{{ cluster_name }}"
|
dns_domain: "{{ cluster_name }}"
|
||||||
|
|
||||||
kube_proxy_mode: iptables
|
kube_proxy_mode: iptables
|
||||||
|
kube_master_port: 443
|
||||||
# IP address of the DNS server.
|
# IP address of the DNS server.
|
||||||
# Kubernetes will create a pod with several containers, serving as the DNS
|
# Kubernetes will create a pod with several containers, serving as the DNS
|
||||||
# server and expose it under this IP address. The IP address must be from
|
# server and expose it under this IP address. The IP address must be from
|
||||||
|
|
|
@ -45,6 +45,10 @@
|
||||||
notify:
|
notify:
|
||||||
- restart daemons
|
- restart daemons
|
||||||
|
|
||||||
|
- debug: msg="{{groups['kube-master'][0]}} == {{inventory_hostname}}"
|
||||||
|
tags:
|
||||||
|
- debug
|
||||||
|
|
||||||
- include: gen_tokens.yml
|
- include: gen_tokens.yml
|
||||||
run_once: true
|
run_once: true
|
||||||
when: inventory_hostname == groups['kube-master'][0]
|
when: inventory_hostname == groups['kube-master'][0]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Calico | Install calicoctl bin
|
- name: Calico | Install calicoctl bin
|
||||||
copy:
|
copy:
|
||||||
src={{ local_release_dir }}/calico/bin/calicoctl
|
src={{ local_release_dir }}/calico/bin/calicoctl
|
||||||
dest={{ bin_dir }}
|
dest={{ bin_dir }}
|
||||||
mode=u+x
|
mode=u+x
|
||||||
|
@ -11,22 +11,28 @@
|
||||||
|
|
||||||
- name: Calico | Write calico-node systemd init file
|
- name: Calico | Write calico-node systemd init file
|
||||||
template: src=calico/calico-node.service.j2 dest=/etc/systemd/system/calico-node.service
|
template: src=calico/calico-node.service.j2 dest=/etc/systemd/system/calico-node.service
|
||||||
notify:
|
register: newservice
|
||||||
|
notify:
|
||||||
- reload systemd
|
- reload systemd
|
||||||
- restart calico-node
|
- restart calico-node
|
||||||
|
|
||||||
|
- name: Calico | daemon-reload
|
||||||
|
command: systemctl daemon-reload
|
||||||
|
when: newservice|changed
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Calico | Enable calico-node
|
- name: Calico | Enable calico-node
|
||||||
service: name=calico-node enabled=yes state=started
|
service: name=calico-node enabled=yes state=started
|
||||||
|
|
||||||
- name: Calico | Configure calico-node remove default pool
|
- name: Calico | Configure calico-node remove default pool
|
||||||
shell: calicoctl pool remove 192.168.0.0/16
|
shell: calicoctl pool remove 192.168.0.0/16
|
||||||
environment:
|
environment:
|
||||||
ETCD_AUTHORITY: "{{ groups['kube-master'][0] }}:4001"
|
ETCD_AUTHORITY: "{{ groups['kube-master'][0] }}:4001"
|
||||||
run_once: true
|
run_once: true
|
||||||
|
|
||||||
- name: Calico | Configure calico-node desired pool
|
- name: Calico | Configure calico-node desired pool
|
||||||
shell: calicoctl pool add {{ kube_pods_subnet }}
|
shell: calicoctl pool add {{ kube_pods_subnet }}
|
||||||
environment:
|
environment:
|
||||||
ETCD_AUTHORITY: "{{ groups['kube-master'][0] }}:4001"
|
ETCD_AUTHORITY: "{{ groups['kube-master'][0] }}:4001"
|
||||||
run_once: true
|
run_once: true
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue