commit
c05c60a5d2
|
@ -36,9 +36,6 @@ These defaults are good for tests purposes.
|
||||||
|
|
||||||
Edit the inventory according to the number of servers
|
Edit the inventory according to the number of servers
|
||||||
```
|
```
|
||||||
[downloader]
|
|
||||||
localhost ansible_connection=local ansible_python_interpreter=python2
|
|
||||||
|
|
||||||
[kube-master]
|
[kube-master]
|
||||||
10.115.99.31
|
10.115.99.31
|
||||||
|
|
||||||
|
@ -77,9 +74,6 @@ In node-mesh mode the nodes peers with all the nodes in order to exchange routes
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
[downloader]
|
|
||||||
localhost ansible_connection=local ansible_python_interpreter=python2
|
|
||||||
|
|
||||||
[kube-master]
|
[kube-master]
|
||||||
node1 ansible_ssh_host=10.99.0.26
|
node1 ansible_ssh_host=10.99.0.26
|
||||||
node2 ansible_ssh_host=10.99.0.27
|
node2 ansible_ssh_host=10.99.0.27
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
---
|
---
|
||||||
- hosts: downloader
|
|
||||||
roles:
|
|
||||||
- { role: download, tags: download }
|
|
||||||
|
|
||||||
- hosts: k8s-cluster
|
- hosts: k8s-cluster
|
||||||
roles:
|
roles:
|
||||||
|
- { role: download, tags: download }
|
||||||
- { role: kubernetes/preinstall, tags: preinstall }
|
- { role: kubernetes/preinstall, tags: preinstall }
|
||||||
- { role: docker, tags: docker }
|
- { role: docker, tags: docker }
|
||||||
- { role: kubernetes/node, tags: node }
|
- { role: kubernetes/node, tags: node }
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
[downloader]
|
|
||||||
localhost ansible_connection=local ansible_python_interpreter=python2
|
|
||||||
|
|
||||||
[kube-master]
|
[kube-master]
|
||||||
node1 ansible_ssh_host=10.99.0.26
|
node1 ansible_ssh_host=10.99.0.26
|
||||||
node2 ansible_ssh_host=10.99.0.27
|
node2 ansible_ssh_host=10.99.0.27
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
node1 ansible_connection=local local_release_dir={{ansible_env.HOME}}/releases
|
node1 ansible_connection=local local_release_dir={{ansible_env.HOME}}/releases
|
||||||
|
|
||||||
[downloader]
|
|
||||||
node1
|
|
||||||
|
|
||||||
[kube-master]
|
[kube-master]
|
||||||
node1
|
node1
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit d6df09a89721d98e2969a8abf29b4eb5e787fca6
|
Subproject commit b5015aed8ff5eed9c325911205cfbb23ad0e57be
|
|
@ -1,6 +1,10 @@
|
||||||
---
|
---
|
||||||
local_release_dir: /tmp
|
local_release_dir: /tmp
|
||||||
|
|
||||||
|
# This is the group that the cert creation scripts chgrp the
|
||||||
|
# cert files to. Not really changable...
|
||||||
|
kube_cert_group: kube-cert
|
||||||
|
|
||||||
# Versions
|
# Versions
|
||||||
kube_version: v1.1.4
|
kube_version: v1.1.4
|
||||||
etcd_version: v2.2.4
|
etcd_version: v2.2.4
|
||||||
|
@ -25,24 +29,34 @@ downloads:
|
||||||
dest: calico/bin/calicoctl
|
dest: calico/bin/calicoctl
|
||||||
sha256: "{{ calico_checksum }}"
|
sha256: "{{ calico_checksum }}"
|
||||||
url: "{{ calico_download_url }}"
|
url: "{{ calico_download_url }}"
|
||||||
|
owner: "root"
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
- name: calico-plugin
|
- name: calico-plugin
|
||||||
dest: calico/bin/calico
|
dest: calico/bin/calico
|
||||||
sha256: "{{ calico_plugin_checksum }}"
|
sha256: "{{ calico_plugin_checksum }}"
|
||||||
url: "{{ calico_plugin_download_url }}"
|
url: "{{ calico_plugin_download_url }}"
|
||||||
|
owner: "root"
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
- name: etcd
|
- name: etcd
|
||||||
dest: "etcd/etcd-{{ etcd_version }}-linux-amd64.tar.gz"
|
dest: "etcd/etcd-{{ etcd_version }}-linux-amd64.tar.gz"
|
||||||
sha256: "{{ etcd_checksum }}"
|
sha256: "{{ etcd_checksum }}"
|
||||||
url: "{{ etcd_download_url }}"
|
url: "{{ etcd_download_url }}"
|
||||||
unarchive: true
|
unarchive: true
|
||||||
|
owner: "etcd"
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
- name: kubernetes-kubelet
|
- name: kubernetes-kubelet
|
||||||
dest: kubernetes/bin/kubelet
|
dest: kubernetes/bin/kubelet
|
||||||
sha256: "{{kubelet_checksum}}"
|
sha256: "{{kubelet_checksum}}"
|
||||||
url: "{{ kube_download_url }}/kubelet"
|
url: "{{ kube_download_url }}/kubelet"
|
||||||
|
owner: "kube"
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
- name: kubernetes-kubectl
|
- name: kubernetes-kubectl
|
||||||
dest: kubernetes/bin/kubectl
|
dest: kubernetes/bin/kubectl
|
||||||
sha256: "{{kubectl_checksum}}"
|
sha256: "{{kubectl_checksum}}"
|
||||||
url: "{{ kube_download_url }}/kubectl"
|
url: "{{ kube_download_url }}/kubectl"
|
||||||
|
owner: "kube"
|
||||||
|
mode: "0755"
|
||||||
|
|
|
@ -1,4 +1,22 @@
|
||||||
---
|
---
|
||||||
|
- name: certs | create system kube-cert groups
|
||||||
|
group: name={{ kube_cert_group }} state=present system=yes
|
||||||
|
|
||||||
|
- name: Create system kube user
|
||||||
|
user:
|
||||||
|
name=kube
|
||||||
|
comment="Kubernetes user"
|
||||||
|
shell=/sbin/nologin
|
||||||
|
state=present
|
||||||
|
system=yes
|
||||||
|
groups={{ kube_cert_group }}
|
||||||
|
|
||||||
|
- name: Create etcd user
|
||||||
|
user:
|
||||||
|
name: etcd
|
||||||
|
shell: /bin/nologin
|
||||||
|
home: /var/lib/etcd
|
||||||
|
|
||||||
- name: Create dest directories
|
- name: Create dest directories
|
||||||
file: path={{local_release_dir}}/{{item.dest|dirname}} state=directory recurse=yes
|
file: path={{local_release_dir}}/{{item.dest|dirname}} state=directory recurse=yes
|
||||||
with_items: downloads
|
with_items: downloads
|
||||||
|
@ -8,6 +26,8 @@
|
||||||
url: "{{item.url}}"
|
url: "{{item.url}}"
|
||||||
dest: "{{local_release_dir}}/{{item.dest}}"
|
dest: "{{local_release_dir}}/{{item.dest}}"
|
||||||
sha256sum: "{{item.sha256 | default(omit)}}"
|
sha256sum: "{{item.sha256 | default(omit)}}"
|
||||||
|
owner: "{{ item.owner|default(omit) }}"
|
||||||
|
mode: "{{ item.mode|default(omit) }}"
|
||||||
with_items: downloads
|
with_items: downloads
|
||||||
|
|
||||||
- name: Extract archives
|
- name: Extract archives
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: Copy etcd.service systemd file
|
- name: Configure | Copy etcd.service systemd file
|
||||||
template:
|
template:
|
||||||
src: etcd.service.j2
|
src: etcd.service.j2
|
||||||
dest: /lib/systemd/system/etcd.service
|
dest: /lib/systemd/system/etcd.service
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
notify:
|
notify:
|
||||||
- restart systemd-etcd
|
- restart systemd-etcd
|
||||||
|
|
||||||
- name: Write calico-node initd script
|
- name: Configure | Write calico-node initd script
|
||||||
template:
|
template:
|
||||||
src: deb-etcd.initd.j2
|
src: deb-etcd.initd.j2
|
||||||
dest: /etc/init.d/etcd
|
dest: /etc/init.d/etcd
|
||||||
|
@ -17,11 +17,11 @@
|
||||||
when: init_system == "sysvinit" and ansible_os_family == "Debian"
|
when: init_system == "sysvinit" and ansible_os_family == "Debian"
|
||||||
notify: restart etcd
|
notify: restart etcd
|
||||||
|
|
||||||
- name: Create etcd environment vars file
|
- name: Configure | Create etcd environment vars file
|
||||||
template:
|
template:
|
||||||
src: etcd.j2
|
src: etcd.j2
|
||||||
dest: /etc/etcd.env
|
dest: /etc/etcd.env
|
||||||
notify: restart etcd
|
notify: restart etcd
|
||||||
|
|
||||||
- name: Ensure etcd is running
|
- name: Configure | Ensure etcd is running
|
||||||
service: name=etcd state=started enabled=yes
|
service: name=etcd state=started enabled=yes
|
||||||
|
|
|
@ -1,17 +1,8 @@
|
||||||
---
|
---
|
||||||
- name: Create etcd user
|
- name: INSTALL | Copy etcd binaries
|
||||||
user: name=etcd shell=/bin/nologin home=/var/lib/etcd
|
command: cp -pf "{{ etcd_bin_dir }}/{{ item }}" "{{ bin_dir }}"
|
||||||
|
|
||||||
- name: Install etcd binaries
|
|
||||||
synchronize:
|
|
||||||
src: "{{ etcd_bin_dir }}/{{ item }}"
|
|
||||||
dest: "{{ bin_dir }}"
|
|
||||||
times: yes
|
|
||||||
archive: no
|
|
||||||
set_remote_user: false
|
|
||||||
delegate_to: "{{ groups['downloader'][0] }}"
|
|
||||||
with_items:
|
with_items:
|
||||||
- etcdctl
|
- etcdctl
|
||||||
- etcd
|
- etcd
|
||||||
|
changed_when: false
|
||||||
notify: restart etcd
|
notify: restart etcd
|
||||||
|
|
||||||
|
|
|
@ -5,17 +5,9 @@
|
||||||
dest: /etc/bash_completion.d/kubectl.sh
|
dest: /etc/bash_completion.d/kubectl.sh
|
||||||
|
|
||||||
- name: Install kubectl binary
|
- name: Install kubectl binary
|
||||||
synchronize:
|
command: cp -pf "{{ local_release_dir }}/kubernetes/bin/kubectl" "{{ bin_dir }}/kubectl"
|
||||||
src: "{{ local_release_dir }}/kubernetes/bin/kubectl"
|
changed_when: false
|
||||||
dest: "{{ bin_dir }}/kubectl"
|
notify: restart kubelet
|
||||||
archive: no
|
|
||||||
checksum: yes
|
|
||||||
times: yes
|
|
||||||
set_remote_user: false
|
|
||||||
delegate_to: "{{ groups['downloader'][0] }}"
|
|
||||||
|
|
||||||
- name: Perms kubectl binary
|
|
||||||
file: path={{ bin_dir }}/kubectl owner=kube mode=0755 state=file
|
|
||||||
|
|
||||||
- name: populate users for basic auth in API
|
- name: populate users for basic auth in API
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
@ -46,8 +38,7 @@
|
||||||
template:
|
template:
|
||||||
src: manifests/kube-apiserver.manifest.j2
|
src: manifests/kube-apiserver.manifest.j2
|
||||||
dest: "{{ kube_manifest_dir }}/kube-apisever.manifest"
|
dest: "{{ kube_manifest_dir }}/kube-apisever.manifest"
|
||||||
notify:
|
notify: restart kubelet
|
||||||
- restart kubelet
|
|
||||||
|
|
||||||
- meta: flush_handlers
|
- meta: flush_handlers
|
||||||
|
|
||||||
|
|
|
@ -18,34 +18,16 @@
|
||||||
notify: restart kubelet
|
notify: restart kubelet
|
||||||
|
|
||||||
- name: install | Install kubelet binary
|
- name: install | Install kubelet binary
|
||||||
synchronize:
|
command: cp -pf "{{ local_release_dir }}/kubernetes/bin/kubelet" "{{ bin_dir }}/kubelet"
|
||||||
src: "{{ local_release_dir }}/kubernetes/bin/kubelet"
|
changed_when: false
|
||||||
dest: "{{ bin_dir }}/kubelet"
|
notify: restart kubelet
|
||||||
times: yes
|
|
||||||
archive: no
|
|
||||||
set_remote_user: false
|
|
||||||
delegate_to: "{{ groups['downloader'][0] }}"
|
|
||||||
notify:
|
|
||||||
- restart kubelet
|
|
||||||
|
|
||||||
- name: install | Perms kubelet binary
|
|
||||||
file: path={{ bin_dir }}/kubelet owner=kube mode=0755 state=file
|
|
||||||
|
|
||||||
- name: install | Calico-plugin | Directory
|
- name: install | Calico-plugin | Directory
|
||||||
file: path=/usr/libexec/kubernetes/kubelet-plugins/net/exec/calico/ state=directory
|
file: path=/usr/libexec/kubernetes/kubelet-plugins/net/exec/calico/ state=directory
|
||||||
when: kube_network_plugin == "calico"
|
when: kube_network_plugin == "calico"
|
||||||
|
|
||||||
- name: install | Calico-plugin | Binary
|
- name: install | Calico-plugin | Binary
|
||||||
synchronize:
|
command: cp -pf "{{ local_release_dir }}/calico/bin/calico" "/usr/libexec/kubernetes/kubelet-plugins/net/exec/calico/calico"
|
||||||
src: "{{ local_release_dir }}/calico/bin/calico"
|
|
||||||
dest: "/usr/libexec/kubernetes/kubelet-plugins/net/exec/calico/calico"
|
|
||||||
times: yes
|
|
||||||
archive: no
|
|
||||||
set_remote_user: false
|
|
||||||
delegate_to: "{{ groups['downloader'][0] }}"
|
|
||||||
when: kube_network_plugin == "calico"
|
when: kube_network_plugin == "calico"
|
||||||
|
changed_when: false
|
||||||
notify: restart kubelet
|
notify: restart kubelet
|
||||||
|
|
||||||
- name: install | Perms calico plugin binary
|
|
||||||
file: path=/usr/libexec/kubernetes/kubelet-plugins/net/exec/calico/calico owner=kube mode=0755 state=file
|
|
||||||
when: kube_network_plugin == "calico"
|
|
||||||
|
|
|
@ -12,15 +12,6 @@
|
||||||
- name: certs | create system kube-cert groups
|
- name: certs | create system kube-cert groups
|
||||||
group: name={{ kube_cert_group }} state=present system=yes
|
group: name={{ kube_cert_group }} state=present system=yes
|
||||||
|
|
||||||
- name: create system kube user
|
|
||||||
user:
|
|
||||||
name=kube
|
|
||||||
comment="Kubernetes user"
|
|
||||||
shell=/sbin/nologin
|
|
||||||
state=present
|
|
||||||
system=yes
|
|
||||||
groups={{ kube_cert_group }}
|
|
||||||
|
|
||||||
- include: secrets.yml
|
- include: secrets.yml
|
||||||
tags:
|
tags:
|
||||||
- secrets
|
- secrets
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
- name: "Identify init system"
|
- name: "Identify init system"
|
||||||
shell: >
|
shell: >
|
||||||
$(pgrep systemd > /dev/null && systemctl status network > /dev/null);
|
$(pgrep systemd > /dev/null && systemctl status network.target > /dev/null);
|
||||||
if [ $? -eq 0 ] ; then
|
if [ $? -eq 0 ] ; then
|
||||||
echo systemd;
|
echo systemd;
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: Calico | Install calicoctl bin
|
- name: Calico | Install calicoctl bin
|
||||||
synchronize:
|
command: cp -pf "{{ local_release_dir }}/calico/bin/calicoctl" "{{ bin_dir }}/calicoctl"
|
||||||
src: "{{ local_release_dir }}/calico/bin/calicoctl"
|
changed_when: false
|
||||||
dest: "{{ bin_dir }}/calicoctl"
|
|
||||||
archive: no
|
|
||||||
times: yes
|
|
||||||
set_remote_user: false
|
|
||||||
delegate_to: "{{ groups['downloader'][0] }}"
|
|
||||||
notify: restart calico-node
|
notify: restart calico-node
|
||||||
|
|
||||||
- name: Calico | install calicoctl
|
- name: Calico | install calicoctl
|
||||||
|
|
Loading…
Reference in New Issue