mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-01 01:28:11 -03:30
first version of CoreOS on GCE
Please enter the commit message for your changes. Lines starting
This commit is contained in:
@@ -8,13 +8,14 @@
|
||||
mode: 0644
|
||||
notify:
|
||||
- restart docker
|
||||
when: ansible_os_family != "CoreOS"
|
||||
|
||||
- name: Calico | Write docker.service systemd file
|
||||
template:
|
||||
src: systemd-docker.service
|
||||
dest: /lib/systemd/system/docker.service
|
||||
notify: restart docker
|
||||
when: ansible_service_mgr == "systemd"
|
||||
when: ansible_service_mgr == "systemd" and ansible_os_family != "CoreOS"
|
||||
|
||||
- meta: flush_handlers
|
||||
|
||||
@@ -34,12 +35,6 @@
|
||||
- name: Calico | install calicoctl
|
||||
file: path={{ bin_dir }}/calicoctl mode=0755 state=file
|
||||
|
||||
- name: Calico | Create calicoctl symlink (needed by kubelet)
|
||||
file:
|
||||
src: /usr/local/bin/calicoctl
|
||||
dest: /usr/bin/calicoctl
|
||||
state: link
|
||||
|
||||
- name: Calico | wait for etcd
|
||||
wait_for:
|
||||
port: 2379
|
||||
@@ -54,12 +49,12 @@
|
||||
run_once: true
|
||||
|
||||
- name: Calico | Configure calico network pool for cloud
|
||||
command: "calicoctl pool add {{ kube_pods_subnet }} --ipip --nat-outgoing"
|
||||
command: "{{ bin_dir }}/calicoctl pool add {{ kube_pods_subnet }} --ipip --nat-outgoing"
|
||||
run_once: true
|
||||
when: calico_conf.status == 404 and cloud_provider is defined and cloud_provider == True
|
||||
|
||||
- name: Calico | Configure calico network pool
|
||||
command: "calicoctl pool add {{ kube_pods_subnet }}"
|
||||
command: "{{ bin_dir }}/calicoctl pool add {{ kube_pods_subnet }}"
|
||||
run_once: true
|
||||
when: calico_conf.status == 404 and (cloud_provider is not defined or cloud_provider != True)
|
||||
|
||||
@@ -112,13 +107,13 @@
|
||||
when: calico_copy.stdout_lines
|
||||
|
||||
- name: Calico | Disable node mesh
|
||||
shell: calicoctl bgp node-mesh off
|
||||
shell: "{{ bin_dir }}/calicoctl bgp node-mesh off"
|
||||
environment:
|
||||
ETCD_AUTHORITY: "127.0.0.1:2379"
|
||||
when: peer_with_router|default(false) and inventory_hostname in groups['kube-node']
|
||||
|
||||
- name: Calico | Configure peering with router(s)
|
||||
shell: calicoctl node bgp peer add {{ item.router_id }} as {{ item.as }}
|
||||
shell: "{{ bin_dir }}/calicoctl node bgp peer add {{ item.router_id }} as {{ item.as }}"
|
||||
environment:
|
||||
ETCD_AUTHORITY: "127.0.0.1:2379"
|
||||
with_items: peers
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
src: network.json
|
||||
dest: /etc/flannel-network.json
|
||||
backup: yes
|
||||
|
||||
- name: Flannel | Create flannel pod manifest
|
||||
template:
|
||||
src: flannel-pod.yml
|
||||
@@ -15,6 +14,7 @@
|
||||
wait_for:
|
||||
path: /run/flannel/subnet.env
|
||||
delay: 5
|
||||
timeout: 600
|
||||
|
||||
- name: Flannel | Get flannel_subnet from subnet.env
|
||||
shell: cat /run/flannel/subnet.env | awk -F'=' '$1 == "FLANNEL_SUBNET" {print $2}'
|
||||
@@ -42,11 +42,18 @@
|
||||
notify:
|
||||
- restart docker
|
||||
|
||||
- name: Flannel | Create docker config symlink for CoreOS
|
||||
file:
|
||||
src: "/etc/default/docker"
|
||||
dest: "/run/flannel_docker_opts.env"
|
||||
state: link
|
||||
when: ansible_os_family == "CoreOS"
|
||||
|
||||
- name: Flannel | Write docker.service systemd file
|
||||
template:
|
||||
src: systemd-docker.service
|
||||
dest: /lib/systemd/system/docker.service
|
||||
notify: restart docker
|
||||
when: ansible_service_mgr == "systemd"
|
||||
when: ansible_service_mgr == "systemd" and ansible_os_family != "CoreOS"
|
||||
|
||||
- meta: flush_handlers
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Deployed by Ansible
|
||||
{% if ansible_service_mgr in ["sysvinit","upstart"] and kube_network_plugin == "flannel" and ansible_os_family == "Debian" %}
|
||||
{% if (ansible_service_mgr in ["sysvinit","upstart"] and kube_network_plugin == "flannel" and ansible_os_family == "Debian") or
|
||||
(kube_network_plugin == "flannel" and ansible_os_family == "CoreOS") %}
|
||||
DOCKER_OPTS="--bip={{ flannel_subnet }} --mtu={{ flannel_mtu }}"
|
||||
{% elif kube_network_plugin == "flannel" %}
|
||||
OPTIONS="--bip={{ flannel_subnet }} --mtu={{ flannel_mtu }}"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
src: systemd-docker.service
|
||||
dest: /lib/systemd/system/docker.service
|
||||
notify: restart docker
|
||||
when: ansible_service_mgr == "systemd"
|
||||
when: ansible_service_mgr == "systemd" and ansible_os_family != "CoreOS"
|
||||
|
||||
- meta: flush_handlers
|
||||
|
||||
|
||||
Reference in New Issue
Block a user