-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·100 lines (87 loc) · 3.44 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·100 lines (87 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash
set -ouex pipefail
###############################################################################
# OS-POC Build Script
# Installs: ZFS, KVM/libvirt, Kubernetes (k3s-selinux), OpenStack clients
###############################################################################
# ─── ZFS Support ─────────────────────────────────────────────────────────────
# Install ZFS kernel module and userspace tools
dnf5 install -y \
https://zfsonlinux.org/fedora/zfs-release-2-6$(rpm --eval "%{dist}").noarch.rpm || true
dnf5 install -y \
zfs \
zfs-dracut
# ─── KVM / Libvirt Hypervisor ────────────────────────────────────────────────
dnf5 install -y \
qemu-kvm \
libvirt \
libvirt-daemon-kvm \
libvirt-client \
virt-install \
virt-top \
bridge-utils \
openvswitch \
ebtables \
dnsmasq
# ─── Kubernetes (K3s will be installed at first-boot, but we need SELinux policies + tools) ─
dnf5 install -y \
container-selinux \
iptables \
nftables \
ethtool \
socat \
conntrack-tools \
kubectl \
helm
# ─── OpenStack Clients ──────────────────────────────────────────────────────
dnf5 install -y \
python3-openstackclient \
python3-pip
# ─── General Tools ──────────────────────────────────────────────────────────
dnf5 install -y \
tmux \
htop \
jq \
yq \
curl \
wget \
git \
rsync \
lvm2 \
nfs-utils \
ceph-common \
wireguard-tools \
chrony
# ─── Enable Services ────────────────────────────────────────────────────────
systemctl enable libvirtd.service
systemctl enable chronyd.service
systemctl enable openvswitch.service
systemctl enable podman.socket
# ─── Load ZFS module at boot ────────────────────────────────────────────────
echo "zfs" > /etc/modules-load.d/zfs.conf
# ─── Sysctl tuning for K8s + KVM ────────────────────────────────────────────
cat > /etc/sysctl.d/99-os-poc.conf <<'EOF'
# Kubernetes requirements
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 1
# KVM / VM performance
vm.swappiness = 10
vm.overcommit_memory = 1
net.core.somaxconn = 65535
net.ipv4.tcp_max_syn_backlog = 65535
fs.inotify.max_user_watches = 524288
fs.inotify.max_user_instances = 512
# ZFS ARC - let it use up to 50% RAM (tunable at runtime)
# vm.nr_hugepages is set at first-boot based on actual RAM
EOF
# ─── Kernel modules for networking ──────────────────────────────────────────
cat > /etc/modules-load.d/os-poc-networking.conf <<'EOF'
br_netfilter
overlay
vxlan
bonding
8021q
EOF
echo "Build complete."