feat: add advanced features to config (#1208)
* feat: add advanced features to config Signed-off-by: Devin Buhl <devin@buhl.casa> * fix: only enable longhorn if distro is k3s or k0s Signed-off-by: Devin Buhl <devin@buhl.casa> * fix: update ansible lint Signed-off-by: Devin Buhl <devin@buhl.casa> --------- Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
1 parent
0fda1f6a56
commit
1ec59d1559
87 files changed
+158
-145
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Query Cloudflare zone
|
- name: Query Cloudflare zone
|
||||||
when: not ci_test | default(false)
|
when: not ci_test|default(false)
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: https://api.cloudflare.com/client/v4/zones?name={{ bootstrap_cloudflare_domain }}&status=active
|
url: https://api.cloudflare.com/client/v4/zones?name={{ bootstrap_cloudflare_domain }}&status=active
|
||||||
headers:
|
headers:
|
||||||
@@ -12,14 +12,14 @@
|
|||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Check if Cloudflare zone exists
|
- name: Check if Cloudflare zone exists
|
||||||
when: not ci_test | default(false)
|
when: not ci_test|default(false)
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: result.json.success is true
|
that: result.json.success is true
|
||||||
success_msg: Cloudflare zone {{ bootstrap_cloudflare_domain }} exists
|
success_msg: Cloudflare zone {{ bootstrap_cloudflare_domain }} exists
|
||||||
fail_msg: Cloudflare zone {{ bootstrap_cloudflare_domain }} does not exist
|
fail_msg: Cloudflare zone {{ bootstrap_cloudflare_domain }} does not exist
|
||||||
|
|
||||||
- name: Query Cloudflared tunnel
|
- name: Query Cloudflared tunnel
|
||||||
when: not ci_test | default(false)
|
when: not ci_test|default(false)
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: https://api.cloudflare.com/client/v4/accounts/{{ bootstrap_cloudflare_account_tag }}/cfd_tunnel/{{ bootstrap_cloudflare_tunnel_id }}
|
url: https://api.cloudflare.com/client/v4/accounts/{{ bootstrap_cloudflare_account_tag }}/cfd_tunnel/{{ bootstrap_cloudflare_tunnel_id }}
|
||||||
headers:
|
headers:
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Check if Cloudflared tunnel exists
|
- name: Check if Cloudflared tunnel exists
|
||||||
when: not ci_test | default(false)
|
when: not ci_test|default(false)
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: result.json.success is true
|
that: result.json.success is true
|
||||||
success_msg: Cloudflared tunnel {{ bootstrap_cloudflare_tunnel_id }} exists
|
success_msg: Cloudflared tunnel {{ bootstrap_cloudflare_tunnel_id }} exists
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Query Github username
|
- name: Query Github username
|
||||||
when: not ci_test | default(false)
|
when: not ci_test|default(false)
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: https://api.github.com/users/{{ bootstrap_github_username }}
|
url: https://api.github.com/users/{{ bootstrap_github_username }}
|
||||||
timeout: 5
|
timeout: 5
|
||||||
@@ -9,14 +9,14 @@
|
|||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Check if username exists
|
- name: Check if username exists
|
||||||
when: not ci_test | default(false)
|
when: not ci_test|default(false)
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: result.json.login == bootstrap_github_username
|
that: result.json.login == bootstrap_github_username
|
||||||
success_msg: Github user {{ bootstrap_github_username }} exists
|
success_msg: Github user {{ bootstrap_github_username }} exists
|
||||||
fail_msg: Github user {{ bootstrap_github_username }} does not exist
|
fail_msg: Github user {{ bootstrap_github_username }} does not exist
|
||||||
|
|
||||||
- name: Query Github repo
|
- name: Query Github repo
|
||||||
when: (not ci_test | default(false)) and (not bootstrap_private_github_repo | default(false))
|
when: (not ci_test|default(false)) and (not bootstrap_private_github_repo|default(false))
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: https://api.github.com/repos/{{ bootstrap_github_username }}/{{ bootstrap_github_repository_name }}
|
url: https://api.github.com/repos/{{ bootstrap_github_username }}/{{ bootstrap_github_repository_name }}
|
||||||
timeout: 5
|
timeout: 5
|
||||||
@@ -25,24 +25,24 @@
|
|||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Check if repo exists
|
- name: Check if repo exists
|
||||||
when: (not ci_test | default(false)) and (not bootstrap_private_github_repo | default(false))
|
when: (not ci_test|default(false)) and (not bootstrap_private_github_repo|default(false))
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: result.json.full_name == bootstrap_github_username + '/' + bootstrap_github_repository_name
|
that: result.json.full_name == bootstrap_github_username + '/' + bootstrap_github_repository_name
|
||||||
success_msg: Github repo {{ bootstrap_github_username }}/{{ bootstrap_github_repository_name }} exists
|
success_msg: Github repo {{ bootstrap_github_username }}/{{ bootstrap_github_repository_name }} exists
|
||||||
fail_msg: Github repo {{ bootstrap_github_username }}/{{ bootstrap_github_repository_name }} does not exist
|
fail_msg: Github repo {{ bootstrap_github_username }}/{{ bootstrap_github_repository_name }} does not exist
|
||||||
|
|
||||||
- name: Query Github repo branch
|
- name: Query Github repo branch
|
||||||
when: (not ci_test | default(false)) and (not bootstrap_private_github_repo | default(false))
|
when: (not ci_test|default(false)) and (not bootstrap_private_github_repo|default(false))
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: https://api.github.com/repos/{{ bootstrap_github_username }}/{{ bootstrap_github_repository_name }}/branches/{{ bootstrap_github_repository_branch | default('main', true) }}
|
url: https://api.github.com/repos/{{ bootstrap_github_username }}/{{ bootstrap_github_repository_name }}/branches/{{ bootstrap_github_repository_branch|default('main', true) }}
|
||||||
timeout: 5
|
timeout: 5
|
||||||
return_content: true
|
return_content: true
|
||||||
body_format: json
|
body_format: json
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Check if repo branch exists
|
- name: Check if repo branch exists
|
||||||
when: (not ci_test | default(false)) and (not bootstrap_private_github_repo | default(false))
|
when: (not ci_test|default(false)) and (not bootstrap_private_github_repo|default(false))
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: result.json.name == bootstrap_github_repository_branch | default('main', true)
|
that: result.json.name == bootstrap_github_repository_branch|default('main', true)
|
||||||
success_msg: Github repo branch {{ bootstrap_github_repository_branch | default('main', true) }} exists
|
success_msg: Github repo branch {{ bootstrap_github_repository_branch|default('main', true) }} exists
|
||||||
fail_msg: Github repo branch {{ bootstrap_github_repository_branch | default('main', true) }} does not exist
|
fail_msg: Github repo branch {{ bootstrap_github_repository_branch|default('main', true) }} does not exist
|
||||||
@@ -14,21 +14,21 @@
|
|||||||
fail_msg: Node CIDR {{ bootstrap_node_cidr }} is invalid.
|
fail_msg: Node CIDR {{ bootstrap_node_cidr }} is invalid.
|
||||||
|
|
||||||
- name: Check if cluster CIDR is ipv4 OR ipv6
|
- name: Check if cluster CIDR is ipv4 OR ipv6
|
||||||
when: not bootstrap_ipv6_enabled | default(false)
|
when: not bootstrap_ipv6_enabled|default(false)
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: bootstrap_cluster_cidr is ansible.utils.ipv4 or bootstrap_cluster_cidr is ansible.utils.ipv6
|
that: bootstrap_cluster_cidr is ansible.utils.ipv4 or bootstrap_cluster_cidr is ansible.utils.ipv6
|
||||||
success_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is valid.
|
success_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is valid.
|
||||||
fail_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is invalid.
|
fail_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is invalid.
|
||||||
|
|
||||||
- name: Check if service CIDR is ipv4 OR ipv6
|
- name: Check if service CIDR is ipv4 OR ipv6
|
||||||
when: not bootstrap_ipv6_enabled | default(false)
|
when: not bootstrap_ipv6_enabled|default(false)
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: bootstrap_service_cidr is ansible.utils.ipv4 or bootstrap_service_cidr is ansible.utils.ipv6
|
that: bootstrap_service_cidr is ansible.utils.ipv4 or bootstrap_service_cidr is ansible.utils.ipv6
|
||||||
success_msg: Service CIDR {{ bootstrap_service_cidr }} is valid.
|
success_msg: Service CIDR {{ bootstrap_service_cidr }} is valid.
|
||||||
fail_msg: Service CIDR {{ bootstrap_service_cidr }} is invalid.
|
fail_msg: Service CIDR {{ bootstrap_service_cidr }} is invalid.
|
||||||
|
|
||||||
- name: Check if cluster CIDR is ipv4 AND ipv6
|
- name: Check if cluster CIDR is ipv4 AND ipv6
|
||||||
when: bootstrap_ipv6_enabled | default(false)
|
when: bootstrap_ipv6_enabled|default(false)
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: >
|
that: >
|
||||||
(
|
(
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
fail_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is invalid.
|
fail_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is invalid.
|
||||||
|
|
||||||
- name: Check if service CIDR is ipv4 AND ipv6
|
- name: Check if service CIDR is ipv4 AND ipv6
|
||||||
when: bootstrap_ipv6_enabled | default(false)
|
when: bootstrap_ipv6_enabled|default(false)
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: >
|
that: >
|
||||||
(
|
(
|
||||||
@@ -122,24 +122,24 @@
|
|||||||
fail_msg: All IP addresses are not unique.
|
fail_msg: All IP addresses are not unique.
|
||||||
|
|
||||||
- name: Check if nodes are not the same IPs as k8s_gateway or ingress external/internal
|
- name: Check if nodes are not the same IPs as k8s_gateway or ingress external/internal
|
||||||
when: not bootstrap_kube_vip_enabled | default(true)
|
when: not bootstrap_kube_vip_enabled|default(true)
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: item.address not in (bootstrap_k8s_gateway_addr, bootstrap_external_ingress_addr, bootstrap_internal_ingress_addr)
|
that: item.address not in (bootstrap_k8s_gateway_addr, bootstrap_external_ingress_addr, bootstrap_internal_ingress_addr)
|
||||||
success_msg: Node address {{ item.address }} is different than k8s_gateway or ingress-nginx.
|
success_msg: Node address {{ item.address }} is different than k8s_gateway or ingress-nginx.
|
||||||
fail_msg: Node address {{ item.address }} is not different than k8s_gateway or ingress-nginx.
|
fail_msg: Node address {{ item.address }} is not different than k8s_gateway or ingress-nginx.
|
||||||
quiet: true
|
quiet: true
|
||||||
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}"
|
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker|default([]) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.address }}"
|
label: "{{ item.address }}"
|
||||||
|
|
||||||
- name: Check if nodes are not the same IPs as k8s_gateway, ingress external/internal or Kube API address
|
- name: Check if nodes are not the same IPs as k8s_gateway, ingress external/internal or Kube API address
|
||||||
when: (bootstrap_distribution == "k3s") and (bootstrap_kube_vip_enabled | default(true))
|
when: (bootstrap_distribution == "k3s") and (bootstrap_kube_vip_enabled|default(true))
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: item.address not in (bootstrap_k8s_gateway_addr, bootstrap_external_ingress_addr, bootstrap_internal_ingress_addr, bootstrap_kube_api_addr)
|
that: item.address not in (bootstrap_k8s_gateway_addr, bootstrap_external_ingress_addr, bootstrap_internal_ingress_addr, bootstrap_kube_api_addr)
|
||||||
success_msg: Node address {{ item.address }} is different than k8s_gateway, ingress-nginx or Kube API.
|
success_msg: Node address {{ item.address }} is different than k8s_gateway, ingress-nginx or Kube API.
|
||||||
fail_msg: Node address {{ item.address }} is not different than k8s_gateway, ingress-nginx or Kube API.
|
fail_msg: Node address {{ item.address }} is not different than k8s_gateway, ingress-nginx or Kube API.
|
||||||
quiet: true
|
quiet: true
|
||||||
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}"
|
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker|default([]) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.address }}"
|
label: "{{ item.address }}"
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@
|
|||||||
success_msg: Node address {{ item.address }} is valid.
|
success_msg: Node address {{ item.address }} is valid.
|
||||||
fail_msg: Node address {{ item.address }} is invalid.
|
fail_msg: Node address {{ item.address }} is invalid.
|
||||||
quiet: true
|
quiet: true
|
||||||
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}"
|
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker|default([]) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.address }}"
|
label: "{{ item.address }}"
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@
|
|||||||
success_msg: Node address {{ item.address }} is within {{ bootstrap_node_cidr }}.
|
success_msg: Node address {{ item.address }} is within {{ bootstrap_node_cidr }}.
|
||||||
fail_msg: Node address {{ item.address }} is not within {{ bootstrap_node_cidr }}.
|
fail_msg: Node address {{ item.address }} is not within {{ bootstrap_node_cidr }}.
|
||||||
quiet: true
|
quiet: true
|
||||||
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}"
|
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker|default([]) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.address }}"
|
label: "{{ item.address }}"
|
||||||
|
|
||||||
@@ -167,11 +167,11 @@
|
|||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: >
|
that: >
|
||||||
(
|
(
|
||||||
(bootstrap_nodes.master + bootstrap_nodes.worker | default([])) | map(attribute='address') | list
|
(bootstrap_nodes.master + bootstrap_nodes.worker|default([])) | map(attribute='address') | list
|
||||||
) | unique | length
|
) | unique | length
|
||||||
==
|
==
|
||||||
(
|
(
|
||||||
(bootstrap_nodes.master + bootstrap_nodes.worker | default([])) | map(attribute='address') | list
|
(bootstrap_nodes.master + bootstrap_nodes.worker|default([])) | map(attribute='address') | list
|
||||||
) | length
|
) | length
|
||||||
success_msg: All node IP addresses are unique.
|
success_msg: All node IP addresses are unique.
|
||||||
fail_msg: All node IP addresses are not unique.
|
fail_msg: All node IP addresses are not unique.
|
||||||
@@ -181,34 +181,34 @@
|
|||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: >
|
that: >
|
||||||
(
|
(
|
||||||
(bootstrap_nodes.master + bootstrap_nodes.worker | default([])) | map(attribute='name') | list
|
(bootstrap_nodes.master + bootstrap_nodes.worker|default([])) | map(attribute='name') | list
|
||||||
) | unique | length
|
) | unique | length
|
||||||
==
|
==
|
||||||
(
|
(
|
||||||
(bootstrap_nodes.master + bootstrap_nodes.worker | default([])) | map(attribute='name') | list
|
(bootstrap_nodes.master + bootstrap_nodes.worker|default([])) | map(attribute='name') | list
|
||||||
) | length
|
) | length
|
||||||
success_msg: All node names are unique.
|
success_msg: All node names are unique.
|
||||||
fail_msg: All node names are not unique.
|
fail_msg: All node names are not unique.
|
||||||
quiet: true
|
quiet: true
|
||||||
|
|
||||||
- name: Check if SSH ports are reachable
|
- name: Check if SSH ports are reachable
|
||||||
when: (not ci_test | default(false)) and (not bootstrap_distribution == "talos")
|
when: (not ci_test|default(false)) and (not bootstrap_distribution == "talos")
|
||||||
ansible.builtin.wait_for:
|
ansible.builtin.wait_for:
|
||||||
host: "{{ item.address }}"
|
host: "{{ item.address }}"
|
||||||
port: 22
|
port: 22
|
||||||
timeout: 10
|
timeout: 10
|
||||||
connection: local
|
connection: local
|
||||||
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}"
|
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker|default([]) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.address }}"
|
label: "{{ item.address }}"
|
||||||
|
|
||||||
- name: Check if Talos ports are reachable
|
- name: Check if Talos ports are reachable
|
||||||
when: (not ci_test | default(false)) and (bootstrap_distribution == "talos")
|
when: (not ci_test|default(false)) and (bootstrap_distribution == "talos")
|
||||||
ansible.builtin.wait_for:
|
ansible.builtin.wait_for:
|
||||||
host: "{{ item.address }}"
|
host: "{{ item.address }}"
|
||||||
port: 50000
|
port: 50000
|
||||||
timeout: 10
|
timeout: 10
|
||||||
connection: local
|
connection: local
|
||||||
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}"
|
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker|default([]) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.address }}"
|
label: "{{ item.address }}"
|
||||||
@@ -43,6 +43,6 @@
|
|||||||
that: item.name is match('^[a-z0-9-\.]+$')
|
that: item.name is match('^[a-z0-9-\.]+$')
|
||||||
success_msg: Node name {{ item.name }} is valid
|
success_msg: Node name {{ item.name }} is valid
|
||||||
fail_msg: Node name {{ item.name }} is not valid
|
fail_msg: Node name {{ item.name }} is not valid
|
||||||
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}"
|
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker|default([]) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.name }}"
|
label: "{{ item.name }}"
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#% if bootstrap_distribution == 'k3s' or bootstrap_distribution == 'k0s' %#
|
#% if bootstrap_distribution in ['k3s', 'k0s'] %#
|
||||||
skip_list:
|
skip_list:
|
||||||
|
- jinja[spacing]
|
||||||
- yaml[commas]
|
- yaml[commas]
|
||||||
- yaml[line-length]
|
- yaml[line-length]
|
||||||
- var-naming
|
- var-naming
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ k3s_registration_address: "{{ kube_api_addr }}"
|
|||||||
# /var/lib/rancher/k3s/server/manifests
|
# /var/lib/rancher/k3s/server/manifests
|
||||||
k3s_server_manifests_templates:
|
k3s_server_manifests_templates:
|
||||||
- custom-cilium-helmchart.yaml.j2
|
- custom-cilium-helmchart.yaml.j2
|
||||||
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr | default('') %#
|
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr|default('') %#
|
||||||
# /var/lib/rancher/k3s/server/manifests
|
# /var/lib/rancher/k3s/server/manifests
|
||||||
k3s_server_manifests_urls:
|
k3s_server_manifests_urls:
|
||||||
- url: https://raw.githubusercontent.com/kube-vip/website/main/content/manifests/rbac.yaml
|
- url: https://raw.githubusercontent.com/kube-vip/website/main/content/manifests/rbac.yaml
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
#% if bootstrap_distribution == 'k3s' or bootstrap_distribution == 'k0s' %#
|
#% if bootstrap_distribution in ['k3s', 'k0s'] %#
|
||||||
---
|
---
|
||||||
timezone: "#{ bootstrap_timezone }#"
|
timezone: "#{ bootstrap_timezone }#"
|
||||||
github_username: "#{ bootstrap_github_username }#"
|
github_username: "#{ bootstrap_github_username }#"
|
||||||
coredns_addr: "#{ bootstrap_service_cidr.split(',')[0] | nthhost(10) }#"
|
coredns_addr: "#{ bootstrap_service_cidr.split(',')[0] | nthhost(10) }#"
|
||||||
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr | default('') %#
|
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr|default('') %#
|
||||||
kube_api_addr: "#{ bootstrap_kube_api_addr }#"
|
kube_api_addr: "#{ bootstrap_kube_api_addr }#"
|
||||||
#% else %#
|
#% else %#
|
||||||
kube_api_addr: "#{ bootstrap_nodes.master[0].address }#"
|
kube_api_addr: "#{ bootstrap_nodes.master[0].address }#"
|
||||||
#% endif %#
|
#% endif %#
|
||||||
#% if bootstrap_kube_api_hostname | default('') %#
|
#% if bootstrap_kube_api_hostname|default('') %#
|
||||||
kube_api_hostname: "#{ bootstrap_kube_api_hostname }#"
|
kube_api_hostname: "#{ bootstrap_kube_api_hostname }#"
|
||||||
#% endif %#
|
#% endif %#
|
||||||
cluster_cidr: "#{ bootstrap_cluster_cidr.split(',')[0] }#"
|
cluster_cidr: "#{ bootstrap_cluster_cidr.split(',')[0] }#"
|
||||||
service_cidr: "#{ bootstrap_service_cidr.split(',')[0] }#"
|
service_cidr: "#{ bootstrap_service_cidr.split(',')[0] }#"
|
||||||
node_cidr: "#{ bootstrap_node_cidr }#"
|
node_cidr: "#{ bootstrap_node_cidr }#"
|
||||||
#% if bootstrap_ipv6_enabled | default(false) %#
|
#% if bootstrap_ipv6_enabled|default(false) %#
|
||||||
cluster_cidr_v6: "#{ bootstrap_cluster_cidr.split(',')[1] }#"
|
cluster_cidr_v6: "#{ bootstrap_cluster_cidr.split(',')[1] }#"
|
||||||
service_cidr_v6: "#{ bootstrap_service_cidr.split(',')[1] }#"
|
service_cidr_v6: "#{ bootstrap_service_cidr.split(',')[1] }#"
|
||||||
#% endif %#
|
#% endif %#
|
||||||
|
|||||||
@@ -4,14 +4,14 @@
|
|||||||
# https://github.com/PyratLabs/ansible-role-k3s
|
# https://github.com/PyratLabs/ansible-role-k3s
|
||||||
k3s_control_node: true
|
k3s_control_node: true
|
||||||
k3s_server:
|
k3s_server:
|
||||||
#% if bootstrap_ipv6_enabled | default(false) %#
|
#% if bootstrap_ipv6_enabled|default(false) %#
|
||||||
node-ip: "{{ ansible_host }},{{ ansible_default_ipv6.address }}"
|
node-ip: "{{ ansible_host }},{{ ansible_default_ipv6.address }}"
|
||||||
#% else %#
|
#% else %#
|
||||||
node-ip: "{{ ansible_host }}"
|
node-ip: "{{ ansible_host }}"
|
||||||
#% endif %#
|
#% endif %#
|
||||||
tls-san:
|
tls-san:
|
||||||
- "{{ kube_api_addr }}"
|
- "{{ kube_api_addr }}"
|
||||||
#% if bootstrap_kube_api_hostname | default('') %#
|
#% if bootstrap_kube_api_hostname|default('') %#
|
||||||
- "{{ kube_api_hostname }}"
|
- "{{ kube_api_hostname }}"
|
||||||
#% endif %#
|
#% endif %#
|
||||||
docker: false
|
docker: false
|
||||||
@@ -23,7 +23,7 @@ k3s_server:
|
|||||||
write-kubeconfig-mode: "644"
|
write-kubeconfig-mode: "644"
|
||||||
pause-image: registry.k8s.io/pause:3.9
|
pause-image: registry.k8s.io/pause:3.9
|
||||||
secrets-encryption: true
|
secrets-encryption: true
|
||||||
#% if bootstrap_ipv6_enabled | default(false) %#
|
#% if bootstrap_ipv6_enabled|default(false) %#
|
||||||
cluster-cidr: "{{ cluster_cidr }},{{ cluster_cidr_v6 }}"
|
cluster-cidr: "{{ cluster_cidr }},{{ cluster_cidr_v6 }}"
|
||||||
service-cidr: "{{ service_cidr }},{{ service_cidr_v6 }}"
|
service-cidr: "{{ service_cidr }},{{ service_cidr_v6 }}"
|
||||||
#% else %#
|
#% else %#
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# https://github.com/PyratLabs/ansible-role-k3s
|
# https://github.com/PyratLabs/ansible-role-k3s
|
||||||
k3s_control_node: false
|
k3s_control_node: false
|
||||||
k3s_agent:
|
k3s_agent:
|
||||||
#% if bootstrap_ipv6_enabled | default(false) %#
|
#% if bootstrap_ipv6_enabled|default(false) %#
|
||||||
node-ip: "{{ ansible_host }},{{ ansible_default_ipv6.address }}"
|
node-ip: "{{ ansible_host }},{{ ansible_default_ipv6.address }}"
|
||||||
#% else %#
|
#% else %#
|
||||||
node-ip: "{{ ansible_host }}"
|
node-ip: "{{ ansible_host }}"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if bootstrap_distribution == 'k3s' or bootstrap_distribution == 'k0s' %#
|
#% if bootstrap_distribution in ['k3s', 'k0s'] %#
|
||||||
---
|
---
|
||||||
kubernetes:
|
kubernetes:
|
||||||
children:
|
children:
|
||||||
@@ -9,7 +9,7 @@ kubernetes:
|
|||||||
ansible_user: "#{ item.username }#"
|
ansible_user: "#{ item.username }#"
|
||||||
ansible_host: "#{ item.address }#"
|
ansible_host: "#{ item.address }#"
|
||||||
#% endfor %#
|
#% endfor %#
|
||||||
#% if bootstrap_nodes.worker | default([]) | length > 0 %#
|
#% if bootstrap_nodes.worker|default([]) | length > 0 %#
|
||||||
worker:
|
worker:
|
||||||
hosts:
|
hosts:
|
||||||
#% for item in bootstrap_nodes.worker %#
|
#% for item in bootstrap_nodes.worker %#
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
kubeconfig: /etc/rancher/k3s/k3s.yaml
|
kubeconfig: /etc/rancher/k3s/k3s.yaml
|
||||||
kind: "{{ item.kind }}"
|
kind: "{{ item.kind }}"
|
||||||
name: "{{ item.name }}"
|
name: "{{ item.name }}"
|
||||||
namespace: "{{ item.namespace | default('') }}"
|
namespace: "{{ item.namespace|default('') }}"
|
||||||
wait: true
|
wait: true
|
||||||
wait_sleep: 10
|
wait_sleep: 10
|
||||||
wait_timeout: 360
|
wait_timeout: 360
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
block:
|
block:
|
||||||
- name: Locale | Set timezone
|
- name: Locale | Set timezone
|
||||||
community.general.timezone:
|
community.general.timezone:
|
||||||
name: "{{ timezone | default('Etc/UTC') }}"
|
name: "{{ timezone|default('Etc/UTC') }}"
|
||||||
|
|
||||||
- name: Packages
|
- name: Packages
|
||||||
block:
|
block:
|
||||||
@@ -62,6 +62,7 @@
|
|||||||
ff02::2 ip6-allrouters
|
ff02::2 ip6-allrouters
|
||||||
dest: /etc/hosts
|
dest: /etc/hosts
|
||||||
mode: preserve
|
mode: preserve
|
||||||
|
#% if bootstrap_advanced_flags|default({}) and bootstrap_advanced_flags.update_resolv_conf|default(true) %#
|
||||||
# https://github.com/onedr0p/flux-cluster-template/discussions/635
|
# https://github.com/onedr0p/flux-cluster-template/discussions/635
|
||||||
- name: Network Configuration | Remove immutable flag from /etc/resolv.conf
|
- name: Network Configuration | Remove immutable flag from /etc/resolv.conf
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
@@ -79,7 +80,8 @@
|
|||||||
dest: /etc/resolv.conf
|
dest: /etc/resolv.conf
|
||||||
content: |
|
content: |
|
||||||
search .
|
search .
|
||||||
nameserver #{ bootstrap_dns_server | default('1.1.1.1', true) }#
|
nameserver #{ bootstrap_dns_server|default('1.1.1.1', true) }#
|
||||||
|
#% endif %#
|
||||||
|
|
||||||
- name: System Configuration
|
- name: System Configuration
|
||||||
notify: Reboot
|
notify: Reboot
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if bootstrap_distribution == 'k3s' or bootstrap_distribution == 'k0s' %#
|
#% if bootstrap_distribution in ['k3s', 'k0s'] %#
|
||||||
---
|
---
|
||||||
- name: Reboot
|
- name: Reboot
|
||||||
hosts: kubernetes
|
hosts: kubernetes
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if bootstrap_distribution == 'k3s' or bootstrap_distribution == 'k0s' %#
|
#% if bootstrap_distribution in ['k3s', 'k0s'] %#
|
||||||
---
|
---
|
||||||
# https://github.com/kevincoakley/ansible-role-k8s-rolling-update
|
# https://github.com/kevincoakley/ansible-role-k8s-rolling-update
|
||||||
- name: Cluster rollout update
|
- name: Cluster rollout update
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if bootstrap_distribution == 'k3s' and (bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr | default('')) %#
|
#% if bootstrap_distribution == 'k3s' and (bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr|default('')) %#
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Pod
|
kind: Pod
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if discord_template_notifier.enabled | default(false) %#
|
#% if discord_template_notifier|default({}) and discord_template_notifier.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if discord_template_notifier.enabled | default(false) %#
|
#% if discord_template_notifier|default({}) and discord_template_notifier.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if discord_template_notifier.enabled | default(false) %#
|
#% if discord_template_notifier|default({}) and discord_template_notifier.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if discord_template_notifier.enabled | default(false) %#
|
#% if discord_template_notifier|default({}) and discord_template_notifier.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if homepage.enabled | default(false) %#
|
#% if homepage|default({}) and homepage.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if homepage.enabled | default(false) %#
|
#% if homepage|default({}) and homepage.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if homepage.enabled | default(false) %#
|
#% if homepage|default({}) and homepage.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if homepage.enabled | default(false) %#
|
#% if homepage|default({}) and homepage.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if homepage.enabled | default(false) %#
|
#% if homepage|default({}) and homepage.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
|||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./namespace.yaml
|
- ./namespace.yaml
|
||||||
#% if homepage.enabled | default(false) %#
|
#% if homepage|default({}) and homepage.enabled|default(false) %#
|
||||||
- ./homepage/ks.yaml
|
- ./homepage/ks.yaml
|
||||||
#% endif %#
|
#% endif %#
|
||||||
#% if discord_template_notifier.enabled | default(false) %#
|
#% if discord_template_notifier|default({}) and discord_template_notifier.enabled|default(false) %#
|
||||||
- ./discord-template-notifier/ks.yaml
|
- ./discord-template-notifier/ks.yaml
|
||||||
#% endif %#
|
#% endif %#
|
||||||
@@ -4,6 +4,6 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- ./namespace.yaml
|
- ./namespace.yaml
|
||||||
- ./addons/ks.yaml
|
- ./addons/ks.yaml
|
||||||
#% if weave_gitops.enabled | default(false) %#
|
#% if weave_gitops|default({}) and weave_gitops.enabled|default(false) %#
|
||||||
- ./weave-gitops/ks.yaml
|
- ./weave-gitops/ks.yaml
|
||||||
#% endif %#
|
#% endif %#
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
#% if weave_gitops.enabled | default(false) %#
|
#% if weave_gitops|default({}) and weave_gitops.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -31,7 +31,7 @@ spec:
|
|||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
className: internal
|
className: internal
|
||||||
#% if homepage.enabled | default(false) %#
|
#% if homepage|default({}) and homepage.enabled|default(false) %#
|
||||||
annotations:
|
annotations:
|
||||||
gethomepage.dev/enabled: "true"
|
gethomepage.dev/enabled: "true"
|
||||||
gethomepage.dev/group: Home
|
gethomepage.dev/group: Home
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if weave_gitops.enabled | default(false) %#
|
#% if weave_gitops|default({}) and weave_gitops.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if weave_gitops.enabled | default(false) %#
|
#% if weave_gitops|default({}) and weave_gitops.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if weave_gitops.enabled | default(false) %#
|
#% if weave_gitops|default({}) and weave_gitops.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
#% if not bootstrap_ipv6_enabled | default(false) %#
|
#% if not bootstrap_ipv6_enabled|default(false) %#
|
||||||
- ./cilium-l2.yaml
|
- ./cilium-l2.yaml
|
||||||
#% endif %#
|
#% endif %#
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
@@ -8,6 +8,6 @@ resources:
|
|||||||
- ./kubelet-csr-approver/ks.yaml
|
- ./kubelet-csr-approver/ks.yaml
|
||||||
#% endif %#
|
#% endif %#
|
||||||
- ./metrics-server/ks.yaml
|
- ./metrics-server/ks.yaml
|
||||||
#% if (bootstrap_distribution == "k0s" or bootstrap_distribution == "talos") and spegel.enabled | default(false) %#
|
#% if bootstrap_distribution in ['k0s', 'talos'] and spegel|default({}) and spegel.enabled|default(false) %#
|
||||||
- ./spegel/ks.yaml
|
- ./spegel/ks.yaml
|
||||||
#% endif %#
|
#% endif %#
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if (bootstrap_distribution == "k0s" or bootstrap_distribution == "talos") and spegel.enabled | default(false) %#
|
#% if bootstrap_distribution in ['k0s', 'talos'] and spegel|default({}) and spegel.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if (bootstrap_distribution == "k0s" or bootstrap_distribution == "talos") and spegel.enabled | default(false) %#
|
#% if bootstrap_distribution in ['k0s', 'talos'] and spegel|default({}) and spegel.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if (bootstrap_distribution == "k0s" or bootstrap_distribution == "talos") and spegel.enabled | default(false) %#
|
#% if bootstrap_distribution in ['k0s', 'talos'] and spegel|default({}) and spegel.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if longhorn.enabled | default(false) %#
|
#% if bootstrap_distribution in ['k0s', 'k3s'] and longhorn|default({}) and longhorn.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if longhorn.enabled | default(false) %#
|
#% if bootstrap_distribution in ['k0s', 'k3s'] and longhorn|default({}) and longhorn.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if longhorn.enabled | default(false) %#
|
#% if bootstrap_distribution in ['k0s', 'k3s'] and longhorn|default({}) and longhorn.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if longhorn.enabled | default(false) %#
|
#% if bootstrap_distribution in ['k0s', 'k3s'] and longhorn|default({}) and longhorn.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: storage.k8s.io/v1
|
apiVersion: storage.k8s.io/v1
|
||||||
kind: StorageClass
|
kind: StorageClass
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if longhorn.enabled | default(false) %#
|
#% if bootstrap_distribution in ['k0s', 'k3s'] and longhorn|default({}) and longhorn.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if longhorn.enabled | default(false) %#
|
#% if bootstrap_distribution in ['k0s', 'k3s'] and longhorn|default({}) and longhorn.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ spec:
|
|||||||
className: external
|
className: external
|
||||||
annotations:
|
annotations:
|
||||||
external-dns.alpha.kubernetes.io/target: "external.${SECRET_DOMAIN}"
|
external-dns.alpha.kubernetes.io/target: "external.${SECRET_DOMAIN}"
|
||||||
#% if homepage.enabled | default(false) %#
|
#% if homepage|default({}) and homepage.enabled|default(false) %#
|
||||||
gethomepage.dev/enabled: "true"
|
gethomepage.dev/enabled: "true"
|
||||||
gethomepage.dev/group: Network
|
gethomepage.dev/group: Network
|
||||||
gethomepage.dev/name: Echo Server
|
gethomepage.dev/name: Echo Server
|
||||||
|
|||||||
+1
-1
@@ -3,6 +3,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
|||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./staging.yaml
|
- ./staging.yaml
|
||||||
#% if bootstrap_acme_production_enabled | default(false) %#
|
#% if bootstrap_acme_production_enabled|default(false) %#
|
||||||
- ./production.yaml
|
- ./production.yaml
|
||||||
#% endif %#
|
#% endif %#
|
||||||
+1
-1
@@ -70,7 +70,7 @@ spec:
|
|||||||
namespaceSelector:
|
namespaceSelector:
|
||||||
any: true
|
any: true
|
||||||
extraArgs:
|
extraArgs:
|
||||||
#% if bootstrap_acme_production_enabled | default(false) %#
|
#% if bootstrap_acme_production_enabled|default(false) %#
|
||||||
default-ssl-certificate: "network/${SECRET_DOMAIN/./-}-production-tls"
|
default-ssl-certificate: "network/${SECRET_DOMAIN/./-}-production-tls"
|
||||||
#% else %#
|
#% else %#
|
||||||
default-ssl-certificate: "network/${SECRET_DOMAIN/./-}-staging-tls"
|
default-ssl-certificate: "network/${SECRET_DOMAIN/./-}-staging-tls"
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ spec:
|
|||||||
namespaceSelector:
|
namespaceSelector:
|
||||||
any: true
|
any: true
|
||||||
extraArgs:
|
extraArgs:
|
||||||
#% if bootstrap_acme_production_enabled | default(false) %#
|
#% if bootstrap_acme_production_enabled|default(false) %#
|
||||||
default-ssl-certificate: "network/${SECRET_DOMAIN/./-}-production-tls"
|
default-ssl-certificate: "network/${SECRET_DOMAIN/./-}-production-tls"
|
||||||
#% else %#
|
#% else %#
|
||||||
default-ssl-certificate: "network/${SECRET_DOMAIN/./-}-staging-tls"
|
default-ssl-certificate: "network/${SECRET_DOMAIN/./-}-staging-tls"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if grafana.enabled | default(false) %#
|
#% if grafana|default({}) and grafana.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -159,7 +159,7 @@ spec:
|
|||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
ingressClassName: internal
|
ingressClassName: internal
|
||||||
#% if homepage.enabled | default(false) %#
|
#% if homepage|default({}) and homepage.enabled|default(false) %#
|
||||||
annotations:
|
annotations:
|
||||||
gethomepage.dev/enabled: "true"
|
gethomepage.dev/enabled: "true"
|
||||||
gethomepage.dev/icon: grafana.png
|
gethomepage.dev/icon: grafana.png
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if grafana.enabled | default(false) %#
|
#% if grafana|default({}) and grafana.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if grafana.enabled | default(false) %#
|
#% if grafana|default({}) and grafana.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if grafana.enabled | default(false) %#
|
#% if grafana|default({}) and grafana.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
#% if kube_prometheus_stack.enabled | default(false) %#
|
#% if kube_prometheus_stack|default({}) and kube_prometheus_stack.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -121,7 +121,7 @@ spec:
|
|||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
ingressClassName: internal
|
ingressClassName: internal
|
||||||
#% if homepage.enabled | default(false) %#
|
#% if homepage|default({}) and homepage.enabled|default(false) %#
|
||||||
annotations:
|
annotations:
|
||||||
gethomepage.dev/enabled: "true"
|
gethomepage.dev/enabled: "true"
|
||||||
gethomepage.dev/icon: prometheus.png
|
gethomepage.dev/icon: prometheus.png
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if kube_prometheus_stack.enabled | default(false) %#
|
#% if kube_prometheus_stack|default({}) and kube_prometheus_stack.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if kube_prometheus_stack.enabled | default(false) %#
|
#% if kube_prometheus_stack|default({}) and kube_prometheus_stack.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
#% if kubernetes_dashboard.enabled | default(false) %#
|
#% if kubernetes_dashboard|default({}) and kubernetes_dashboard.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -31,7 +31,7 @@ spec:
|
|||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
className: internal
|
className: internal
|
||||||
#% if homepage.enabled | default(false) %#
|
#% if homepage|default({}) and homepage.enabled|default(false) %#
|
||||||
annotations:
|
annotations:
|
||||||
gethomepage.dev/enabled: "true"
|
gethomepage.dev/enabled: "true"
|
||||||
gethomepage.dev/icon: kubernetes-dashboard.png
|
gethomepage.dev/icon: kubernetes-dashboard.png
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if kubernetes_dashboard.enabled | default(false) %#
|
#% if kubernetes_dashboard|default({}) and kubernetes_dashboard.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if kubernetes_dashboard.enabled | default(false) %#
|
#% if kubernetes_dashboard|default({}) and kubernetes_dashboard.enabled|default(false) %#
|
||||||
# For dashboard sign in token:
|
# For dashboard sign in token:
|
||||||
# kubectl -n observability get secret kubernetes-dashboard -o jsonpath='{.data.token}' | base64 -d
|
# kubectl -n observability get secret kubernetes-dashboard -o jsonpath='{.data.token}' | base64 -d
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if kubernetes_dashboard.enabled | default(false) %#
|
#% if kubernetes_dashboard|default({}) and kubernetes_dashboard.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
|||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./namespace.yaml
|
- ./namespace.yaml
|
||||||
#% if grafana.enabled | default(false) %#
|
#% if grafana|default({}) and grafana.enabled|default(false) %#
|
||||||
- ./grafana/ks.yaml
|
- ./grafana/ks.yaml
|
||||||
#% endif %#
|
#% endif %#
|
||||||
#% if kube_prometheus_stack.enabled | default(false) %#
|
#% if kube_prometheus_stack|default({}) and kube_prometheus_stack.enabled|default(false) %#
|
||||||
- ./kube-prometheus-stack/ks.yaml
|
- ./kube-prometheus-stack/ks.yaml
|
||||||
#% endif %#
|
#% endif %#
|
||||||
#% if kubernetes_dashboard.enabled | default(false) %#
|
#% if kubernetes_dashboard|default({}) and kubernetes_dashboard.enabled|default(false) %#
|
||||||
- ./kubernetes-dashboard/ks.yaml
|
- ./kubernetes-dashboard/ks.yaml
|
||||||
#% endif %#
|
#% endif %#
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if csi_driver_nfs.enabled | default(false) %#
|
#% if csi_driver_nfs|default({}) and csi_driver_nfs.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if csi_driver_nfs.enabled | default(false) %#
|
#% if csi_driver_nfs|default({}) and csi_driver_nfs.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if csi_driver_nfs.enabled | default(false) %#
|
#% if csi_driver_nfs|default({}) and csi_driver_nfs.enabled|default(false) %#
|
||||||
#% for item in csi_driver_nfs.storage_class %#
|
#% for item in csi_driver_nfs.storage_class %#
|
||||||
---
|
---
|
||||||
apiVersion: storage.k8s.io/v1
|
apiVersion: storage.k8s.io/v1
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if csi_driver_nfs.enabled | default(false) %#
|
#% if csi_driver_nfs|default({}) and csi_driver_nfs.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- ./namespace.yaml
|
- ./namespace.yaml
|
||||||
- ./openebs/ks.yaml
|
- ./openebs/ks.yaml
|
||||||
#% if volsync.enabled | default(false) %#
|
#% if volsync|default({}) and volsync.enabled|default(false) %#
|
||||||
- ./volsync/ks.yaml
|
- ./volsync/ks.yaml
|
||||||
#% endif %#
|
#% endif %#
|
||||||
#% if csi_driver_nfs.enabled | default(false) %#
|
#% if csi_driver_nfs|default({}) and csi_driver_nfs.enabled|default(false) %#
|
||||||
- ./csi-driver-nfs/ks.yaml
|
- ./csi-driver-nfs/ks.yaml
|
||||||
#% endif %#
|
#% endif %#
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if volsync.enabled | default(false) %#
|
#% if volsync|default({}) and volsync.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if volsync.enabled | default(false) %#
|
#% if volsync|default({}) and volsync.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if volsync.enabled | default(false) %#
|
#% if volsync|default({}) and volsync.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: PrometheusRule
|
kind: PrometheusRule
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if volsync.enabled | default(false) %#
|
#% if volsync|default({}) and volsync.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -10,7 +10,7 @@ spec:
|
|||||||
commonMetadata:
|
commonMetadata:
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: *app
|
app.kubernetes.io/name: *app
|
||||||
#% if longhorn.enabled | default(false) %#
|
#% if longhorn|default({}) and longhorn.enabled|default(false) %#
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- name: longhorn
|
- name: longhorn
|
||||||
#% endif %#
|
#% endif %#
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
#% if volsync.enabled | default(false) %#
|
#% if volsync|default({}) and volsync.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -27,7 +27,7 @@ spec:
|
|||||||
keepHistory: false
|
keepHistory: false
|
||||||
values:
|
values:
|
||||||
controller:
|
controller:
|
||||||
#% if longhorn.enabled | default(false) %#
|
#% if bootstrap_distribution in ['k0s', 'k3s'] and longhorn|default({}) and longhorn.enabled|default(false) %#
|
||||||
volumeSnapshotClasses:
|
volumeSnapshotClasses:
|
||||||
- name: longhorn-snapclass
|
- name: longhorn-snapclass
|
||||||
annotations:
|
annotations:
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if volsync.enabled | default(false) %#
|
#% if volsync|default({}) and volsync.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
@@ -5,6 +5,6 @@ resources:
|
|||||||
- ./namespace.yaml
|
- ./namespace.yaml
|
||||||
- ./descheduler/ks.yaml
|
- ./descheduler/ks.yaml
|
||||||
- ./reloader/ks.yaml
|
- ./reloader/ks.yaml
|
||||||
#% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %#
|
#% if bootstrap_distribution == "k3s" and system_upgrade_controller|default({}) and system_upgrade_controller.enabled|default(false) %#
|
||||||
- ./system-upgrade-controller/ks.yaml
|
- ./system-upgrade-controller/ks.yaml
|
||||||
#% endif %#
|
#% endif %#
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %#
|
#% if bootstrap_distribution == "k3s" and system_upgrade_controller|default({}) and system_upgrade_controller.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %#
|
#% if bootstrap_distribution == "k3s" and system_upgrade_controller|default({}) and system_upgrade_controller.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %#
|
#% if bootstrap_distribution == "k3s" and system_upgrade_controller|default({}) and system_upgrade_controller.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %#
|
#% if bootstrap_distribution == "k3s" and system_upgrade_controller|default({}) and system_upgrade_controller.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %#
|
#% if bootstrap_distribution == "k3s" and system_upgrade_controller|default({}) and system_upgrade_controller.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: upgrade.cattle.io/v1
|
apiVersion: upgrade.cattle.io/v1
|
||||||
kind: Plan
|
kind: Plan
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %#
|
#% if bootstrap_distribution == "k3s" and system_upgrade_controller|default({}) and system_upgrade_controller.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %#
|
#% if bootstrap_distribution == "k3s" and system_upgrade_controller|default({}) and system_upgrade_controller.enabled|default(false) %#
|
||||||
---
|
---
|
||||||
apiVersion: upgrade.cattle.io/v1
|
apiVersion: upgrade.cattle.io/v1
|
||||||
kind: Plan
|
kind: Plan
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
interval: 30m
|
interval: 30m
|
||||||
ref:
|
ref:
|
||||||
branch: "#{ bootstrap_github_repository_branch | default('main', true) }#"
|
branch: "#{ bootstrap_github_repository_branch|default('main', true) }#"
|
||||||
#% if bootstrap_private_github_repo | default(false) %#
|
#% if bootstrap_private_github_repo|default(false) %#
|
||||||
secretRef:
|
secretRef:
|
||||||
name: github-deploy-key
|
name: github-deploy-key
|
||||||
url: "ssh://github.com/#{ bootstrap_github_username }#/#{ bootstrap_github_repository_name }#"
|
url: "ssh://github.com/#{ bootstrap_github_username }#/#{ bootstrap_github_repository_name }#"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ metadata:
|
|||||||
data:
|
data:
|
||||||
TIMEZONE: "#{ bootstrap_timezone }#"
|
TIMEZONE: "#{ bootstrap_timezone }#"
|
||||||
COREDNS_ADDR: "#{ bootstrap_service_cidr.split(',')[0] | nthhost(10) }#"
|
COREDNS_ADDR: "#{ bootstrap_service_cidr.split(',')[0] | nthhost(10) }#"
|
||||||
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr | default('') %#
|
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr|default('') %#
|
||||||
KUBE_API_ADDR: "#{ bootstrap_kube_api_addr }#"
|
KUBE_API_ADDR: "#{ bootstrap_kube_api_addr }#"
|
||||||
#% else %#
|
#% else %#
|
||||||
KUBE_API_ADDR: "#{ bootstrap_nodes.master[0].address }#"
|
KUBE_API_ADDR: "#{ bootstrap_nodes.master[0].address }#"
|
||||||
@@ -15,7 +15,7 @@ data:
|
|||||||
CLUSTER_CIDR: "#{ bootstrap_cluster_cidr.split(',')[0] }#"
|
CLUSTER_CIDR: "#{ bootstrap_cluster_cidr.split(',')[0] }#"
|
||||||
SERVICE_CIDR: "#{ bootstrap_service_cidr.split(',')[0] }#"
|
SERVICE_CIDR: "#{ bootstrap_service_cidr.split(',')[0] }#"
|
||||||
NODE_CIDR: "#{ bootstrap_node_cidr }#"
|
NODE_CIDR: "#{ bootstrap_node_cidr }#"
|
||||||
#% if bootstrap_ipv6_enabled | default(false) %#
|
#% if bootstrap_ipv6_enabled|default(false) %#
|
||||||
CLUSTER_CIDR_V6: "#{ bootstrap_cluster_cidr.split(',')[1] }#"
|
CLUSTER_CIDR_V6: "#{ bootstrap_cluster_cidr.split(',')[1] }#"
|
||||||
SERVICE_CIDR_V6: "#{ bootstrap_service_cidr.split(',')[1] }#"
|
SERVICE_CIDR_V6: "#{ bootstrap_service_cidr.split(',')[1] }#"
|
||||||
#% endif %#
|
#% endif %#
|
||||||
@@ -37,7 +37,7 @@ spec:
|
|||||||
before:
|
before:
|
||||||
- sudo bash /home/#{ item.username }#/k0s/hooks/apply-system.sh
|
- sudo bash /home/#{ item.username }#/k0s/hooks/apply-system.sh
|
||||||
- sudo mv /home/#{ item.username }#/k0s/containerd/unprivileged-ports.toml /etc/k0s/containerd.d/unprivileged-ports.toml
|
- sudo mv /home/#{ item.username }#/k0s/containerd/unprivileged-ports.toml /etc/k0s/containerd.d/unprivileged-ports.toml
|
||||||
#% if spegel.enabled | default(false) %#
|
#% if spegel|default({}) and spegel.enabled|default(false) %#
|
||||||
- sudo mv /home/#{ item.username }#/k0s/containerd/spegel.toml /etc/k0s/containerd.d/spegel.toml
|
- sudo mv /home/#{ item.username }#/k0s/containerd/spegel.toml /etc/k0s/containerd.d/spegel.toml
|
||||||
#% endif %#
|
#% endif %#
|
||||||
reset:
|
reset:
|
||||||
@@ -49,7 +49,7 @@ spec:
|
|||||||
hooks: *hooks
|
hooks: *hooks
|
||||||
#% endif %#
|
#% endif %#
|
||||||
#% endfor %#
|
#% endfor %#
|
||||||
#% if bootstrap_nodes.worker | default([]) | length > 0 %#
|
#% if bootstrap_nodes.worker|default([]) | length > 0 %#
|
||||||
#% for item in bootstrap_nodes.worker %#
|
#% for item in bootstrap_nodes.worker %#
|
||||||
- role: worker
|
- role: worker
|
||||||
ssh:
|
ssh:
|
||||||
@@ -82,14 +82,14 @@ spec:
|
|||||||
api:
|
api:
|
||||||
sans:
|
sans:
|
||||||
- "#{ bootstrap_kube_api_addr }#"
|
- "#{ bootstrap_kube_api_addr }#"
|
||||||
#% if bootstrap_kube_api_hostname | default('') %#
|
#% if bootstrap_kube_api_hostname|default('') %#
|
||||||
- "#{ bootstrap_kube_api_hostname }#"
|
- "#{ bootstrap_kube_api_hostname }#"
|
||||||
#% endif %#
|
#% endif %#
|
||||||
#% for item in bootstrap_nodes.master %#
|
#% for item in bootstrap_nodes.master %#
|
||||||
#% if item.address != bootstrap_kube_api_addr %#
|
#% if item.address != bootstrap_kube_api_addr %#
|
||||||
- "#{ item.address }#"
|
- "#{ item.address }#"
|
||||||
#% endif %#
|
#% endif %#
|
||||||
#% if (not bootstrap_kube_api_hostname | default('')) or (item.name != bootstrap_kube_api_hostname | default('')) %#
|
#% if (not bootstrap_kube_api_hostname|default('')) or (item.name != bootstrap_kube_api_hostname|default('')) %#
|
||||||
- "#{ item.name }#"
|
- "#{ item.name }#"
|
||||||
#% endif %#
|
#% endif %#
|
||||||
#% endfor %#
|
#% endfor %#
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#% if bootstrap_distribution == 'k0s' and spegel.enabled | default(false) %#
|
#% if bootstrap_distribution == 'k0s' and spegel|default({}) and spegel.enabled|default(false) %#
|
||||||
[plugins."io.containerd.grpc.v1.cri".registry]
|
[plugins."io.containerd.grpc.v1.cri".registry]
|
||||||
config_path = "/var/lib/k0s/containerd/certs.d"
|
config_path = "/var/lib/k0s/containerd/certs.d"
|
||||||
[plugins."io.containerd.grpc.v1.cri".containerd]
|
[plugins."io.containerd.grpc.v1.cri".containerd]
|
||||||
|
|||||||
@@ -16,14 +16,16 @@ apt-get install -y --no-install-recommends \
|
|||||||
nvme-cli open-iscsi parted psmisc python3 python3-apt python3-kubernetes python3-yaml \
|
nvme-cli open-iscsi parted psmisc python3 python3-apt python3-kubernetes python3-yaml \
|
||||||
smartmontools socat software-properties-common unzip util-linux
|
smartmontools socat software-properties-common unzip util-linux
|
||||||
|
|
||||||
|
#% if bootstrap_advanced_flags|default({}) and bootstrap_advanced_flags.update_resolv_conf|default(true) %#
|
||||||
# Update DNS
|
# Update DNS
|
||||||
chattr -i /etc/resolv.conf
|
chattr -i /etc/resolv.conf
|
||||||
rm -f /etc/resolv.conf
|
rm -f /etc/resolv.conf
|
||||||
cat <<EOF > /etc/resolv.conf
|
cat <<EOF > /etc/resolv.conf
|
||||||
search .
|
search .
|
||||||
nameserver #{ bootstrap_dns_server | default('1.1.1.1', true) }#
|
nameserver #{ bootstrap_dns_server|default('1.1.1.1', true) }#
|
||||||
EOF
|
EOF
|
||||||
chattr +i /etc/resolv.conf
|
chattr +i /etc/resolv.conf
|
||||||
|
#% endif %#
|
||||||
|
|
||||||
# Kernel Modules
|
# Kernel Modules
|
||||||
for module in br_netfilter ceph ip_vs ip_vs_rr nbd overlay rbd; do
|
for module in br_netfilter ceph ip_vs ip_vs_rr nbd overlay rbd; do
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ kubernetesVersion: 1.29.1
|
|||||||
|
|
||||||
clusterName: &cluster home-kubernetes
|
clusterName: &cluster home-kubernetes
|
||||||
|
|
||||||
#% if bootstrap_kube_api_hostname | default('') %#
|
#% if bootstrap_kube_api_hostname|default('') %#
|
||||||
endpoint: https://#{ bootstrap_kube_api_hostname }#:6443
|
endpoint: https://#{ bootstrap_kube_api_hostname }#:6443
|
||||||
#% else %#
|
#% else %#
|
||||||
endpoint: https://#{ bootstrap_kube_api_addr }#:6443
|
endpoint: https://#{ bootstrap_kube_api_addr }#:6443
|
||||||
@@ -22,7 +22,7 @@ clusterSvcNets:
|
|||||||
additionalApiServerCertSans: &sans
|
additionalApiServerCertSans: &sans
|
||||||
- "#{ bootstrap_kube_api_addr }#"
|
- "#{ bootstrap_kube_api_addr }#"
|
||||||
- 127.0.0.1 #KubePrism
|
- 127.0.0.1 #KubePrism
|
||||||
#% if bootstrap_kube_api_hostname | default('') %#
|
#% if bootstrap_kube_api_hostname|default('') %#
|
||||||
- "#{ bootstrap_kube_api_hostname }#"
|
- "#{ bootstrap_kube_api_hostname }#"
|
||||||
#% endif %#
|
#% endif %#
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ nodes:
|
|||||||
vip:
|
vip:
|
||||||
ip: "#{ bootstrap_kube_api_addr }#"
|
ip: "#{ bootstrap_kube_api_addr }#"
|
||||||
#% endfor %#
|
#% endfor %#
|
||||||
#% if bootstrap_nodes.worker | default([]) | length > 0 %#
|
#% if bootstrap_nodes.worker|default([]) | length > 0 %#
|
||||||
#% for item in bootstrap_nodes.worker %#
|
#% for item in bootstrap_nodes.worker %#
|
||||||
- hostname: "#{ item.name }#"
|
- hostname: "#{ item.name }#"
|
||||||
ipAddress: "#{ item.address }#"
|
ipAddress: "#{ item.address }#"
|
||||||
@@ -77,7 +77,7 @@ controlPlane:
|
|||||||
[plugins."io.containerd.grpc.v1.cri"]
|
[plugins."io.containerd.grpc.v1.cri"]
|
||||||
enable_unprivileged_ports = true
|
enable_unprivileged_ports = true
|
||||||
enable_unprivileged_icmp = true
|
enable_unprivileged_icmp = true
|
||||||
#% if spegel.enabled | default(false) %#
|
#% if spegel|default({}) and spegel.enabled|default(false) %#
|
||||||
[plugins."io.containerd.grpc.v1.cri".containerd]
|
[plugins."io.containerd.grpc.v1.cri".containerd]
|
||||||
discard_unpacked_layers = false
|
discard_unpacked_layers = false
|
||||||
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
|
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
|
||||||
@@ -123,7 +123,7 @@ controlPlane:
|
|||||||
machine:
|
machine:
|
||||||
network:
|
network:
|
||||||
nameservers:
|
nameservers:
|
||||||
- "#{ bootstrap_dns_server | default('1.1.1.1', true) }#"
|
- "#{ bootstrap_dns_server|default('1.1.1.1', true) }#"
|
||||||
|
|
||||||
# Configure NTP
|
# Configure NTP
|
||||||
- &ntpPatch |-
|
- &ntpPatch |-
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ hubble:
|
|||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
className: internal
|
className: internal
|
||||||
#% if homepage.enabled | default(false) %#
|
#% if homepage|default({}) and homepage.enabled|default(false) %#
|
||||||
annotations:
|
annotations:
|
||||||
gethomepage.dev/enabled: "true"
|
gethomepage.dev/enabled: "true"
|
||||||
gethomepage.dev/group: Network
|
gethomepage.dev/group: Network
|
||||||
@@ -59,7 +59,7 @@ hubble:
|
|||||||
ipam:
|
ipam:
|
||||||
mode: kubernetes
|
mode: kubernetes
|
||||||
ipv4NativeRoutingCIDR: "${CLUSTER_CIDR}"
|
ipv4NativeRoutingCIDR: "${CLUSTER_CIDR}"
|
||||||
#% if bootstrap_ipv6_enabled | default(false) %#
|
#% if bootstrap_ipv6_enabled|default(false) %#
|
||||||
ipv6NativeRoutingCIDR: "${CLUSTER_CIDR_V6}"
|
ipv6NativeRoutingCIDR: "${CLUSTER_CIDR_V6}"
|
||||||
ipv6:
|
ipv6:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -77,7 +77,7 @@ k8sServicePort: 7445
|
|||||||
kubeProxyReplacement: true
|
kubeProxyReplacement: true
|
||||||
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
|
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
|
||||||
l2announcements:
|
l2announcements:
|
||||||
#% if bootstrap_ipv6_enabled | default(false) %#
|
#% if bootstrap_ipv6_enabled|default(false) %#
|
||||||
enabled: false
|
enabled: false
|
||||||
#% else %#
|
#% else %#
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -88,7 +88,7 @@ l2announcements:
|
|||||||
#% endif %#
|
#% endif %#
|
||||||
loadBalancer:
|
loadBalancer:
|
||||||
algorithm: maglev
|
algorithm: maglev
|
||||||
mode: "#{ bootstrap_cilium_loadbalancer_mode | default('dsr', true) }#"
|
mode: "#{ bootstrap_cilium_loadbalancer_mode|default('dsr', true) }#"
|
||||||
localRedirectPolicy: true
|
localRedirectPolicy: true
|
||||||
operator:
|
operator:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ hubble:
|
|||||||
ipam:
|
ipam:
|
||||||
mode: kubernetes
|
mode: kubernetes
|
||||||
ipv4NativeRoutingCIDR: "#{ bootstrap_cluster_cidr }#"
|
ipv4NativeRoutingCIDR: "#{ bootstrap_cluster_cidr }#"
|
||||||
#% if bootstrap_ipv6_enabled | default(false) %#
|
#% if bootstrap_ipv6_enabled|default(false) %#
|
||||||
ipv6NativeRoutingCIDR: "#{ bootstrap_cluster_cidr_v6 }#"
|
ipv6NativeRoutingCIDR: "#{ bootstrap_cluster_cidr_v6 }#"
|
||||||
ipv6:
|
ipv6:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -38,7 +38,7 @@ k8sServicePort: 7445
|
|||||||
kubeProxyReplacement: true
|
kubeProxyReplacement: true
|
||||||
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
|
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
|
||||||
l2announcements:
|
l2announcements:
|
||||||
#% if bootstrap_ipv6_enabled | default(false) %#
|
#% if bootstrap_ipv6_enabled|default(false) %#
|
||||||
enabled: false
|
enabled: false
|
||||||
#% else %#
|
#% else %#
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -49,7 +49,7 @@ l2announcements:
|
|||||||
#% endif %#
|
#% endif %#
|
||||||
loadBalancer:
|
loadBalancer:
|
||||||
algorithm: maglev
|
algorithm: maglev
|
||||||
mode: "#{ bootstrap_cilium_loadbalancer_mode | default('dsr', true) }#"
|
mode: "#{ bootstrap_cilium_loadbalancer_mode|default('dsr', true) }#"
|
||||||
localRedirectPolicy: true
|
localRedirectPolicy: true
|
||||||
operator:
|
operator:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
providerRegex: ^(#{ (bootstrap_nodes.master + bootstrap_nodes.worker | default([])) | map(attribute='name') | join('|') }#)$
|
providerRegex: ^(#{ (bootstrap_nodes.master + bootstrap_nodes.worker|default([])) | map(attribute='name') | join('|') }#)$
|
||||||
bypassDnsResolution: true
|
bypassDnsResolution: true
|
||||||
@@ -64,6 +64,7 @@ spegel:
|
|||||||
longhorn:
|
longhorn:
|
||||||
# IMPORTANT: Only enable this if you have 3 or more nodes in your cluster
|
# IMPORTANT: Only enable this if you have 3 or more nodes in your cluster
|
||||||
# and you have enough IOPS on disk to support the number of replicas.
|
# and you have enough IOPS on disk to support the number of replicas.
|
||||||
|
# Longhorn is currently unsupported in Talos
|
||||||
# Note: Consider enabling volsync if you would like to configure snapshots
|
# Note: Consider enabling volsync if you would like to configure snapshots
|
||||||
# and backups to durable storage.
|
# and backups to durable storage.
|
||||||
enabled: false
|
enabled: false
|
||||||
@@ -95,3 +95,10 @@ bootstrap_nodes:
|
|||||||
# username: # ssh username of the worker node
|
# username: # ssh username of the worker node
|
||||||
# diskSerial: # (Required: Talos) Serial number of Disk for this worker node
|
# diskSerial: # (Required: Talos) Serial number of Disk for this worker node
|
||||||
# ...
|
# ...
|
||||||
|
|
||||||
|
#
|
||||||
|
# Do not make changes below this line unless you know what you are doing
|
||||||
|
#
|
||||||
|
|
||||||
|
# bootstrap_advanced_flags:
|
||||||
|
# update_resolv_conf: true # Disable to prevent changes to nodes /etc/resolv.conf
|
||||||
Reference in new issue
Block a user