Compare commits

..

3 commits

Author SHA1 Message Date
d341a283a0 full install of k3s is working
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-17 01:53:34 +02:00
1ec1ebb89d fix lost+found bug 2020-10-17 01:53:00 +02:00
dae84110df Update kubernetes version 2020-10-17 01:52:39 +02:00
4 changed files with 22 additions and 8 deletions

View file

@ -5,4 +5,4 @@ kubernetes_server: false
# value for kuberntes_network: flannel, calico, weave-net
#kubernetes_network: weave-net
kubernetes_kubeproxy_mode: ipvs
kubernetes_version: 1.18.3
kubernetes_version: 1.19.3

View file

@ -1,4 +1,10 @@
---
- name: Install Wireguard
include_role:
name: wireguard
# when:
# - kubernetes_cni == "wireguard"
- name: Check if /usr/local/bin/k3s already existe
stat:
path: /usr/local/bin/k3s
@ -13,7 +19,7 @@
owner: root
mode: 0755
when:
- k3s_bin.stat.exists
- not k3s_bin.stat.exists
- ansible_machine == "x86_64"
- name: retreive k3s binary for arm64
@ -24,7 +30,7 @@
owner: root
mode: 0755
when:
- k3s_bin.stat.exists
- not k3s_bin.stat.exists
- ansible_machine == "arm64"
- name: retreive k3s binary for armv6/armv7
@ -35,7 +41,7 @@
owner: root
mode: 0755
when:
- k3s_bin.stat.exists
- not k3s_bin.stat.exists
- (ansible_machine == "armv7l") or (ansible_machine == "armv6l")
- name: Create tools link
@ -72,14 +78,14 @@
thinpool: kubernetes
size: "{{ item.size }}"
with_items:
- { name: var_lib_k3s, vg: vg_sys, size: 10g, mount_point: /var/lib/rancher/k3s}
- { name: var_lib_k3s, vg: vg_sys, size: 10g, mount_point: /var/lib/rancher/k3s, mount_opts: "discard"}
- name: create file system on containerd lv
filesystem:
fstype: ext4
dev: "/dev/{{ item.vg }}/{{ item.name }}"
with_items:
- { name: var_lib_k3s, vg: vg_sys, size: 10g, mount_point: /var/lib/rancher/k3s}
- { name: var_lib_k3s, vg: vg_sys, size: 10g, mount_point: /var/lib/rancher/k3s, mount_opts: "discard"}
- name: mount logical volumes
mount:
@ -89,7 +95,7 @@
opts: "{{ item.mount_opts }}"
state: mounted
with_items:
- { name: var_lib_k3s, vg: vg_sys, size: 10g, mount_point: /var/lib/rancher/k3s}
- { name: var_lib_k3s, vg: vg_sys, size: 10g, mount_point: /var/lib/rancher/k3s, mount_opts: "discard"}
- name: Enable k3s on boot
service:

View file

@ -75,6 +75,7 @@
fstype: ext4
opts: "{{ item.mount_opts }}"
state: mounted
register: partition_formated
with_items:
- { name: var_lib_etcd, vg: vg_sys, size: 1g, mount_point: /var/lib/etcd, mount_opts: "nodev,noexec,nosuid,discard"}
- { name: etc_kubernetes, vg: vg_sys, size: 1g, mount_point: /etc/kubernetes, mount_opts: "nodev,noexec,nosuid,discard"}
@ -82,6 +83,13 @@
when:
- kubernetes_master|bool
- name: Ensuring /var/lib/etcd/lost+found Folder does not exists
file:
path: "/var/lib/etcd/lost+found"
state: "absent"
when:
- partition_formated is changed
- name: Secure etcd directory
file:
path: "/var/lib/etcd"

View file

@ -1,3 +1,3 @@
{% if kubernetes_master|bool %}
{% if not kubernetes_master|bool %}
NODE_TOKEN={{ kubernetes_server_token }}
{% endif %}