feat: more changes to templating (#1218)

* feat: clean up more jinja default references

Signed-off-by: Devin Buhl <devin@buhl.casa>

* feat: add additional tls sans force kube-vip on k3s

Signed-off-by: Devin Buhl <devin@buhl.casa>

---------

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl authored and GitHub committed 2024-01-21 11:39:12 -05:00
1 parent 8339d142b7
commit e1330d734c
30 files changed
+65 -118

No files matched your search

@@ -11,7 +11,6 @@ k3s_registration_address: "{{ kube_api_addr }}"
# /var/lib/rancher/k3s/server/manifests
k3s_server_manifests_templates:
- custom-cilium-helmchart.yaml.j2
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr|default('') %#
# /var/lib/rancher/k3s/server/manifests
k3s_server_manifests_urls:
- url: https://raw.githubusercontent.com/kube-vip/website/main/content/manifests/rbac.yaml
@@ -20,4 +19,3 @@ k3s_server_manifests_urls:
k3s_server_pod_manifests_templates:
- kube-vip-static-pod.yaml.j2
#% endif %#
#% endif %#
@@ -3,18 +3,11 @@
timezone: "#{ bootstrap_timezone }#"
github_username: "#{ bootstrap_github_username }#"
coredns_addr: "#{ bootstrap_service_cidr.split(',')[0] | nthhost(10) }#"
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr|default('') %#
kube_api_addr: "#{ bootstrap_kube_api_addr }#"
#% else %#
kube_api_addr: "#{ bootstrap_nodes.master[0].address }#"
#% endif %#
#% if bootstrap_kube_api_hostname|default('') %#
kube_api_hostname: "#{ bootstrap_kube_api_hostname }#"
#% endif %#
cluster_cidr: "#{ bootstrap_cluster_cidr.split(',')[0] }#"
service_cidr: "#{ bootstrap_service_cidr.split(',')[0] }#"
node_cidr: "#{ bootstrap_node_cidr }#"
#% if bootstrap_ipv6_enabled|default(false) %#
#% if bootstrap_ipv6_enabled %#
cluster_cidr_v6: "#{ bootstrap_cluster_cidr.split(',')[1] }#"
service_cidr_v6: "#{ bootstrap_service_cidr.split(',')[1] }#"
#% endif %#
@@ -4,16 +4,16 @@
# https://github.com/PyratLabs/ansible-role-k3s
k3s_control_node: true
k3s_server:
#% if bootstrap_ipv6_enabled|default(false) %#
#% if bootstrap_ipv6_enabled %#
node-ip: "{{ ansible_host }},{{ ansible_default_ipv6.address }}"
#% else %#
node-ip: "{{ ansible_host }}"
#% endif %#
tls-san:
- "{{ kube_api_addr }}"
#% if bootstrap_kube_api_hostname|default('') %#
- "{{ kube_api_hostname }}"
#% endif %#
#% for item in bootstrap_kube_additional_tls_sans %#
- "{{ item }}"
#% endfor %#
docker: false
flannel-backend: "none" # quote
disable: ["flannel", "local-storage", "metrics-server", "servicelb", "traefik"]
@@ -23,7 +23,7 @@ k3s_server:
write-kubeconfig-mode: "644"
pause-image: registry.k8s.io/pause:3.9
secrets-encryption: true
#% if bootstrap_ipv6_enabled|default(false) %#
#% if bootstrap_ipv6_enabled %#
cluster-cidr: "{{ cluster_cidr }},{{ cluster_cidr_v6 }}"
service-cidr: "{{ service_cidr }},{{ service_cidr_v6 }}"
#% else %#
@@ -4,7 +4,7 @@
# https://github.com/PyratLabs/ansible-role-k3s
k3s_control_node: false
k3s_agent:
#% if bootstrap_ipv6_enabled|default(false) %#
#% if bootstrap_ipv6_enabled %#
node-ip: "{{ ansible_host }},{{ ansible_default_ipv6.address }}"
#% else %#
node-ip: "{{ ansible_host }}"