fix: remove local hostpath and cilium lb vars and update k0s (#1261)
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
1 parent
95b0e2b0d8
commit
4ac206aef5
11 files changed
+32
-56
No files matched your search
@@ -93,7 +93,7 @@
|
|||||||
|
|
||||||
- name: Remove local storage path
|
- name: Remove local storage path
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "#{ bootstrap_advanced_flags.local_storage_path|default('/var/openebs/local', true) }#"
|
path: /var/openebs/local
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Reboot
|
- name: Reboot
|
||||||
|
|||||||
@@ -23,23 +23,11 @@
|
|||||||
- name: Packages | Install
|
- name: Packages | Install
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: apt-transport-https,ca-certificates,conntrack,curl,dirmngr,gdisk,gnupg,hdparm,htop,
|
name: apt-transport-https,ca-certificates,conntrack,curl,dirmngr,gdisk,gnupg,hdparm,htop,
|
||||||
iptables,iputils-ping,ipvsadm,libseccomp2,lm-sensors,neofetch,net-tools,nfs-common,
|
iptables,iputils-ping,ipvsadm,libseccomp2,lm-sensors,net-tools,nfs-common,
|
||||||
nvme-cli,open-iscsi,parted,psmisc,python3,python3-apt,python3-kubernetes,python3-yaml,
|
nvme-cli,open-iscsi,parted,psmisc,python3,python3-apt,python3-kubernetes,python3-yaml,
|
||||||
smartmontools,socat,software-properties-common,unzip,util-linux
|
smartmontools,socat,software-properties-common,unzip,util-linux
|
||||||
install_recommends: false
|
install_recommends: false
|
||||||
|
|
||||||
- name: User Configuration
|
|
||||||
block:
|
|
||||||
- name: User Configuration | Silence login
|
|
||||||
ansible.builtin.file:
|
|
||||||
dest: "{{ '/home/' + ansible_user if ansible_user != 'root' else '/root' }}/.hushlogin"
|
|
||||||
state: touch
|
|
||||||
owner: "{{ ansible_user }}"
|
|
||||||
group: "{{ ansible_user }}"
|
|
||||||
mode: "0644"
|
|
||||||
modification_time: preserve
|
|
||||||
access_time: preserve
|
|
||||||
|
|
||||||
- name: Network Configuration
|
- name: Network Configuration
|
||||||
notify: Reboot
|
notify: Reboot
|
||||||
block:
|
block:
|
||||||
@@ -82,11 +70,6 @@
|
|||||||
- name: System Configuration
|
- name: System Configuration
|
||||||
notify: Reboot
|
notify: Reboot
|
||||||
block:
|
block:
|
||||||
- name: System Configuration | Neofetch
|
|
||||||
ansible.builtin.copy:
|
|
||||||
dest: /etc/profile.d/neofetch.sh
|
|
||||||
mode: "0755"
|
|
||||||
content: neofetch --config none
|
|
||||||
- name: System Configuration | Disable apparmor
|
- name: System Configuration | Disable apparmor
|
||||||
when: ansible_facts.services['apparmor.service'] is defined
|
when: ansible_facts.services['apparmor.service'] is defined
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
|
|||||||
@@ -28,4 +28,4 @@ spec:
|
|||||||
enabled: true
|
enabled: true
|
||||||
name: openebs-hostpath
|
name: openebs-hostpath
|
||||||
isDefaultClass: false
|
isDefaultClass: false
|
||||||
basePath: "#{ bootstrap_advanced_flags.local_storage_path|default('/var/openebs/local', true) }#"
|
basePath: /var/openebs/local
|
||||||
@@ -13,31 +13,37 @@ spec:
|
|||||||
installFlags:
|
installFlags:
|
||||||
- --disable-components=metrics-server
|
- --disable-components=metrics-server
|
||||||
- --no-taints
|
- --no-taints
|
||||||
|
files:
|
||||||
|
- name: bootstrap-scripts
|
||||||
|
src: scripts
|
||||||
hooks:
|
hooks:
|
||||||
apply:
|
apply:
|
||||||
before:
|
before:
|
||||||
- curl -sfL https://raw.githubusercontent.com/#{ bootstrap_github_username }#/#{ bootstrap_github_repository_name }#/#{ bootstrap_advanced_flags.github_repository_branch|default('main', true) }#/kubernetes/k0s/resources/apply-system.sh | INSTALL_K0S_HOSTNAME="#{ item.name }#" bash -s -
|
- bash apply-system.sh "#{ item.name }#"
|
||||||
- curl -sfL https://raw.githubusercontent.com/#{ bootstrap_github_username }#/#{ bootstrap_github_repository_name }#/#{ bootstrap_advanced_flags.github_repository_branch|default('main', true) }#/kubernetes/k0s/resources/apply-kube-vip.sh | bash -s -
|
- bash apply-kube-vip.sh
|
||||||
reset:
|
reset:
|
||||||
before:
|
before:
|
||||||
- curl -sfL https://raw.githubusercontent.com/#{ bootstrap_github_username }#/#{ bootstrap_github_repository_name }#/#{ bootstrap_advanced_flags.github_repository_branch|default('main', true) }#/kubernetes/k0s/resources/reset-cilium.sh | bash -s -
|
- bash reset-cilium.sh
|
||||||
after:
|
after:
|
||||||
- curl -sfL https://raw.githubusercontent.com/#{ bootstrap_github_username }#/#{ bootstrap_github_repository_name }#/#{ bootstrap_advanced_flags.github_repository_branch|default('main', true) }#/kubernetes/k0s/resources/reset-system.sh | bash -s -
|
- bash reset-system.sh
|
||||||
#% endfor %#
|
#% endfor %#
|
||||||
#% for item in bootstrap_nodes.worker %#
|
#% for item in bootstrap_nodes.worker %#
|
||||||
- role: worker
|
- role: worker
|
||||||
ssh:
|
ssh:
|
||||||
address: "#{ item.address }#"
|
address: "#{ item.address }#"
|
||||||
user: "#{ item.ssh.username }#"
|
user: "#{ item.ssh.username }#"
|
||||||
|
files:
|
||||||
|
- name: bootstrap-scripts
|
||||||
|
src: scripts
|
||||||
hooks:
|
hooks:
|
||||||
apply:
|
apply:
|
||||||
before:
|
before:
|
||||||
- curl -sfL https://raw.githubusercontent.com/#{ bootstrap_github_username }#/#{ bootstrap_github_repository_name }#/#{ bootstrap_advanced_flags.github_repository_branch|default('main', true) }#/kubernetes/k0s/resources/apply-system.sh | INSTALL_K0S_HOSTNAME="#{ item.name }#" bash -s -
|
- bash apply-system.sh "#{ item.name }#"
|
||||||
reset:
|
reset:
|
||||||
before:
|
before:
|
||||||
- curl -sfL https://raw.githubusercontent.com/#{ bootstrap_github_username }#/#{ bootstrap_github_repository_name }#/#{ bootstrap_advanced_flags.github_repository_branch|default('main', true) }#/kubernetes/k0s/resources/reset-cilium.sh | bash -s -
|
- bash reset-cilium.sh
|
||||||
after:
|
after:
|
||||||
- curl -sfL https://raw.githubusercontent.com/#{ bootstrap_github_username }#/#{ bootstrap_github_repository_name }#/#{ bootstrap_advanced_flags.github_repository_branch|default('main', true) }#/kubernetes/k0s/resources/reset-system.sh | bash -s -
|
- bash reset-system.sh
|
||||||
#% endfor %#
|
#% endfor %#
|
||||||
k0s:
|
k0s:
|
||||||
# renovate: datasource=github-releases depName=k0sproject/k0s
|
# renovate: datasource=github-releases depName=k0sproject/k0s
|
||||||
|
|||||||
+2
-2
@@ -8,11 +8,11 @@ set -o noglob
|
|||||||
mkdir -p /var/lib/k0s/manifests/kube-vip
|
mkdir -p /var/lib/k0s/manifests/kube-vip
|
||||||
|
|
||||||
# Create kube-vip rbac
|
# Create kube-vip rbac
|
||||||
tee /var/lib/k0s/manifests/kube-vip/kube-vip-rbac.yaml > /dev/null <<EOF
|
cat >/var/lib/k0s/manifests/kube-vip/kube-vip-rbac.yaml <<EOF
|
||||||
#% include 'partials/kube-vip-rbac.partial.yaml.j2' %#
|
#% include 'partials/kube-vip-rbac.partial.yaml.j2' %#
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Create kube-vip daemonset
|
# Create kube-vip daemonset
|
||||||
tee /var/lib/k0s/manifests/kube-vip/kube-vip-ds.yaml > /dev/null <<EOF
|
cat >/var/lib/k0s/manifests/kube-vip/kube-vip-ds.yaml <<EOF
|
||||||
#% include 'partials/kube-vip-ds.partial.yaml.j2' %#
|
#% include 'partials/kube-vip-ds.partial.yaml.j2' %#
|
||||||
EOF
|
EOF
|
||||||
+10
-14
@@ -4,15 +4,17 @@ set -o noglob
|
|||||||
|
|
||||||
[ $(id -u) -eq 0 ] || exec sudo $0 $@
|
[ $(id -u) -eq 0 ] || exec sudo $0 $@
|
||||||
|
|
||||||
|
K0S_HOSTNAME="$1"
|
||||||
|
|
||||||
# Prepare
|
# Prepare
|
||||||
sudo apt-get update -y
|
sudo apt-get update -y
|
||||||
|
|
||||||
# Hostname
|
# Hostname
|
||||||
if [ -n "${INSTALL_K0S_HOSTNAME}" ] && [ "$(hostnamectl hostname)" != "${INSTALL_K0S_HOSTNAME}" ]; then
|
if [ -n "${K0S_HOSTNAME}" ] && [ "$(hostnamectl hostname)" != "${K0S_HOSTNAME}" ]; then
|
||||||
hostnamectl set-hostname "${INSTALL_K0S_HOSTNAME}"
|
hostnamectl set-hostname "${K0S_HOSTNAME}"
|
||||||
tee /etc/hosts > /dev/null <<EOF
|
cat >/etc/hosts <<EOF
|
||||||
127.0.0.1 localhost
|
127.0.0.1 localhost
|
||||||
127.0.1.1 $INSTALL_K0S_HOSTNAME
|
127.0.1.1 $K0S_HOSTNAME
|
||||||
::1 localhost ip6-localhost ip6-loopback
|
::1 localhost ip6-localhost ip6-loopback
|
||||||
ff02::1 ip6-allnodes
|
ff02::1 ip6-allnodes
|
||||||
ff02::2 ip6-allrouters
|
ff02::2 ip6-allrouters
|
||||||
@@ -25,7 +27,7 @@ timedatectl set-timezone "#{ bootstrap_timezone }#"
|
|||||||
# Install Packages
|
# Install Packages
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
apt-transport-https ca-certificates conntrack curl dirmngr gdisk gnupg hdparm htop \
|
apt-transport-https ca-certificates conntrack curl dirmngr gdisk gnupg hdparm htop \
|
||||||
iptables iputils-ping ipvsadm libseccomp2 lm-sensors neofetch net-tools nfs-common \
|
iptables iputils-ping ipvsadm libseccomp2 lm-sensors net-tools nfs-common \
|
||||||
nvme-cli open-iscsi parted psmisc python3 python3-apt python3-kubernetes python3-yaml \
|
nvme-cli open-iscsi parted psmisc python3 python3-apt python3-kubernetes python3-yaml \
|
||||||
smartmontools socat software-properties-common unzip util-linux
|
smartmontools socat software-properties-common unzip util-linux
|
||||||
|
|
||||||
@@ -33,7 +35,7 @@ apt-get install -y --no-install-recommends \
|
|||||||
# Update DNS
|
# Update DNS
|
||||||
chattr -i /etc/resolv.conf
|
chattr -i /etc/resolv.conf
|
||||||
rm -f /etc/resolv.conf
|
rm -f /etc/resolv.conf
|
||||||
tee /etc/resolv.conf > /dev/null <<EOF
|
cat >/etc/resolv.conf <<EOF
|
||||||
search .
|
search .
|
||||||
nameserver #{ bootstrap_dns_server }#
|
nameserver #{ bootstrap_dns_server }#
|
||||||
EOF
|
EOF
|
||||||
@@ -49,7 +51,7 @@ done
|
|||||||
systemctl restart systemd-modules-load.service
|
systemctl restart systemd-modules-load.service
|
||||||
|
|
||||||
# Sysctls
|
# Sysctls
|
||||||
tee /etc/sysctl.d/99-kubernetes.conf > /dev/null <<EOF
|
cat >/etc/sysctl.d/99-kubernetes.conf <<EOF
|
||||||
fs.inotify.max_queued_events = 65536
|
fs.inotify.max_queued_events = 65536
|
||||||
fs.inotify.max_user_watches = 524288
|
fs.inotify.max_user_watches = 524288
|
||||||
fs.inotify.max_user_instances = 8192
|
fs.inotify.max_user_instances = 8192
|
||||||
@@ -64,15 +66,9 @@ if systemctl is-enabled apparmor.service; then
|
|||||||
systemctl mask apparmor.service
|
systemctl mask apparmor.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Neofetch
|
|
||||||
tee /etc/profile.d/neofetch.sh > /dev/null <<EOF
|
|
||||||
neofetch --config none
|
|
||||||
EOF
|
|
||||||
chmod 755 /etc/profile.d/neofetch.sh
|
|
||||||
|
|
||||||
# Create containerd config
|
# Create containerd config
|
||||||
mkdir -p /etc/k0s/containerd.d
|
mkdir -p /etc/k0s/containerd.d
|
||||||
tee /etc/k0s/containerd.d/default.toml > /dev/null <<EOF
|
cat >/etc/k0s/containerd.d/default.toml <<EOF
|
||||||
[plugins."io.containerd.grpc.v1.cri"]
|
[plugins."io.containerd.grpc.v1.cri"]
|
||||||
enable_unprivileged_ports = true
|
enable_unprivileged_ports = true
|
||||||
enable_unprivileged_icmp = true
|
enable_unprivileged_icmp = true
|
||||||
+1
-1
@@ -7,7 +7,7 @@ set -o noglob
|
|||||||
remove_interfaces() {
|
remove_interfaces() {
|
||||||
ip link show 2>/dev/null | grep 'cilium' | while read ignore iface ignore; do
|
ip link show 2>/dev/null | grep 'cilium' | while read ignore iface ignore; do
|
||||||
iface=${iface%%@*}
|
iface=${iface%%@*}
|
||||||
[ -z "$iface" ] || ip link delete $iface
|
[ -z "$iface" ] || (ip link delete $iface || true)
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
+1
-1
@@ -8,7 +8,7 @@ set -o noglob
|
|||||||
rm -rf /etc/k0s/containerd.d
|
rm -rf /etc/k0s/containerd.d
|
||||||
|
|
||||||
# Remove local storage data
|
# Remove local storage data
|
||||||
rm -rf "#{ bootstrap_advanced_flags.local_storage_path|default('/var/openebs/local', true) }#"
|
rm -rf /var/openebs/local
|
||||||
|
|
||||||
# Reboot
|
# Reboot
|
||||||
(sleep 10 && systemctl reboot)&
|
(sleep 10 && systemctl reboot)&
|
||||||
@@ -82,7 +82,7 @@ l2announcements:
|
|||||||
#% endif %#
|
#% endif %#
|
||||||
loadBalancer:
|
loadBalancer:
|
||||||
algorithm: maglev
|
algorithm: maglev
|
||||||
mode: "#{ bootstrap_advanced_flags.cilium_loadbalancer_mode|default('dsr', true) }#"
|
mode: dsr
|
||||||
localRedirectPolicy: true
|
localRedirectPolicy: true
|
||||||
operator:
|
operator:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ l2announcements:
|
|||||||
#% endif %#
|
#% endif %#
|
||||||
loadBalancer:
|
loadBalancer:
|
||||||
algorithm: maglev
|
algorithm: maglev
|
||||||
mode: "#{ bootstrap_advanced_flags.cilium_loadbalancer_mode|default('dsr', true) }#"
|
mode: dsr
|
||||||
localRedirectPolicy: true
|
localRedirectPolicy: true
|
||||||
operator:
|
operator:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
|
|||||||
@@ -102,15 +102,6 @@ bootstrap_nodes:
|
|||||||
# # Disable to prevent changes to nodes /etc/resolv.conf
|
# # Disable to prevent changes to nodes /etc/resolv.conf
|
||||||
# update_resolv_conf: true
|
# update_resolv_conf: true
|
||||||
#
|
#
|
||||||
# # Cilium load balancer mode, choose either 'dsr' or 'snat'
|
|
||||||
# # Due to unknown reasons some people need this set to 'snat' in order
|
|
||||||
# # for Cilium L2 announcements to work properly. Keep this dsr unless
|
|
||||||
# # you have issues with connecting to Cilium L2 announcements.
|
|
||||||
# cilium_loadbalancer_mode: dsr
|
|
||||||
#
|
|
||||||
# # Path for openebs openebs-hostpath to use for storage on ALL nodes
|
|
||||||
# local_storage_path: /var/openebs/local
|
|
||||||
#
|
|
||||||
# # Enable Dual Stack IPv4 first
|
# # Enable Dual Stack IPv4 first
|
||||||
# # IMPORTANT: I am looking for people to help maintain IPv6 support since I cannot test it.
|
# # IMPORTANT: I am looking for people to help maintain IPv6 support since I cannot test it.
|
||||||
# # https://github.com/onedr0p/flux-cluster-template/issues/1148
|
# # https://github.com/onedr0p/flux-cluster-template/issues/1148
|
||||||
|
|||||||
Reference in new issue
Block a user