add amd64 node to cluster
This commit is contained in:
parent
0b3c77d0b3
commit
387f5bccc7
|
@ -11,6 +11,7 @@ haproxy:
|
||||||
- 192.168.20.21
|
- 192.168.20.21
|
||||||
- 192.168.20.22
|
- 192.168.20.22
|
||||||
- 192.168.20.23
|
- 192.168.20.23
|
||||||
|
- 192.168.20.24
|
||||||
# - src:
|
# - src:
|
||||||
# - kubernetes-dashboard.badjnet.home
|
# - kubernetes-dashboard.badjnet.home
|
||||||
# - traefik.badjnet.home
|
# - traefik.badjnet.home
|
||||||
|
@ -28,6 +29,7 @@ haproxy:
|
||||||
- 192.168.20.21:30022
|
- 192.168.20.21:30022
|
||||||
- 192.168.20.22:30022
|
- 192.168.20.22:30022
|
||||||
- 192.168.20.23:30022
|
- 192.168.20.23:30022
|
||||||
|
- 192.168.20.24:30022
|
||||||
|
|
||||||
letsencrypt:
|
letsencrypt:
|
||||||
domains:
|
domains:
|
||||||
|
|
8
hosts
8
hosts
|
@ -45,14 +45,22 @@ all:
|
||||||
hosts:
|
hosts:
|
||||||
k3s-s0:
|
k3s-s0:
|
||||||
ansible_host: 192.168.20.20
|
ansible_host: 192.168.20.20
|
||||||
|
platform: raspberrypi
|
||||||
k3s-agent:
|
k3s-agent:
|
||||||
hosts:
|
hosts:
|
||||||
k3s-w0:
|
k3s-w0:
|
||||||
ansible_host: 192.168.20.21
|
ansible_host: 192.168.20.21
|
||||||
|
platform: raspberrypi
|
||||||
k3s-w1:
|
k3s-w1:
|
||||||
ansible_host: 192.168.20.22
|
ansible_host: 192.168.20.22
|
||||||
|
platform: raspberrypi
|
||||||
k3s-w2:
|
k3s-w2:
|
||||||
ansible_host: 192.168.20.23
|
ansible_host: 192.168.20.23
|
||||||
|
platform: raspberrypi
|
||||||
|
k3s-w3:
|
||||||
|
ansible_host: 192.168.20.24
|
||||||
|
platform: lxc
|
||||||
|
k3s_extra_args: --node-taint kubernetes.io/arch=amd64:PreferNoSchedule
|
||||||
debian:
|
debian:
|
||||||
hosts:
|
hosts:
|
||||||
ubiquiti:
|
ubiquiti:
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
k3s_extra_args: ""
|
|
@ -6,7 +6,7 @@ After=network-online.target
|
||||||
Type=notify
|
Type=notify
|
||||||
ExecStartPre=-/sbin/modprobe br_netfilter
|
ExecStartPre=-/sbin/modprobe br_netfilter
|
||||||
ExecStartPre=-/sbin/modprobe overlay
|
ExecStartPre=-/sbin/modprobe overlay
|
||||||
ExecStart=/usr/local/bin/k3s agent --server https://{{ hostvars[groups['k3s-server'][0]]['ansible_facts']['default_ipv4']['address'] }}:6443 --token {{ hostvars[groups['k3s-server'][0]]['token'] }} {{ k3s.extra_agent_args | default("") }}
|
ExecStart=/usr/local/bin/k3s agent --server https://{{ hostvars[groups['k3s-server'][0]]['ansible_facts']['default_ipv4']['address'] }}:6443 --token {{ hostvars[groups['k3s-server'][0]]['token'] }} {{ k3s.extra_agent_args | default("") }} {{ k3s_extra_args }}
|
||||||
KillMode=process
|
KillMode=process
|
||||||
Delegate=yes
|
Delegate=yes
|
||||||
# Having non-zero Limit*s causes performance problems due to accounting overhead
|
# Having non-zero Limit*s causes performance problems due to accounting overhead
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
k3s_extra_args: ""
|
|
@ -7,7 +7,7 @@ After=network-online.target
|
||||||
Type=notify
|
Type=notify
|
||||||
ExecStartPre=-/sbin/modprobe br_netfilter
|
ExecStartPre=-/sbin/modprobe br_netfilter
|
||||||
ExecStartPre=-/sbin/modprobe overlay
|
ExecStartPre=-/sbin/modprobe overlay
|
||||||
ExecStart=/usr/local/bin/k3s server {{ k3s.extra_server_args | default("") }}
|
ExecStart=/usr/local/bin/k3s server {{ k3s.extra_server_args | default("") }} {{ k3s_extra_args }}
|
||||||
KillMode=process
|
KillMode=process
|
||||||
Delegate=yes
|
Delegate=yes
|
||||||
# Having non-zero Limit*s causes performance problems due to accounting overhead
|
# Having non-zero Limit*s causes performance problems due to accounting overhead
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
platform: lxc
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/sh -e
|
||||||
|
|
||||||
|
# Kubeadm 1.15 needs /dev/kmsg to be there, but it's not in lxc, but we can just use /dev/console instead
|
||||||
|
# see: https://github.com/kubernetes-sigs/kind/issues/662
|
||||||
|
if [ ! -e /dev/kmsg ]; then
|
||||||
|
ln -s /dev/console /dev/kmsg
|
||||||
|
fi
|
||||||
|
|
||||||
|
# https://medium.com/@kvaps/run-kubernetes-in-lxc-container-f04aa94b6c9c
|
||||||
|
mount --make-rshared /
|
|
@ -0,0 +1,16 @@
|
||||||
|
- 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
|
||||||
|
|
||||||
|
- name: Configure /etc/rc.local
|
||||||
|
copy:
|
||||||
|
src: rc.local
|
||||||
|
dest: /etc/rc.local
|
||||||
|
mode: +x
|
||||||
|
notify: reboot
|
|
@ -1,21 +1,7 @@
|
||||||
- name: Download k3s binary
|
- name: Install required packages
|
||||||
get_url:
|
apt:
|
||||||
url: https://github.com/k3s-io/k3s/releases/download/{{ k3s.version }}/k3s-arm64
|
name:
|
||||||
checksum: sha256:https://github.com/k3s-io/k3s/releases/download/{{ k3s.version }}/sha256sum-arm64.txt
|
- open-iscsi
|
||||||
dest: /usr/local/bin/k3s
|
- nfs-common
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0755
|
|
||||||
notify: reboot
|
|
||||||
|
|
||||||
- name: Configure poe hat fan speed control udev rules
|
- include_tasks: '{{ platform }}.yml'
|
||||||
copy:
|
|
||||||
src: 50-rpi-fan.rules
|
|
||||||
dest: /etc/udev/rules.d/50-rpi-fan.rules
|
|
||||||
notify: reboot
|
|
||||||
|
|
||||||
- name: Configure kernel command line parameters
|
|
||||||
copy:
|
|
||||||
src: cmdline.txt
|
|
||||||
dest: /boot/firmware/cmdline.txt
|
|
||||||
notify: reboot
|
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
- name: Download arm64 k3s binary
|
||||||
|
get_url:
|
||||||
|
url: https://github.com/k3s-io/k3s/releases/download/{{ k3s.version }}/k3s-arm64
|
||||||
|
checksum: sha256:https://github.com/k3s-io/k3s/releases/download/{{ k3s.version }}/sha256sum-arm64.txt
|
||||||
|
dest: /usr/local/bin/k3s
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0755
|
||||||
|
notify: reboot
|
||||||
|
|
||||||
|
- name: Configure poe hat fan speed control udev rules
|
||||||
|
copy:
|
||||||
|
src: 50-rpi-fan.rules
|
||||||
|
dest: /etc/udev/rules.d/50-rpi-fan.rules
|
||||||
|
notify: reboot
|
||||||
|
|
||||||
|
- name: Configure kernel command line parameters
|
||||||
|
copy:
|
||||||
|
src: cmdline.txt
|
||||||
|
dest: /boot/firmware/cmdline.txt
|
||||||
|
notify: reboot
|
|
@ -34,6 +34,13 @@
|
||||||
line: 'acl:1:/:{{ item.key }}@pam:Administrator:'
|
line: 'acl:1:/:{{ item.key }}@pam:Administrator:'
|
||||||
with_dict: '{{ users }}'
|
with_dict: '{{ users }}'
|
||||||
|
|
||||||
|
- name: Enable ipv4 packet forwarding
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/sysctl.conf
|
||||||
|
regexp: '^#?net.ipv4.ip_forward='
|
||||||
|
line: net.ipv4.ip_forward=1
|
||||||
|
notify: update grub
|
||||||
|
|
||||||
# - name: Force quorum to always be reached
|
# - name: Force quorum to always be reached
|
||||||
# lineinfile:
|
# lineinfile:
|
||||||
# path: /etc/pve/corosync.conf
|
# path: /etc/pve/corosync.conf
|
||||||
|
|
Loading…
Reference in New Issue