feat: refactor config file (#1267)
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
1 parent
e4427a8325
commit
889ca07692
114 files changed
+721
-1042
No files matched your search
@@ -1 +1 @@
|
||||
main = lambda data: data.get("bootstrap_distribution") in ['k0s']
|
||||
main = lambda data: data.get("distribution") in ['k0s']
|
||||
@@ -5,14 +5,20 @@ metadata:
|
||||
name: home-kubernetes
|
||||
spec:
|
||||
hosts:
|
||||
#% for item in bootstrap_nodes.master %#
|
||||
#% for item in cluster.nodes.inventory %#
|
||||
#% if item.controller %#
|
||||
- role: controller+worker
|
||||
#% else %#
|
||||
- role: worker
|
||||
#% endif %#
|
||||
ssh:
|
||||
address: "#{ item.address }#"
|
||||
user: "#{ item.ssh.username }#"
|
||||
user: "#{ item.ssh_username }#"
|
||||
#% if item.controller %#
|
||||
installFlags:
|
||||
- --disable-components=metrics-server
|
||||
- --no-taints
|
||||
#% endif %#
|
||||
files:
|
||||
- name: bootstrap-scripts
|
||||
src: scripts
|
||||
@@ -20,25 +26,9 @@ spec:
|
||||
apply:
|
||||
before:
|
||||
- bash apply-system.sh "#{ item.name }#"
|
||||
#% if item.controller %#
|
||||
- bash apply-kube-vip.sh
|
||||
reset:
|
||||
before:
|
||||
- bash reset-cilium.sh
|
||||
after:
|
||||
- bash reset-system.sh
|
||||
#% endfor %#
|
||||
#% for item in bootstrap_nodes.worker %#
|
||||
- role: worker
|
||||
ssh:
|
||||
address: "#{ item.address }#"
|
||||
user: "#{ item.ssh.username }#"
|
||||
files:
|
||||
- name: bootstrap-scripts
|
||||
src: scripts
|
||||
hooks:
|
||||
apply:
|
||||
before:
|
||||
- bash apply-system.sh "#{ item.name }#"
|
||||
#% endif %#
|
||||
reset:
|
||||
before:
|
||||
- bash reset-cilium.sh
|
||||
@@ -65,23 +55,25 @@ spec:
|
||||
listen-metrics-urls: http://0.0.0.0:2381
|
||||
api:
|
||||
sans:
|
||||
#% if bootstrap_kube_api_addr %#
|
||||
- "#{ bootstrap_kube_api_addr }#"
|
||||
#% if cluster.endpoint_vip %#
|
||||
- "#{ cluster.endpoint_vip }#"
|
||||
#% endif %#
|
||||
#% for item in bootstrap_kube_additional_tls_sans %#
|
||||
#% for item in cluster.tls_sans %#
|
||||
- "#{ item }#"
|
||||
#% endfor %#
|
||||
#% for item in bootstrap_nodes.master %#
|
||||
#% for item in controllers %#
|
||||
#% if item.controller %#
|
||||
- "#{ item.address }#"
|
||||
- "#{ item.name }#"
|
||||
#% endif %#
|
||||
#% endfor %#
|
||||
network:
|
||||
podCIDR: "#{ bootstrap_cluster_cidr.split(',')[0] }#"
|
||||
serviceCIDR: "#{ bootstrap_service_cidr.split(',')[0] }#"
|
||||
podCIDR: "#{ cluster.pod_network.split(',')[0] }#"
|
||||
serviceCIDR: "#{ cluster.service_network.split(',')[0] }#"
|
||||
provider: custom
|
||||
kubeProxy:
|
||||
disabled: true
|
||||
nodeLocalLoadBalancing:
|
||||
sLocalLoadBalancing:
|
||||
enabled: true
|
||||
type: EnvoyProxy
|
||||
extensions:
|
||||
|
||||
@@ -22,7 +22,7 @@ EOF
|
||||
fi
|
||||
|
||||
# Timezone
|
||||
timedatectl set-timezone "#{ bootstrap_timezone }#"
|
||||
timedatectl set-timezone "#{ timezone }#"
|
||||
|
||||
# Install Packages
|
||||
apt-get install -y --no-install-recommends \
|
||||
@@ -31,16 +31,16 @@ apt-get install -y --no-install-recommends \
|
||||
nvme-cli open-iscsi parted psmisc python3 python3-apt python3-kubernetes python3-yaml \
|
||||
smartmontools socat software-properties-common unzip util-linux
|
||||
|
||||
#% if bootstrap_advanced_flags.update_resolv_conf|default(true) %#
|
||||
# Update DNS
|
||||
chattr -i /etc/resolv.conf
|
||||
rm -f /etc/resolv.conf
|
||||
cat >/etc/resolv.conf <<EOF
|
||||
search .
|
||||
nameserver #{ bootstrap_dns_server }#
|
||||
search #{ cluster.nodes.search_domain|default('.', true) }#
|
||||
#% for item in cluster.nodes.dns_servers %#
|
||||
nameserver #{ item }#
|
||||
#% endfor %#
|
||||
EOF
|
||||
chattr +i /etc/resolv.conf
|
||||
#% endif %#
|
||||
|
||||
# Kernel Modules
|
||||
for module in br_netfilter ceph ip_vs ip_vs_rr nbd overlay rbd; do
|
||||
|
||||
Reference in new issue
Block a user