fix: add tls sans options for k3s too (#1170)
* fix: add tls sans options for k3s too Signed-off-by: Devin Buhl <devin@buhl.casa> * chore: update comment Signed-off-by: Devin Buhl <devin@buhl.casa> --------- Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
1 parent
295f2e7eac
commit
b41ccc8145
12 files changed
+33
-21
No files matched your search
@@ -19,7 +19,7 @@ k3s_registration_address: "{{ kube_api_addr }}"
|
||||
k3s_server_manifests_templates:
|
||||
- custom-cilium-helmchart.yaml.j2
|
||||
- custom-coredns-helmchart.yaml.j2
|
||||
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr %#
|
||||
#% 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
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
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 %#
|
||||
#% 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 }#"
|
||||
|
||||
@@ -12,6 +12,9 @@ k3s_server:
|
||||
#% endif %#
|
||||
tls-san:
|
||||
- "{{ kube_api_addr }}"
|
||||
#% if bootstrap_kube_api_hostname | default('') %#
|
||||
- "{{ kube_api_hostname }}"
|
||||
#% endif %#
|
||||
docker: false
|
||||
flannel-backend: "none" # This needs to be in quotes
|
||||
disable:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#% if bootstrap_distribution == 'k3s' and (bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr) %#
|
||||
#% if bootstrap_distribution == 'k3s' and (bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr | default('')) %#
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
|
||||
@@ -44,14 +44,14 @@ spec:
|
||||
api:
|
||||
sans:
|
||||
- "#{ bootstrap_kube_api_addr }#"
|
||||
#% if bootstrap_kube_api_hostname is defined %#
|
||||
#% if bootstrap_kube_api_hostname | default('') %#
|
||||
- "#{ bootstrap_kube_api_hostname }#"
|
||||
#% endif %#
|
||||
#% for item in bootstrap_nodes.master %#
|
||||
#% if item.address != bootstrap_kube_api_addr %#
|
||||
- "#{ item.address }#"
|
||||
#% endif %#
|
||||
#% if (bootstrap_kube_api_hostname is not defined) or (item.name != bootstrap_kube_api_hostname) %#
|
||||
#% if (not bootstrap_kube_api_hostname | default('')) or (item.name != bootstrap_kube_api_hostname | default('')) %#
|
||||
- "#{ item.name }#"
|
||||
#% endif %#
|
||||
#% endfor %#
|
||||
@@ -90,10 +90,10 @@ spec:
|
||||
ipv6:
|
||||
enabled: true
|
||||
#% endif %#
|
||||
#% if bootstrap_nodes.master | length == 1 and not bootstrap_kube_api_addr %#
|
||||
k8sServiceHost: "#{ bootstrap_nodes.master[0].address }#"
|
||||
#% else %#
|
||||
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr | default('') %#
|
||||
k8sServiceHost: "#{ bootstrap_kube_api_addr }#"
|
||||
#% else %#
|
||||
k8sServiceHost: "#{ bootstrap_nodes.master[0].address }#"
|
||||
#% endif %#
|
||||
k8sServicePort: 6443
|
||||
kubeProxyReplacement: true
|
||||
|
||||
@@ -7,10 +7,10 @@ metadata:
|
||||
data:
|
||||
TIMEZONE: "#{ bootstrap_timezone }#"
|
||||
COREDNS_ADDR: "#{ bootstrap_service_cidr.split(',')[0] | nthhost(10) }#"
|
||||
#% if bootstrap_nodes.master | length == 1 and not bootstrap_kube_api_addr %#
|
||||
KUBE_API_ADDR: "#{ bootstrap_nodes.master[0].address }#"
|
||||
#% else %#
|
||||
#% 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 %#
|
||||
CLUSTER_CIDR: "#{ bootstrap_cluster_cidr.split(',')[0] }#"
|
||||
SERVICE_CIDR: "#{ bootstrap_service_cidr.split(',')[0] }#"
|
||||
|
||||
Reference in new issue
Block a user