1
0
Fork 0

switch k3s-w3 to a vm

This commit is contained in:
Massaki Archambault 2021-12-27 23:01:35 -05:00
parent 8deddf3c0b
commit a21ab3673e
5 changed files with 16 additions and 13 deletions

2
hosts
View File

@ -60,7 +60,7 @@ all:
platform: raspberrypi platform: raspberrypi
k3s-w3: k3s-w3:
ansible_host: 192.168.20.24 ansible_host: 192.168.20.24
platform: lxc platform: vm
k3s_extra_args: --node-taint kubernetes.io/arch=amd64:PreferNoSchedule k3s_extra_args: --node-taint kubernetes.io/arch=amd64:PreferNoSchedule
debian: debian:
hosts: hosts:

View File

@ -23,12 +23,12 @@
lineinfile: lineinfile:
path: /etc/ssh/sshd_config path: /etc/ssh/sshd_config
regexp: '^#?ClientAliveInterval' regexp: '^#?ClientAliveInterval'
line: ClientAliveInterval 5m line: '#ClientAliveInterval 5m'
notify: Restart sshd notify: Restart sshd
- name: Configure sshd ClientAliveCountMax - name: Configure sshd ClientAliveCountMax
lineinfile: lineinfile:
path: /etc/ssh/sshd_config path: /etc/ssh/sshd_config
regexp: '^#?ClientAliveCountMax' regexp: '^#?ClientAliveCountMax'
line: ClientAliveCountMax 3 line: '#ClientAliveCountMax 3'
notify: Restart sshd notify: Restart sshd

View File

@ -38,6 +38,7 @@
dest: ~/.kube/config dest: ~/.kube/config
remote_src: yes remote_src: yes
mode: "u=rw,g=,o=" mode: "u=rw,g=,o="
changed_when: no # TODO
- name: Set kubeconfig server ip - name: Set kubeconfig server ip
command: >- command: >-
@ -57,13 +58,3 @@
src: /usr/local/bin/k3s src: /usr/local/bin/k3s
dest: /usr/local/bin/crictl dest: /usr/local/bin/crictl
state: link state: link
# - name: Create longhorn install directory
# file:
# path: /var/lib/rancher/k3s/server/manifests/longhorn
# state: directory
# - name: Install longhorn
# get_url:
# url: https://raw.githubusercontent.com/longhorn/longhorn/v1.2.0/deploy/longhorn.yaml
# dest: /var/lib/rancher/k3s/server/manifests/longhorn/longhorn.yaml

View File

@ -1,3 +1,6 @@
# warning: iscsi is incompatible with lxc!
# https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1226855
- name: Download amd64 k3s binary - name: Download amd64 k3s binary
get_url: get_url:
url: https://github.com/k3s-io/k3s/releases/download/{{ k3s.version }}/k3s url: https://github.com/k3s-io/k3s/releases/download/{{ k3s.version }}/k3s

9
roles/k3s/tasks/vm.yml Normal file
View File

@ -0,0 +1,9 @@
- name: Download amd64 k3s binary
get_url:
url: https://github.com/k3s-io/k3s/releases/download/{{ k3s.version }}/k3s
checksum: sha256:https://github.com/k3s-io/k3s/releases/download/{{ k3s.version }}/sha256sum-amd64.txt
dest: /usr/local/bin/k3s
owner: root
group: root
mode: 0755
notify: reboot