feat: re-introduce flux vars for cluster network settings
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
8 files changed
+34
-26
No files matched your search
@@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
bootstrap_coredns_addr: "{{ bootstrap_service_cidr.split(',')[0] | ansible.utils.nthhost(10) }}"
|
|
||||||
@@ -1,8 +1,13 @@
|
|||||||
|
#jinja2: trim_blocks: True, lstrip_blocks: True
|
||||||
---
|
---
|
||||||
timezone: "{{ bootstrap_timezone }}"
|
timezone: "{{ bootstrap_timezone }}"
|
||||||
github_username: "{{ bootstrap_github_username }}"
|
github_username: "{{ bootstrap_github_username }}"
|
||||||
coredns_addr: "{{ bootstrap_coredns_addr }}"
|
coredns_addr: "{{ bootstrap_service_cidr.split(',')[0] | ansible.utils.nthhost(10) }}"
|
||||||
kube_vip_addr: "{{ bootstrap_kube_vip_addr }}"
|
kube_vip_addr: "{{ bootstrap_kube_vip_addr }}"
|
||||||
cluster_cidr: "{{ bootstrap_cluster_cidr }}"
|
cluster_cidr: "{{ bootstrap_cluster_cidr.split(',')[0] }}"
|
||||||
service_cidr: "{{ bootstrap_service_cidr }}"
|
service_cidr: "{{ bootstrap_service_cidr.split(',')[0] }}"
|
||||||
node_cidr: "{{ bootstrap_node_cidr }}"
|
node_cidr: "{{ bootstrap_node_cidr }}"
|
||||||
|
{% if bootstrap_ipv6_enabled | default(false) %}
|
||||||
|
cluster_cidr_v6: "{{ bootstrap_cluster_cidr.split(',')[1] }}"
|
||||||
|
service_cidr_v6: "{{ bootstrap_service_cidr.split(',')[1] }}"
|
||||||
|
{% endif %}
|
||||||
@@ -31,29 +31,26 @@ spec:
|
|||||||
enabled: false
|
enabled: false
|
||||||
ipam:
|
ipam:
|
||||||
mode: kubernetes
|
mode: kubernetes
|
||||||
|
ipv4NativeRoutingCIDR: "{% raw %}{{ cluster_cidr }}{% endraw %}"
|
||||||
{% if bootstrap_ipv6_enabled | default(false) %}
|
{% if bootstrap_ipv6_enabled | default(false) %}
|
||||||
ipv4NativeRoutingCIDR: "{% raw %}{{ k3s_server['cluster-cidr'].split(',')[0] }}{% endraw %}"
|
ipv6NativeRoutingCIDR: "{% raw %}{{ cluster_cidr_v6 }}{% endraw %}"
|
||||||
ipv6NativeRoutingCIDR: "{% raw %}{{ k3s_server['cluster-cidr'].split(',')[1] }}{% endraw %}"
|
|
||||||
ipv6:
|
ipv6:
|
||||||
enabled: true
|
enabled: true
|
||||||
{% else %}
|
|
||||||
ipv4NativeRoutingCIDR: "{% raw %}{{ k3s_server['cluster-cidr'] }}{% endraw %}"
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
k8sServiceHost: "{% raw %}{{ kube_vip_addr }}{% endraw %}"
|
k8sServiceHost: "{% raw %}{{ kube_vip_addr }}{% endraw %}"
|
||||||
k8sServicePort: 6443
|
k8sServicePort: 6443
|
||||||
kubeProxyReplacement: strict
|
kubeProxyReplacement: strict
|
||||||
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
|
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
|
||||||
{% if bootstrap_ipv6_enabled | default(false) %}
|
|
||||||
l2announcements:
|
l2announcements:
|
||||||
|
{% if bootstrap_ipv6_enabled | default(false) %}
|
||||||
enabled: false
|
enabled: false
|
||||||
{% else %}
|
{% else %}
|
||||||
# https://github.com/cilium/cilium/issues/26586
|
|
||||||
l2announcements:
|
|
||||||
enabled: true
|
enabled: true
|
||||||
|
# https://github.com/cilium/cilium/issues/26586
|
||||||
leaseDuration: 120s
|
leaseDuration: 120s
|
||||||
leaseRenewDeadline: 60s
|
leaseRenewDeadline: 60s
|
||||||
leaseRetryPeriod: 1s
|
leaseRetryPeriod: 1s
|
||||||
{% endif %}
|
{% endif %}
|
||||||
loadBalancer:
|
loadBalancer:
|
||||||
algorithm: maglev
|
algorithm: maglev
|
||||||
mode: dsr
|
mode: dsr
|
||||||
|
|||||||
@@ -19,8 +19,7 @@ spec:
|
|||||||
k8sAppLabelOverride: kube-dns
|
k8sAppLabelOverride: kube-dns
|
||||||
service:
|
service:
|
||||||
name: kube-dns
|
name: kube-dns
|
||||||
# Choose the 10th IP address from the start of the service-cidr
|
clusterIP: "{% raw %}{{ coredns_addr }}{% endraw %}"
|
||||||
clusterIP: "{% raw %}{{ k3s_server['service-cidr'].split(',')[0] | ansible.utils.nthhost(10) }}{% endraw %}"
|
|
||||||
serviceAccount:
|
serviceAccount:
|
||||||
create: true
|
create: true
|
||||||
deployment:
|
deployment:
|
||||||
|
|||||||
@@ -19,4 +19,4 @@ metadata:
|
|||||||
name: pool
|
name: pool
|
||||||
spec:
|
spec:
|
||||||
cidrs:
|
cidrs:
|
||||||
- cidr: "{{ bootstrap_node_cidr }}"
|
- cidr: "${NODE_CIDR}"
|
||||||
@@ -76,27 +76,26 @@ spec:
|
|||||||
- *host
|
- *host
|
||||||
ipam:
|
ipam:
|
||||||
mode: kubernetes
|
mode: kubernetes
|
||||||
ipv4NativeRoutingCIDR: "{{ bootstrap_cluster_cidr.split(',')[0] }}"
|
ipv4NativeRoutingCIDR: "${CLUSTER_CIDR}"
|
||||||
{% if bootstrap_ipv6_enabled | default(false) %}
|
{% if bootstrap_ipv6_enabled | default(false) %}
|
||||||
ipv6NativeRoutingCIDR: "{{ bootstrap_cluster_cidr.split(',')[1] }}"
|
ipv6NativeRoutingCIDR: "${CLUSTER_CIDR_V6}"
|
||||||
ipv6:
|
ipv6:
|
||||||
enabled: true
|
enabled: true
|
||||||
{% endif %}
|
{% endif %}
|
||||||
k8sServiceHost: "{{ bootstrap_kube_vip_addr }}"
|
k8sServiceHost: "${KUBE_VIP_ADDR}"
|
||||||
k8sServicePort: 6443
|
k8sServicePort: 6443
|
||||||
kubeProxyReplacement: strict
|
kubeProxyReplacement: strict
|
||||||
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
|
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
|
||||||
{% if bootstrap_ipv6_enabled | default(false) %}
|
|
||||||
l2announcements:
|
l2announcements:
|
||||||
|
{% if bootstrap_ipv6_enabled | default(false) %}
|
||||||
enabled: false
|
enabled: false
|
||||||
{% else %}
|
{% else %}
|
||||||
# https://github.com/cilium/cilium/issues/26586
|
|
||||||
l2announcements:
|
|
||||||
enabled: true
|
enabled: true
|
||||||
|
# https://github.com/cilium/cilium/issues/26586
|
||||||
leaseDuration: 120s
|
leaseDuration: 120s
|
||||||
leaseRenewDeadline: 60s
|
leaseRenewDeadline: 60s
|
||||||
leaseRetryPeriod: 1s
|
leaseRetryPeriod: 1s
|
||||||
{% endif %}
|
{% endif %}
|
||||||
loadBalancer:
|
loadBalancer:
|
||||||
algorithm: maglev
|
algorithm: maglev
|
||||||
mode: dsr
|
mode: dsr
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ spec:
|
|||||||
k8sAppLabelOverride: kube-dns
|
k8sAppLabelOverride: kube-dns
|
||||||
service:
|
service:
|
||||||
name: kube-dns
|
name: kube-dns
|
||||||
clusterIP: "{{ bootstrap_coredns_addr }}"
|
clusterIP: "${COREDNS_ADDR}"
|
||||||
serviceAccount:
|
serviceAccount:
|
||||||
create: true
|
create: true
|
||||||
deployment:
|
deployment:
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#jinja2: trim_blocks: True, lstrip_blocks: True
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
@@ -6,3 +7,12 @@ metadata:
|
|||||||
namespace: flux-system
|
namespace: flux-system
|
||||||
data:
|
data:
|
||||||
TIMEZONE: "{{ bootstrap_timezone }}"
|
TIMEZONE: "{{ bootstrap_timezone }}"
|
||||||
|
COREDNS_ADDR: "{{ bootstrap_service_cidr.split(',')[0] | ansible.utils.nthhost(10) }}"
|
||||||
|
KUBE_VIP_ADDR: "{{ bootstrap_kube_vip_addr }}"
|
||||||
|
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) %}
|
||||||
|
CLUSTER_CIDR_V6: "{{ bootstrap_cluster_cidr.split(',')[1] }}"
|
||||||
|
SERVICE_CIDR_V6: "{{ bootstrap_service_cidr.split(',')[1] }}"
|
||||||
|
{% endif %}
|
||||||
Reference in new issue
Block a user