feat: remove the need for raw jinja blocks (#1158)
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
1 parent
f9481d6202
commit
e6fbc6e128
92 files changed
+430
-441
No files matched your search
@@ -22,14 +22,12 @@
|
|||||||
},
|
},
|
||||||
"helm-values": {
|
"helm-values": {
|
||||||
"fileMatch": [
|
"fileMatch": [
|
||||||
"(^|/)addons/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
|
||||||
"(^|/)ansible/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
"(^|/)ansible/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
||||||
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?(\\.j2)?$"
|
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?(\\.j2)?$"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"kubernetes": {
|
"kubernetes": {
|
||||||
"fileMatch": [
|
"fileMatch": [
|
||||||
"(^|/)addons/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
|
||||||
"(^|/)ansible/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
"(^|/)ansible/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
||||||
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?(\\.j2)?$"
|
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?(\\.j2)?$"
|
||||||
]
|
]
|
||||||
@@ -225,7 +223,6 @@
|
|||||||
"description": "Process various other dependencies",
|
"description": "Process various other dependencies",
|
||||||
"fileMatch": [
|
"fileMatch": [
|
||||||
"(^|/).taskfiles/.+\\.ya?ml$",
|
"(^|/).taskfiles/.+\\.ya?ml$",
|
||||||
"(^|/)addons/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
|
||||||
"(^|/)ansible/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
"(^|/)ansible/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
||||||
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
||||||
"(^|/)k0s-config.ya?ml(\\.j2)?(\\.j2)?$"
|
"(^|/)k0s-config.ya?ml(\\.j2)?(\\.j2)?$"
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
e2e-yay:
|
yay:
|
||||||
name: e2e-yay
|
name: yay
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: greyltc/archlinux-aur:yay
|
image: greyltc/archlinux-aur:yay
|
||||||
@@ -30,8 +30,8 @@ jobs:
|
|||||||
go-task workstation:yay
|
go-task workstation:yay
|
||||||
'
|
'
|
||||||
|
|
||||||
e2e-configure:
|
configure:
|
||||||
name: e2e-configure
|
name: configure
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ tasks:
|
|||||||
# Move bootstrap directory to gitignored directory
|
# Move bootstrap directory to gitignored directory
|
||||||
- mkdir -p {{.ROOT_DIR}}/.private
|
- mkdir -p {{.ROOT_DIR}}/.private
|
||||||
- mv {{.BOOTSTRAP_DIR}} {{.ROOT_DIR}}/.private/bootstrap-{{now | date "150405"}}
|
- mv {{.BOOTSTRAP_DIR}} {{.ROOT_DIR}}/.private/bootstrap-{{now | date "150405"}}
|
||||||
|
- mv {{.ROOT_DIR}}/makejinja.toml {{.ROOT_DIR}}/.private/makejinja-{{now | date "150405"}}.toml
|
||||||
# Update renovate.json5
|
# Update renovate.json5
|
||||||
- sed -i {{if eq OS "darwin"}}''{{end}} 's/(..\.j2)\?(..\.j2)\?//g' {{.ROOT_DIR}}/.github/renovate.json5
|
- sed -i {{if eq OS "darwin"}}''{{end}} 's/(..\.j2)\?(..\.j2)\?//g' {{.ROOT_DIR}}/.github/renovate.json5
|
||||||
- sed -i {{if eq OS "darwin"}}''{{end}} '/addons/d' {{.ROOT_DIR}}/.github/renovate.json5
|
|
||||||
preconditions:
|
preconditions:
|
||||||
- { msg: "bootstrap dir not found", sh: "test -d {{.BOOTSTRAP_DIR}}" }
|
- { msg: "bootstrap dir not found", sh: "test -d {{.BOOTSTRAP_DIR}}" }
|
||||||
- { msg: "renovate.json5 not found", sh: "test -f {{.ROOT_DIR}}/.github/renovate.json5" }
|
- { msg: "renovate.json5 not found", sh: "test -f {{.ROOT_DIR}}/.github/renovate.json5" }
|
||||||
|
|||||||
+4
-10
@@ -65,15 +65,9 @@ tasks:
|
|||||||
internal: true
|
internal: true
|
||||||
cmds:
|
cmds:
|
||||||
- ./.venv/bin/makejinja
|
- ./.venv/bin/makejinja
|
||||||
--input "{{.BOOTSTRAP_DIR}}/templates"
|
|
||||||
--output "{{.ROOT_DIR}}"
|
|
||||||
--data "{{.BOOTSTRAP_DIR}}/vars/config.yaml"
|
|
||||||
--data "{{.BOOTSTRAP_DIR}}/vars/addons.yaml"
|
|
||||||
--import-path "{{.BOOTSTRAP_DIR}}/scripts"
|
|
||||||
--loader "loader:Loader"
|
|
||||||
--jinja-suffix ".j2" --quiet --force
|
|
||||||
- find {{.ANSIBLE_DIR}} {{.KUBERNETES_DIR}} -type d -empty -delete
|
- find {{.ANSIBLE_DIR}} {{.KUBERNETES_DIR}} -type d -empty -delete
|
||||||
preconditions:
|
preconditions:
|
||||||
- { msg: "addons file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/vars/addons.yaml" }
|
- { msg: "bootstrap addons file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/vars/addons.yaml" }
|
||||||
- { msg: "config file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/vars/config.yaml" }
|
- { msg: "bootstrap config file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/vars/config.yaml" }
|
||||||
- { msg: "loader file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/scripts/loader.py" }
|
- { msg: "makejinja loader file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/scripts/loader.py" }
|
||||||
|
- { msg: "makejinja config file not found", sh: "test -f {{.ROOT_DIR}}/makejinja.toml" }
|
||||||
@@ -4,8 +4,8 @@ creation_rules:
|
|||||||
encrypted_regex: "^(data|stringData)$"
|
encrypted_regex: "^(data|stringData)$"
|
||||||
key_groups:
|
key_groups:
|
||||||
- age:
|
- age:
|
||||||
- "{{ bootstrap_age_public_key }}"
|
- "<< bootstrap_age_public_key >>"
|
||||||
- path_regex: ansible/.*\.sops\.ya?ml
|
- path_regex: ansible/.*\.sops\.ya?ml
|
||||||
key_groups:
|
key_groups:
|
||||||
- age:
|
- age:
|
||||||
- "{{ bootstrap_age_public_key }}"
|
- "<< bootstrap_age_public_key >>"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
---
|
---
|
||||||
#
|
#
|
||||||
# Below vars are for the xanmanning.k3s role
|
# Below vars are for the xanmanning.k3s role
|
||||||
@@ -9,17 +9,17 @@
|
|||||||
k3s_release_version: "v1.29.0+k3s1"
|
k3s_release_version: "v1.29.0+k3s1"
|
||||||
k3s_install_hard_links: true
|
k3s_install_hard_links: true
|
||||||
k3s_become: true
|
k3s_become: true
|
||||||
{% if bootstrap_nodes.master | length > 1 %}
|
<% if bootstrap_nodes.master | length > 1 %>
|
||||||
k3s_etcd_datastore: true
|
k3s_etcd_datastore: true
|
||||||
{% else %}
|
<% else %>
|
||||||
k3s_etcd_datastore: false
|
k3s_etcd_datastore: false
|
||||||
{% endif %}
|
<% endif %>
|
||||||
k3s_registration_address: "{% raw %}{{ kube_api_addr }}{% endraw %}"
|
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
|
||||||
- custom-coredns-helmchart.yaml.j2
|
- custom-coredns-helmchart.yaml.j2
|
||||||
{% if bootstrap_nodes.master | length > 1 and not bootstrap_kube_api_addr %}
|
<% if bootstrap_nodes.master | length > 1 and not bootstrap_kube_api_addr %>
|
||||||
# /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
|
||||||
@@ -27,5 +27,5 @@ k3s_server_manifests_urls:
|
|||||||
# /var/lib/rancher/k3s/agent/pod-manifests
|
# /var/lib/rancher/k3s/agent/pod-manifests
|
||||||
k3s_server_pod_manifests_templates:
|
k3s_server_pod_manifests_templates:
|
||||||
- kube-vip-static-pod.yaml.j2
|
- kube-vip-static-pod.yaml.j2
|
||||||
{% endif %}
|
<% endif %>
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
---
|
---
|
||||||
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 and not bootstrap_kube_api_addr %}
|
<% if bootstrap_nodes.master | length == 1 and not bootstrap_kube_api_addr %>
|
||||||
kube_api_addr: "{{ bootstrap_nodes.master[0].address }}"
|
kube_api_addr: "<< bootstrap_nodes.master[0].address >>"
|
||||||
{% else %}
|
<% else %>
|
||||||
kube_api_addr: "{{ bootstrap_kube_api_addr }}"
|
kube_api_addr: "<< bootstrap_kube_api_addr >>"
|
||||||
{% 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 %>
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
---
|
---
|
||||||
# https://rancher.com/docs/k3s/latest/en/installation/install-options/server-config/
|
# https://rancher.com/docs/k3s/latest/en/installation/install-options/server-config/
|
||||||
# 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: "{% raw %}{{ ansible_host }},{{ ansible_default_ipv6.address }}{% endraw %}"
|
node-ip: "{{ ansible_host }},{{ ansible_default_ipv6.address }}"
|
||||||
{% else %}
|
<% else %>
|
||||||
node-ip: "{% raw %}{{ ansible_host }}{% endraw %}"
|
node-ip: "{{ ansible_host }}"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
tls-san:
|
tls-san:
|
||||||
- "{% raw %}{{ kube_api_addr }}{% endraw %}"
|
- "{{ kube_api_addr }}"
|
||||||
docker: false
|
docker: false
|
||||||
flannel-backend: "none" # This needs to be in quotes
|
flannel-backend: "none" # This needs to be in quotes
|
||||||
disable:
|
disable:
|
||||||
@@ -27,13 +27,13 @@ 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: "{% raw %}{{ cluster_cidr }},{{ cluster_cidr_v6 }}{% endraw %}"
|
cluster-cidr: "{{ cluster_cidr }},{{ cluster_cidr_v6 }}"
|
||||||
service-cidr: "{% raw %}{{ service_cidr }},{{ service_cidr_v6 }}{% endraw %}"
|
service-cidr: "{{ service_cidr }},{{ service_cidr_v6 }}"
|
||||||
{% else %}
|
<% else %>
|
||||||
cluster-cidr: "{% raw %}{{ cluster_cidr }}{% endraw %}"
|
cluster-cidr: "{{ cluster_cidr }}"
|
||||||
service-cidr: "{% raw %}{{ service_cidr }}{% endraw %}"
|
service-cidr: "{{ service_cidr }}"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
etcd-expose-metrics: true # Required to monitor etcd with kube-prometheus-stack
|
etcd-expose-metrics: true # Required to monitor etcd with kube-prometheus-stack
|
||||||
kube-controller-manager-arg:
|
kube-controller-manager-arg:
|
||||||
- "bind-address=0.0.0.0" # Required to monitor kube-controller-manager with kube-prometheus-stack
|
- "bind-address=0.0.0.0" # Required to monitor kube-controller-manager with kube-prometheus-stack
|
||||||
@@ -45,4 +45,4 @@ k3s_server:
|
|||||||
kubelet-arg:
|
kubelet-arg:
|
||||||
- "image-gc-high-threshold=55"
|
- "image-gc-high-threshold=55"
|
||||||
- "image-gc-low-threshold=50"
|
- "image-gc-low-threshold=50"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
---
|
---
|
||||||
# https://rancher.com/docs/k3s/latest/en/installation/install-options/agent-config/
|
# https://rancher.com/docs/k3s/latest/en/installation/install-options/agent-config/
|
||||||
# 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: "{% raw %}{{ ansible_host }},{{ ansible_default_ipv6.address }}{% endraw %}"
|
node-ip: "{{ ansible_host }},{{ ansible_default_ipv6.address }}"
|
||||||
{% else %}
|
<% else %>
|
||||||
node-ip: "{% raw %}{{ ansible_host }}{% endraw %}"
|
node-ip: "{{ ansible_host }}"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
pause-image: registry.k8s.io/pause:3.9
|
pause-image: registry.k8s.io/pause:3.9
|
||||||
# TODO: Move these options to a kubelet config file
|
# TODO: Move these options to a kubelet config file
|
||||||
kubelet-arg:
|
kubelet-arg:
|
||||||
- "image-gc-high-threshold=55"
|
- "image-gc-high-threshold=55"
|
||||||
- "image-gc-low-threshold=50"
|
- "image-gc-low-threshold=50"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -3,25 +3,25 @@ kubernetes:
|
|||||||
children:
|
children:
|
||||||
master:
|
master:
|
||||||
hosts:
|
hosts:
|
||||||
{% for item in bootstrap_nodes.master %}
|
<% for item in bootstrap_nodes.master %>
|
||||||
{{ item.name }}:
|
<< item.name >>:
|
||||||
ansible_user: {{ item.username }}
|
ansible_user: << item.username >>
|
||||||
{% if item.external_address is defined %}
|
<% if item.external_address is defined %>
|
||||||
ansible_host: {{ item.external_address }}
|
ansible_host: << item.external_address >>
|
||||||
{% else %}
|
<% else %>
|
||||||
ansible_host: {{ item.address }}
|
ansible_host: << item.address >>
|
||||||
{% endif %}
|
<% endif %>
|
||||||
{% 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 %>
|
||||||
{{ item.name }}:
|
<< item.name >>:
|
||||||
ansible_user: {{ item.username }}
|
ansible_user: << item.username >>
|
||||||
{% if item.external_address is defined %}
|
<% if item.external_address is defined %>
|
||||||
ansible_host: {{ item.external_address }}
|
ansible_host: << item.external_address >>
|
||||||
{% else %}
|
<% else %>
|
||||||
ansible_host: {{ item.address }}
|
ansible_host: << item.address >>
|
||||||
{% endif %}
|
<% endif %>
|
||||||
{% endfor %}
|
<% endfor %>
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
---
|
---
|
||||||
- name: Cluster Installation
|
- name: Cluster Installation
|
||||||
hosts: kubernetes
|
hosts: kubernetes
|
||||||
@@ -39,9 +39,9 @@
|
|||||||
or k3s_server_manifests_urls | length > 0)
|
or k3s_server_manifests_urls | length > 0)
|
||||||
kubernetes.core.k8s_info:
|
kubernetes.core.k8s_info:
|
||||||
kubeconfig: /etc/rancher/k3s/k3s.yaml
|
kubeconfig: /etc/rancher/k3s/k3s.yaml
|
||||||
kind: "{% raw %}{{ item.kind }}{% endraw %}"
|
kind: "{{ item.kind }}"
|
||||||
name: "{% raw %}{{ item.name }}{% endraw %}"
|
name: "{{ item.name }}"
|
||||||
namespace: "{% raw %}{{ item.namespace | default('') }}{% endraw %}"
|
namespace: "{{ item.namespace | default('') }}"
|
||||||
wait: true
|
wait: true
|
||||||
wait_sleep: 10
|
wait_sleep: 10
|
||||||
wait_timeout: 360
|
wait_timeout: 360
|
||||||
@@ -60,4 +60,4 @@
|
|||||||
- name: Cruft
|
- name: Cruft
|
||||||
when: k3s_primary_control_node
|
when: k3s_primary_control_node
|
||||||
ansible.builtin.include_tasks: tasks/cruft.yaml
|
ansible.builtin.include_tasks: tasks/cruft.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
---
|
---
|
||||||
- name: Cluster kube-vip
|
- name: Cluster kube-vip
|
||||||
hosts: master
|
hosts: master
|
||||||
@@ -21,6 +21,6 @@
|
|||||||
- name: Upgrade kube-vip
|
- name: Upgrade kube-vip
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: templates/kube-vip-static-pod.yaml.j2
|
src: templates/kube-vip-static-pod.yaml.j2
|
||||||
dest: "{% raw %}{{ k3s_server_pod_manifests_dir }}{% endraw %}/kube-vip-static-pod.yaml"
|
dest: "{{ k3s_server_pod_manifests_dir }}/kube-vip-static-pod.yaml"
|
||||||
mode: preserve
|
mode: preserve
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
ansible.builtin.pause:
|
ansible.builtin.pause:
|
||||||
seconds: 5
|
seconds: 5
|
||||||
tasks:
|
tasks:
|
||||||
{% if bootstrap_distribution == "k3s" %}
|
<% if bootstrap_distribution == "k3s" %>
|
||||||
- name: Stop Kubernetes # noqa: ignore-errors
|
- name: Stop Kubernetes # noqa: ignore-errors
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
block:
|
block:
|
||||||
@@ -31,24 +31,24 @@
|
|||||||
public: true
|
public: true
|
||||||
vars:
|
vars:
|
||||||
k3s_state: stopped
|
k3s_state: stopped
|
||||||
{% endif %}
|
<% endif %>
|
||||||
|
|
||||||
# https://github.com/k3s-io/docs/blob/main/docs/installation/network-options.md
|
# https://github.com/k3s-io/docs/blob/main/docs/installation/network-options.md
|
||||||
- name: Networking
|
- name: Networking
|
||||||
block:
|
block:
|
||||||
- name: Networking | Delete Cilium links
|
- name: Networking | Delete Cilium links
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: "ip link delete {% raw %}{{ item }}{% endraw %}"
|
cmd: "ip link delete {{ item }}"
|
||||||
removes: "/sys/class/net/{% raw %}{{ item }}{% endraw %}"
|
removes: "/sys/class/net/{{ item }}"
|
||||||
loop: ["cilium_host", "cilium_net", "cilium_vxlan"]
|
loop: ["cilium_host", "cilium_net", "cilium_vxlan"]
|
||||||
- name: Networking | Flush iptables
|
- name: Networking | Flush iptables
|
||||||
ansible.builtin.iptables:
|
ansible.builtin.iptables:
|
||||||
table: "{% raw %}{{ item }}{% endraw %}"
|
table: "{{ item }}"
|
||||||
flush: true
|
flush: true
|
||||||
loop: ["filter", "nat", "mangle", "raw"]
|
loop: ["filter", "nat", "mangle", "raw"]
|
||||||
- name: Networking | Flush ip6tables
|
- name: Networking | Flush ip6tables
|
||||||
ansible.builtin.iptables:
|
ansible.builtin.iptables:
|
||||||
table: "{% raw %}{{ item }}{% endraw %}"
|
table: "{{ item }}"
|
||||||
flush: true
|
flush: true
|
||||||
ip_version: ipv6
|
ip_version: ipv6
|
||||||
loop: ["filter", "nat", "mangle", "raw"]
|
loop: ["filter", "nat", "mangle", "raw"]
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
path: /etc/cni/net.d
|
path: /etc/cni/net.d
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
{% if bootstrap_distribution == "k3s" %}
|
<% if bootstrap_distribution == "k3s" %>
|
||||||
- name: Check to see if k3s-killall.sh exits
|
- name: Check to see if k3s-killall.sh exits
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: /usr/local/bin/k3s-killall.sh
|
path: /usr/local/bin/k3s-killall.sh
|
||||||
@@ -89,14 +89,14 @@
|
|||||||
- k3s_install_hard_links
|
- k3s_install_hard_links
|
||||||
- not ansible_check_mode
|
- not ansible_check_mode
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{% raw %}{{ k3s_install_dir }}/{{ item }}{% endraw %}"
|
path: "{{ k3s_install_dir }}/{{ item }}"
|
||||||
state: absent
|
state: absent
|
||||||
loop: ["kubectl", "crictl", "ctr"]
|
loop: ["kubectl", "crictl", "ctr"]
|
||||||
{% endif %}
|
<% endif %>
|
||||||
|
|
||||||
- name: Remove local storage path
|
- name: Remove local storage path
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ bootstrap_local_storage_path }}"
|
path: "<< bootstrap_local_storage_path >>"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Reboot
|
- name: Reboot
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
block:
|
block:
|
||||||
- name: Locale | Set timezone
|
- name: Locale | Set timezone
|
||||||
community.general.timezone:
|
community.general.timezone:
|
||||||
name: "{% raw %}{{ timezone | default('Etc/UTC') }}{% endraw %}"
|
name: "{{ timezone | default('Etc/UTC') }}"
|
||||||
|
|
||||||
- name: Packages
|
- name: Packages
|
||||||
block:
|
block:
|
||||||
@@ -31,14 +31,14 @@
|
|||||||
block:
|
block:
|
||||||
- name: User Configuration | SSH keys
|
- name: User Configuration | SSH keys
|
||||||
ansible.posix.authorized_key:
|
ansible.posix.authorized_key:
|
||||||
user: "{% raw %}{{ ansible_user }}{% endraw %}"
|
user: "{{ ansible_user }}"
|
||||||
key: "https://github.com/{% raw %}{{ github_username }}{% endraw %}.keys"
|
key: "https://github.com/{{ github_username }}.keys"
|
||||||
- name: User Configuration | Silence login
|
- name: User Configuration | Silence login
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
dest: "{% raw %}{{ '/home/' + ansible_user if ansible_user != 'root' else '/root' }}{% endraw %}/.hushlogin"
|
dest: "{{ '/home/' + ansible_user if ansible_user != 'root' else '/root' }}/.hushlogin"
|
||||||
state: touch
|
state: touch
|
||||||
owner: "{% raw %}{{ ansible_user }}{% endraw %}"
|
owner: "{{ ansible_user }}"
|
||||||
group: "{% raw %}{{ ansible_user }}{% endraw %}"
|
group: "{{ ansible_user }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
modification_time: preserve
|
modification_time: preserve
|
||||||
access_time: preserve
|
access_time: preserve
|
||||||
@@ -48,12 +48,12 @@
|
|||||||
block:
|
block:
|
||||||
- name: Network Configuration | Set hostname
|
- name: Network Configuration | Set hostname
|
||||||
ansible.builtin.hostname:
|
ansible.builtin.hostname:
|
||||||
name: "{% raw %}{{ inventory_hostname }}{% endraw %}"
|
name: "{{ inventory_hostname }}"
|
||||||
- name: Network Configuration | Update hosts
|
- name: Network Configuration | Update hosts
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
content: |
|
content: |
|
||||||
127.0.0.1 localhost
|
127.0.0.1 localhost
|
||||||
127.0.1.1 {% raw %}{{ inventory_hostname }}{% endraw %}
|
127.0.1.1 {{ inventory_hostname }}
|
||||||
|
|
||||||
# The following lines are desirable for IPv6 capable hosts
|
# The following lines are desirable for IPv6 capable hosts
|
||||||
::1 localhost ip6-localhost ip6-loopback
|
::1 localhost ip6-localhost ip6-loopback
|
||||||
@@ -96,15 +96,15 @@
|
|||||||
masked: true
|
masked: true
|
||||||
- name: System Configuration | Disable swap
|
- name: System Configuration | Disable swap
|
||||||
ansible.posix.mount:
|
ansible.posix.mount:
|
||||||
name: "{% raw %}{{ item }}{% endraw %}"
|
name: "{{ item }}"
|
||||||
fstype: swap
|
fstype: swap
|
||||||
state: absent
|
state: absent
|
||||||
loop: ["none", "swap"]
|
loop: ["none", "swap"]
|
||||||
- name: System Configuration | Create Kernel modules
|
- name: System Configuration | Create Kernel modules
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: "/etc/modules-load.d/{% raw %}{{ item }}{% endraw %}.conf"
|
dest: "/etc/modules-load.d/{{ item }}.conf"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
content: "{% raw %}{{ item }}{% endraw %}"
|
content: "{{ item }}"
|
||||||
loop: ["br_netfilter", "ceph", "ip_vs", "ip_vs_rr", "nbd", "overlay", "rbd"]
|
loop: ["br_netfilter", "ceph", "ip_vs", "ip_vs_rr", "nbd", "overlay", "rbd"]
|
||||||
register: modules_status
|
register: modules_status
|
||||||
- name: System Configuration | Reload Kernel modules # noqa: no-changed-when no-handler
|
- name: System Configuration | Reload Kernel modules # noqa: no-changed-when no-handler
|
||||||
@@ -114,11 +114,11 @@
|
|||||||
state: restarted
|
state: restarted
|
||||||
- name: System Configuration | Sysctl
|
- name: System Configuration | Sysctl
|
||||||
ansible.posix.sysctl:
|
ansible.posix.sysctl:
|
||||||
name: "{% raw %}{{ item.key }}{% endraw %}"
|
name: "{{ item.key }}"
|
||||||
value: "{% raw %}{{ item.value }}{% endraw %}"
|
value: "{{ item.value }}"
|
||||||
sysctl_file: /etc/sysctl.d/99-kubernetes.conf
|
sysctl_file: /etc/sysctl.d/99-kubernetes.conf
|
||||||
reload: true
|
reload: true
|
||||||
with_dict: "{% raw %}{{ sysctl_config }}{% endraw %}"
|
with_dict: "{{ sysctl_config }}"
|
||||||
vars:
|
vars:
|
||||||
sysctl_config:
|
sysctl_config:
|
||||||
fs.inotify.max_queued_events: 65536
|
fs.inotify.max_queued_events: 65536
|
||||||
|
|||||||
@@ -12,13 +12,13 @@
|
|||||||
seconds: 5
|
seconds: 5
|
||||||
tasks:
|
tasks:
|
||||||
- name: Details
|
- name: Details
|
||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
ansible.builtin.command: "k3s kubectl get node {% raw %}{{ inventory_hostname }}{% endraw %} -o json"
|
ansible.builtin.command: "k3s kubectl get node {{ inventory_hostname }} -o json"
|
||||||
{% elif bootstrap_distribution == 'k0s' %}
|
<% elif bootstrap_distribution == 'k0s' %>
|
||||||
ansible.builtin.command: "k0s kubectl get node {% raw %}{{ inventory_hostname }}{% endraw %} -o json"
|
ansible.builtin.command: "k0s kubectl get node {{ inventory_hostname }} -o json"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
register: kubectl_get_node
|
register: kubectl_get_node
|
||||||
delegate_to: "{% raw %}{{ groups['master'][0] }}{% endraw %}"
|
delegate_to: "{{ groups['master'][0] }}"
|
||||||
failed_when: false
|
failed_when: false
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
@@ -31,23 +31,23 @@
|
|||||||
block:
|
block:
|
||||||
- name: Cordon
|
- name: Cordon
|
||||||
kubernetes.core.k8s_drain:
|
kubernetes.core.k8s_drain:
|
||||||
name: "{% raw %}{{ inventory_hostname }}{% endraw %}"
|
name: "{{ inventory_hostname }}"
|
||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
kubeconfig: /etc/rancher/k3s/k3s.yaml
|
kubeconfig: /etc/rancher/k3s/k3s.yaml
|
||||||
{% elif bootstrap_distribution == 'k0s' %}
|
<% elif bootstrap_distribution == 'k0s' %>
|
||||||
kubeconfig: /var/lib/k0s/pki/admin.conf
|
kubeconfig: /var/lib/k0s/pki/admin.conf
|
||||||
{% endif %}
|
<% endif %>
|
||||||
state: cordon
|
state: cordon
|
||||||
delegate_to: "{% raw %}{{ groups['master'][0] }}{% endraw %}"
|
delegate_to: "{{ groups['master'][0] }}"
|
||||||
|
|
||||||
- name: Drain
|
- name: Drain
|
||||||
kubernetes.core.k8s_drain:
|
kubernetes.core.k8s_drain:
|
||||||
name: "{% raw %}{{ inventory_hostname }}{% endraw %}"
|
name: "{{ inventory_hostname }}"
|
||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
kubeconfig: /etc/rancher/k3s/k3s.yaml
|
kubeconfig: /etc/rancher/k3s/k3s.yaml
|
||||||
{% elif bootstrap_distribution == 'k0s' %}
|
<% elif bootstrap_distribution == 'k0s' %>
|
||||||
kubeconfig: /var/lib/k0s/pki/admin.conf
|
kubeconfig: /var/lib/k0s/pki/admin.conf
|
||||||
{% endif %}
|
<% endif %>
|
||||||
state: drain
|
state: drain
|
||||||
delete_options:
|
delete_options:
|
||||||
delete_emptydir_data: true
|
delete_emptydir_data: true
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
pod_selectors:
|
pod_selectors:
|
||||||
# Rook Ceph
|
# Rook Ceph
|
||||||
- app!=rook-ceph-osd
|
- app!=rook-ceph-osd
|
||||||
delegate_to: "{% raw %}{{ groups['master'][0] }}{% endraw %}"
|
delegate_to: "{{ groups['master'][0] }}"
|
||||||
|
|
||||||
- name: Update
|
- name: Update
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
@@ -78,11 +78,11 @@
|
|||||||
|
|
||||||
- name: Uncordon
|
- name: Uncordon
|
||||||
kubernetes.core.k8s_drain:
|
kubernetes.core.k8s_drain:
|
||||||
name: "{% raw %}{{ inventory_hostname }}{% endraw %}"
|
name: "{{ inventory_hostname }}"
|
||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
kubeconfig: /etc/rancher/k3s/k3s.yaml
|
kubeconfig: /etc/rancher/k3s/k3s.yaml
|
||||||
{% elif bootstrap_distribution == 'k0s' %}
|
<% elif bootstrap_distribution == 'k0s' %>
|
||||||
kubeconfig: /var/lib/k0s/pki/admin.conf
|
kubeconfig: /var/lib/k0s/pki/admin.conf
|
||||||
{% endif %}
|
<% endif %>
|
||||||
state: uncordon
|
state: uncordon
|
||||||
delegate_to: "{% raw %}{{ groups['master'][0] }}{% endraw %}"
|
delegate_to: "{{ groups['master'][0] }}"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
---
|
---
|
||||||
- name: Cilium
|
- name: Cilium
|
||||||
block:
|
block:
|
||||||
@@ -55,4 +55,4 @@
|
|||||||
definition:
|
definition:
|
||||||
metadata:
|
metadata:
|
||||||
finalizers: []
|
finalizers: []
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
---
|
---
|
||||||
- name: Coredns
|
- name: Coredns
|
||||||
block:
|
block:
|
||||||
@@ -55,4 +55,4 @@
|
|||||||
definition:
|
definition:
|
||||||
metadata:
|
metadata:
|
||||||
finalizers: []
|
finalizers: []
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
---
|
---
|
||||||
# https://github.com/k3s-io/k3s/issues/1971
|
# https://github.com/k3s-io/k3s/issues/1971
|
||||||
- name: Cruft
|
- name: Cruft
|
||||||
block:
|
block:
|
||||||
- name: Cruft | Get list of custom manifests
|
- name: Cruft | Get list of custom manifests
|
||||||
ansible.builtin.find:
|
ansible.builtin.find:
|
||||||
paths: "{% raw %}{{ k3s_server_manifests_dir }}{% endraw %}"
|
paths: "{{ k3s_server_manifests_dir }}"
|
||||||
file_type: file
|
file_type: file
|
||||||
use_regex: true
|
use_regex: true
|
||||||
patterns: ["^custom-.*"]
|
patterns: ["^custom-.*"]
|
||||||
@@ -13,9 +13,9 @@
|
|||||||
|
|
||||||
- name: Cruft | Delete custom manifests
|
- name: Cruft | Delete custom manifests
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{% raw %}{{ item.path }}{% endraw %}"
|
path: "{{ item.path }}"
|
||||||
state: absent
|
state: absent
|
||||||
loop: "{% raw %}{{ custom_manifest.files }}{% endraw %}"
|
loop: "{{ custom_manifest.files }}"
|
||||||
|
|
||||||
- name: Cruft | Get list of custom addons
|
- name: Cruft | Get list of custom addons
|
||||||
kubernetes.core.k8s_info:
|
kubernetes.core.k8s_info:
|
||||||
@@ -26,9 +26,9 @@
|
|||||||
- name: Cruft | Delete addons
|
- name: Cruft | Delete addons
|
||||||
kubernetes.core.k8s:
|
kubernetes.core.k8s:
|
||||||
kubeconfig: /etc/rancher/k3s/k3s.yaml
|
kubeconfig: /etc/rancher/k3s/k3s.yaml
|
||||||
name: "{% raw %}{{ item.metadata.name }}{% endraw %}"
|
name: "{{ item.metadata.name }}"
|
||||||
kind: Addon
|
kind: Addon
|
||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
state: absent
|
state: absent
|
||||||
loop: "{% raw %}{{ addons_list.resources | selectattr('metadata.name', 'match', '^custom-.*') | list }}{% endraw %}"
|
loop: "{{ addons_list.resources | selectattr('metadata.name', 'match', '^custom-.*') | list }}"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
---
|
---
|
||||||
- name: Get absolute path to this Git repository # noqa: command-instead-of-module
|
- name: Get absolute path to this Git repository # noqa: command-instead-of-module
|
||||||
ansible.builtin.command: git rev-parse --show-toplevel
|
ansible.builtin.command: git rev-parse --show-toplevel
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
when: k3s_primary_control_node
|
when: k3s_primary_control_node
|
||||||
ansible.builtin.fetch:
|
ansible.builtin.fetch:
|
||||||
src: /etc/rancher/k3s/k3s.yaml
|
src: /etc/rancher/k3s/k3s.yaml
|
||||||
dest: "{% raw %}{{ repository_path.stdout }}{% endraw %}/kubeconfig"
|
dest: "{{ repository_path.stdout }}/kubeconfig"
|
||||||
flat: true
|
flat: true
|
||||||
|
|
||||||
- name: Update kubeconfig with the correct load balancer address
|
- name: Update kubeconfig with the correct load balancer address
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
become: false
|
become: false
|
||||||
run_once: true
|
run_once: true
|
||||||
ansible.builtin.replace:
|
ansible.builtin.replace:
|
||||||
path: "{% raw %}{{ repository_path.stdout }}{% endraw %}/kubeconfig"
|
path: "{{ repository_path.stdout }}/kubeconfig"
|
||||||
regexp: https://127.0.0.1:6443
|
regexp: https://127.0.0.1:6443
|
||||||
replace: "https://{% raw %}{{ k3s_registration_address }}{% endraw %}:6443"
|
replace: "https://{{ k3s_registration_address }}:6443"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+11
-11
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
---
|
---
|
||||||
# https://docs.k3s.io/helm
|
# https://docs.k3s.io/helm
|
||||||
apiVersion: helm.cattle.io/v1
|
apiVersion: helm.cattle.io/v1
|
||||||
@@ -31,29 +31,29 @@ spec:
|
|||||||
enabled: false
|
enabled: false
|
||||||
ipam:
|
ipam:
|
||||||
mode: kubernetes
|
mode: kubernetes
|
||||||
ipv4NativeRoutingCIDR: "{% raw %}{{ cluster_cidr }}{% endraw %}"
|
ipv4NativeRoutingCIDR: "{{ cluster_cidr }}"
|
||||||
{% if bootstrap_ipv6_enabled | default(false) %}
|
<% if bootstrap_ipv6_enabled | default(false) %>
|
||||||
ipv6NativeRoutingCIDR: "{% raw %}{{ cluster_cidr_v6 }}{% endraw %}"
|
ipv6NativeRoutingCIDR: "{{ cluster_cidr_v6 }}"
|
||||||
ipv6:
|
ipv6:
|
||||||
enabled: true
|
enabled: true
|
||||||
{% endif %}
|
<% endif %>
|
||||||
k8sServiceHost: "{% raw %}{{ kube_api_addr }}{% endraw %}"
|
k8sServiceHost: "{{ kube_api_addr }}"
|
||||||
k8sServicePort: 6443
|
k8sServicePort: 6443
|
||||||
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
|
||||||
# https://github.com/cilium/cilium/issues/26586
|
# 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: {{ 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
|
||||||
@@ -62,4 +62,4 @@ spec:
|
|||||||
routingMode: native
|
routingMode: native
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
---
|
---
|
||||||
# https://docs.k3s.io/helm
|
# https://docs.k3s.io/helm
|
||||||
apiVersion: helm.cattle.io/v1
|
apiVersion: helm.cattle.io/v1
|
||||||
@@ -19,7 +19,7 @@ spec:
|
|||||||
k8sAppLabelOverride: kube-dns
|
k8sAppLabelOverride: kube-dns
|
||||||
service:
|
service:
|
||||||
name: kube-dns
|
name: kube-dns
|
||||||
clusterIP: "{% raw %}{{ coredns_addr }}{% endraw %}"
|
clusterIP: "{{ coredns_addr }}"
|
||||||
serviceAccount:
|
serviceAccount:
|
||||||
create: true
|
create: true
|
||||||
deployment:
|
deployment:
|
||||||
@@ -76,4 +76,4 @@ spec:
|
|||||||
labelSelector:
|
labelSelector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app.kubernetes.io/instance: coredns
|
app.kubernetes.io/instance: coredns
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == 'k3s' and bootstrap_nodes.master | length > 1 and not bootstrap_kube_api_addr %}
|
<% if bootstrap_distribution == 'k3s' and bootstrap_nodes.master | length > 1 and not bootstrap_kube_api_addr %>
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Pod
|
kind: Pod
|
||||||
@@ -16,7 +16,7 @@ spec:
|
|||||||
args: ["manager"]
|
args: ["manager"]
|
||||||
env:
|
env:
|
||||||
- name: address
|
- name: address
|
||||||
value: "{% raw %}{{ kube_api_addr }}{% endraw %}"
|
value: "{{ kube_api_addr }}"
|
||||||
- name: vip_arp
|
- name: vip_arp
|
||||||
value: "true"
|
value: "true"
|
||||||
- name: lb_enable
|
- name: lb_enable
|
||||||
@@ -58,4 +58,4 @@ spec:
|
|||||||
- name: kubeconfig
|
- name: kubeconfig
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /etc/rancher/k3s/k3s.yaml
|
path: /etc/rancher/k3s/k3s.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == 'k0s' %}
|
<% if bootstrap_distribution == 'k0s' %>
|
||||||
---
|
---
|
||||||
apiVersion: k0sctl.k0sproject.io/v1beta1
|
apiVersion: k0sctl.k0sproject.io/v1beta1
|
||||||
kind: Cluster
|
kind: Cluster
|
||||||
@@ -6,25 +6,25 @@ metadata:
|
|||||||
name: k0s-cluster
|
name: k0s-cluster
|
||||||
spec:
|
spec:
|
||||||
hosts:
|
hosts:
|
||||||
{% for item in bootstrap_nodes.master %}
|
<% for item in bootstrap_nodes.master %>
|
||||||
- role: {{ item.role | default('controller+worker') }}
|
- role: << item.role | default('controller+worker') >>
|
||||||
ssh:
|
ssh:
|
||||||
address: {{ item.address }}
|
address: << item.address >>
|
||||||
user: {{ item.username }}
|
user: << item.username >>
|
||||||
installFlags:
|
installFlags:
|
||||||
- --disable-components=metrics-server
|
- --disable-components=metrics-server
|
||||||
{% if item.role | default('') == 'controller+worker' %}
|
<% if item.role | default('') == 'controller+worker' %>
|
||||||
- --no-taints
|
- --no-taints
|
||||||
{% 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:
|
||||||
address: {{ item.address }}
|
address: << item.address >>
|
||||||
user: {{ item.username }}
|
user: << item.username >>
|
||||||
{% endfor %}
|
<% endfor %>
|
||||||
{% endif %}
|
<% endif %>
|
||||||
k0s:
|
k0s:
|
||||||
# renovate: datasource=github-releases depName=k0sproject/k0s
|
# renovate: datasource=github-releases depName=k0sproject/k0s
|
||||||
version: "v1.28.5+k0s.0"
|
version: "v1.28.5+k0s.0"
|
||||||
@@ -43,18 +43,18 @@ spec:
|
|||||||
bind-address: "0.0.0.0"
|
bind-address: "0.0.0.0"
|
||||||
api:
|
api:
|
||||||
sans:
|
sans:
|
||||||
- {{ bootstrap_kube_api_addr }}
|
- << bootstrap_kube_api_addr >>
|
||||||
{% if bootstrap_kubeapi_hostname is defined %}
|
<% if bootstrap_kubeapi_hostname is defined %>
|
||||||
- {{ bootstrap_kubeapi_hostname }}
|
- << bootstrap_kubeapi_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 (bootstrap_kubeapi_hostname is not defined) or (item.name != bootstrap_kubeapi_hostname) %}
|
<% if (bootstrap_kubeapi_hostname is not defined) or (item.name != bootstrap_kubeapi_hostname) %>
|
||||||
- {{ item.name }}
|
- << item.name >>
|
||||||
{% endif %}
|
<% endif %>
|
||||||
{% endfor %}
|
<% endfor %>
|
||||||
extensions:
|
extensions:
|
||||||
helm:
|
helm:
|
||||||
repositories:
|
repositories:
|
||||||
@@ -84,33 +84,33 @@ spec:
|
|||||||
enabled: false
|
enabled: false
|
||||||
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
|
||||||
{% endif %}
|
<% endif %>
|
||||||
{% if bootstrap_nodes.master | length == 1 and not bootstrap_kube_api_addr %}
|
<% if bootstrap_nodes.master | length == 1 and not bootstrap_kube_api_addr %>
|
||||||
k8sServiceHost: {{ bootstrap_nodes.master[0].address }}
|
k8sServiceHost: << bootstrap_nodes.master[0].address >>
|
||||||
{% else %}
|
<% else %>
|
||||||
k8sServiceHost: {{ bootstrap_kube_api_addr }}
|
k8sServiceHost: << bootstrap_kube_api_addr >>
|
||||||
{% endif %}
|
<% endif %>
|
||||||
k8sServicePort: 6443
|
k8sServicePort: 6443
|
||||||
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
|
||||||
# https://github.com/cilium/cilium/issues/26586
|
# 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: {{ 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
|
||||||
@@ -122,10 +122,10 @@ spec:
|
|||||||
network:
|
network:
|
||||||
kubeProxy:
|
kubeProxy:
|
||||||
disabled: true
|
disabled: true
|
||||||
{% if bootstrap_nodes.master | length > 1 %}
|
<% if bootstrap_nodes.master | length > 1 %>
|
||||||
nodeLocalLoadBalancing:
|
nodeLocalLoadBalancing:
|
||||||
enabled: true
|
enabled: true
|
||||||
type: EnvoyProxy
|
type: EnvoyProxy
|
||||||
{% endif %}
|
<% endif %>
|
||||||
provider: custom
|
provider: custom
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+4
-4
@@ -28,11 +28,11 @@ spec:
|
|||||||
severity: warning
|
severity: warning
|
||||||
annotations:
|
annotations:
|
||||||
description: >
|
description: >
|
||||||
The domain that this cert covers will be unavailable after {% raw %}{{ $value | humanizeDuration }}{% endraw %}.
|
The domain that this cert covers will be unavailable after {{ $value | humanizeDuration }}.
|
||||||
Clients using endpoints that this cert protects will start to fail in {% raw %}{{ $value | humanizeDuration }}{% endraw %}.
|
Clients using endpoints that this cert protects will start to fail in {{ $value | humanizeDuration }}.
|
||||||
runbook_url: https://gitlab.com/uneeq-oss/cert-manager-mixin/-/blob/master/RUNBOOK.md#certmanagercertexpirysoon
|
runbook_url: https://gitlab.com/uneeq-oss/cert-manager-mixin/-/blob/master/RUNBOOK.md#certmanagercertexpirysoon
|
||||||
summary: |
|
summary: |
|
||||||
The cert {% raw %}{{ $labels.name }}{% endraw %} is {% raw %}{{ $value | humanizeDuration }}{% endraw %} from expiry, it should have renewed over a week ago.
|
The cert {{ $labels.name }} is {{ $value | humanizeDuration }} from expiry, it should have renewed over a week ago.
|
||||||
- alert: CertManagerCertNotReady
|
- alert: CertManagerCertNotReady
|
||||||
expr: |
|
expr: |
|
||||||
max by (name, exported_namespace, namespace, condition) (certmanager_certificate_ready_status{condition!="True"} == 1)
|
max by (name, exported_namespace, namespace, condition) (certmanager_certificate_ready_status{condition!="True"} == 1)
|
||||||
@@ -45,7 +45,7 @@ spec:
|
|||||||
10m. If the cert is being renewed or there is another valid cert, the ingress
|
10m. If the cert is being renewed or there is another valid cert, the ingress
|
||||||
controller _may_ be able to serve that instead.
|
controller _may_ be able to serve that instead.
|
||||||
runbook_url: https://gitlab.com/uneeq-oss/cert-manager-mixin/-/blob/master/RUNBOOK.md#certmanagercertnotready
|
runbook_url: https://gitlab.com/uneeq-oss/cert-manager-mixin/-/blob/master/RUNBOOK.md#certmanagercertnotready
|
||||||
summary: "The cert {% raw %}{{ $labels.name }}{% endraw %} is not ready to serve traffic."
|
summary: "The cert {{ $labels.name }} is not ready to serve traffic."
|
||||||
- alert: CertManagerHittingRateLimits
|
- alert: CertManagerHittingRateLimits
|
||||||
expr: |
|
expr: |
|
||||||
sum by (host) (rate(certmanager_http_acme_client_request_count{status="429"}[5m])) > 0
|
sum by (host) (rate(certmanager_http_acme_client_request_count{status="429"}[5m])) > 0
|
||||||
|
|||||||
+1
-1
@@ -4,4 +4,4 @@ kind: Secret
|
|||||||
metadata:
|
metadata:
|
||||||
name: cert-manager-secret
|
name: cert-manager-secret
|
||||||
stringData:
|
stringData:
|
||||||
api-token: "{{ bootstrap_cloudflare_token }}"
|
api-token: "<< bootstrap_cloudflare_token >>"
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
{% if discord_template_notifier.enabled | default(false) %}
|
<% if discord_template_notifier.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -62,4 +62,4 @@ spec:
|
|||||||
- path: /data/config.toml
|
- path: /data/config.toml
|
||||||
subPath: config.toml
|
subPath: config.toml
|
||||||
readOnly: true
|
readOnly: true
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
{% if discord_template_notifier.enabled | default(false) %}
|
<% if discord_template_notifier.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./secret.sops.yaml
|
- ./secret.sops.yaml
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
{% if discord_template_notifier.enabled | default(false) %}
|
<% if discord_template_notifier.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
@@ -12,5 +12,5 @@ stringData:
|
|||||||
interval = "10m"
|
interval = "10m"
|
||||||
retry_limit = 5
|
retry_limit = 5
|
||||||
sink.type = "discord"
|
sink.type = "discord"
|
||||||
sink.url = "{{ discord_template_notifier.webhook_url }}"
|
sink.url = "<< discord_template_notifier.webhook_url >>"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if discord_template_notifier.enabled | default(false) %}
|
<% if discord_template_notifier.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -19,4 +19,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if homepage.enabled | default(false) %}
|
<% if homepage.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
@@ -38,9 +38,9 @@ data:
|
|||||||
description: Cloudflared Tunnel
|
description: Cloudflared Tunnel
|
||||||
widget:
|
widget:
|
||||||
type: cloudflared
|
type: cloudflared
|
||||||
accountid: "{% raw %}{{HOMEPAGE_VAR_CLOUDFLARED_ACCOUNTID}}{% endraw %}"
|
accountid: "{{HOMEPAGE_VAR_CLOUDFLARED_ACCOUNTID}}"
|
||||||
tunnelid: "{% raw %}{{ HOMEPAGE_VAR_CLOUDFLARED_TUNNELID}}{% endraw %}"
|
tunnelid: "{{HOMEPAGE_VAR_CLOUDFLARED_TUNNELID}}"
|
||||||
key: "{% raw %}{{HOMEPAGE_VAR_CLOUDFLARED_API_TOKEN}}{% endraw %}"
|
key: "{{HOMEPAGE_VAR_CLOUDFLARED_API_TOKEN}}"
|
||||||
settings.yaml: |
|
settings.yaml: |
|
||||||
title: Dashboard
|
title: Dashboard
|
||||||
theme: dark
|
theme: dark
|
||||||
@@ -76,4 +76,4 @@ data:
|
|||||||
dateStyle: long
|
dateStyle: long
|
||||||
timeStyle: short
|
timeStyle: short
|
||||||
hourCycle: h23
|
hourCycle: h23
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if homepage.enabled | default(false) %}
|
<% if homepage.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -87,4 +87,4 @@ spec:
|
|||||||
path: /app/config/widgets.yaml
|
path: /app/config/widgets.yaml
|
||||||
serviceAccount:
|
serviceAccount:
|
||||||
create: true
|
create: true
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if homepage.enabled | default(false) %}
|
<% if homepage.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -6,4 +6,4 @@ resources:
|
|||||||
- ./configmap.yaml
|
- ./configmap.yaml
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
- ./secret.sops.yaml
|
- ./secret.sops.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
{% if homepage.enabled | default(false) %}
|
<% if homepage.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
name: homepage-secret
|
name: homepage-secret
|
||||||
stringData:
|
stringData:
|
||||||
HOMEPAGE_VAR_CLOUDFLARED_ACCOUNTID: "{{ bootstrap_cloudflare_account_tag }}"
|
HOMEPAGE_VAR_CLOUDFLARED_ACCOUNTID: "<< bootstrap_cloudflare_account_tag >>"
|
||||||
HOMEPAGE_VAR_CLOUDFLARED_TUNNELID: "{{ bootstrap_cloudflare_tunnel_id }}"
|
HOMEPAGE_VAR_CLOUDFLARED_TUNNELID: "<< bootstrap_cloudflare_tunnel_id >>"
|
||||||
HOMEPAGE_VAR_CLOUDFLARED_API_TOKEN: "{{ bootstrap_cloudflare_token }}"
|
HOMEPAGE_VAR_CLOUDFLARED_API_TOKEN: "<< bootstrap_cloudflare_token >>"
|
||||||
HOMEPAGE_VAR_GRAFANA_USERNAME: admin
|
HOMEPAGE_VAR_GRAFANA_USERNAME: admin
|
||||||
HOMEPAGE_VAR_GRAFANA_PASSWORD: "{{ grafana.password }}"
|
HOMEPAGE_VAR_GRAFANA_PASSWORD: "<< grafana.password >>"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if homepage.enabled | default(false) %}
|
<% if homepage.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -19,4 +19,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -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.enabled | default(false) %>
|
||||||
- ./homepage/ks.yaml
|
- ./homepage/ks.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
{% if discord_template_notifier.enabled | default(false) %}
|
<% if discord_template_notifier.enabled | default(false) %>
|
||||||
- ./discord-template-notifier/ks.yaml
|
- ./discord-template-notifier/ks.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+1
-1
@@ -4,4 +4,4 @@ kind: Secret
|
|||||||
metadata:
|
metadata:
|
||||||
name: github-webhook-token-secret
|
name: github-webhook-token-secret
|
||||||
stringData:
|
stringData:
|
||||||
token: "{{ bootstrap_flux_github_webhook_token }}"
|
token: "<< bootstrap_flux_github_webhook_token >>"
|
||||||
@@ -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.enabled | default(false) %>
|
||||||
- ./weave-gitops/ks.yaml
|
- ./weave-gitops/ks.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+4
-4
@@ -1,4 +1,4 @@
|
|||||||
{% if weave_gitops.enabled | default(false) %}
|
<% if weave_gitops.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -32,13 +32,13 @@ spec:
|
|||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
className: internal
|
className: internal
|
||||||
{% if homepage.enabled | default(false) %}
|
<% if homepage.enabled | default(false) %>
|
||||||
annotations:
|
annotations:
|
||||||
gethomepage.dev/enabled: "true"
|
gethomepage.dev/enabled: "true"
|
||||||
gethomepage.dev/group: Home
|
gethomepage.dev/group: Home
|
||||||
gethomepage.dev/name: Weave-gitops
|
gethomepage.dev/name: Weave-gitops
|
||||||
gethomepage.dev/icon: flux-cd.png
|
gethomepage.dev/icon: flux-cd.png
|
||||||
{% endif %}
|
<% endif %>
|
||||||
hosts:
|
hosts:
|
||||||
- host: &host "gitops.${SECRET_DOMAIN}"
|
- host: &host "gitops.${SECRET_DOMAIN}"
|
||||||
paths:
|
paths:
|
||||||
@@ -56,4 +56,4 @@ spec:
|
|||||||
impersonationResourceNames: ["admin"]
|
impersonationResourceNames: ["admin"]
|
||||||
podAnnotations:
|
podAnnotations:
|
||||||
secret.reloader.stakater.com/reload: cluster-user-auth
|
secret.reloader.stakater.com/reload: cluster-user-auth
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
{% if weave_gitops.enabled | default(false) %}
|
<% if weave_gitops.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./secret.sops.yaml
|
- ./secret.sops.yaml
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
{% if weave_gitops.enabled | default(false) %}
|
<% if weave_gitops.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
@@ -7,5 +7,5 @@ metadata:
|
|||||||
type: Opaque
|
type: Opaque
|
||||||
stringData:
|
stringData:
|
||||||
username: admin
|
username: admin
|
||||||
password: "{{ weave_gitops.password | encrypt }}"
|
password: "<< weave_gitops.password | encrypt >>"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if weave_gitops.enabled | default(false) %}
|
<% if weave_gitops.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -19,4 +19,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -34,11 +34,11 @@ spec:
|
|||||||
id: 1
|
id: 1
|
||||||
containerRuntime:
|
containerRuntime:
|
||||||
integration: containerd
|
integration: containerd
|
||||||
{% if bootstrap_distribution == "k3s" %}
|
<% if bootstrap_distribution == "k3s" %>
|
||||||
socketPath: /var/run/k3s/containerd/containerd.sock
|
socketPath: /var/run/k3s/containerd/containerd.sock
|
||||||
{% else %}
|
<% else %>
|
||||||
socketPath: /var/run/k0s/containerd.sock
|
socketPath: /var/run/k0s/containerd.sock
|
||||||
{% endif %}
|
<% endif %>
|
||||||
endpointRoutes:
|
endpointRoutes:
|
||||||
enabled: true
|
enabled: true
|
||||||
hubble:
|
hubble:
|
||||||
@@ -70,13 +70,13 @@ spec:
|
|||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
className: internal
|
className: internal
|
||||||
{% if homepage.enabled | default(false) %}
|
<% if homepage.enabled | default(false) %>
|
||||||
annotations:
|
annotations:
|
||||||
gethomepage.dev/enabled: "true"
|
gethomepage.dev/enabled: "true"
|
||||||
gethomepage.dev/group: Network
|
gethomepage.dev/group: Network
|
||||||
gethomepage.dev/name: Cilium
|
gethomepage.dev/name: Cilium
|
||||||
gethomepage.dev/icon: cilium.png
|
gethomepage.dev/icon: cilium.png
|
||||||
{% endif %}
|
<% endif %>
|
||||||
hosts:
|
hosts:
|
||||||
- "hubble.${SECRET_DOMAIN}"
|
- "hubble.${SECRET_DOMAIN}"
|
||||||
tls:
|
tls:
|
||||||
@@ -85,28 +85,28 @@ spec:
|
|||||||
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
|
||||||
{% endif %}
|
<% endif %>
|
||||||
k8sServiceHost: "${KUBE_API_ADDR}"
|
k8sServiceHost: "${KUBE_API_ADDR}"
|
||||||
k8sServicePort: 6443
|
k8sServicePort: 6443
|
||||||
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
|
||||||
# https://github.com/cilium/cilium/issues/26586
|
# 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: {{ 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
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == "k3s" %}
|
<% if bootstrap_distribution == "k3s" %>
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -87,4 +87,4 @@ spec:
|
|||||||
labelSelector:
|
labelSelector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app.kubernetes.io/instance: coredns
|
app.kubernetes.io/instance: coredns
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{% if bootstrap_distribution == "k3s" %}
|
<% if bootstrap_distribution == "k3s" %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == "k3s" %}
|
<% if bootstrap_distribution == "k3s" %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -19,4 +19,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -4,7 +4,7 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- ./namespace.yaml
|
- ./namespace.yaml
|
||||||
- ./cilium/ks.yaml
|
- ./cilium/ks.yaml
|
||||||
{% if bootstrap_distribution == "k3s" %}
|
<% if bootstrap_distribution == "k3s" %>
|
||||||
- ./coredns/ks.yaml
|
- ./coredns/ks.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
- ./metrics-server/ks.yaml
|
- ./metrics-server/ks.yaml
|
||||||
@@ -4,10 +4,10 @@ kind: Secret
|
|||||||
metadata:
|
metadata:
|
||||||
name: cloudflared-secret
|
name: cloudflared-secret
|
||||||
stringData:
|
stringData:
|
||||||
TUNNEL_ID: "{{ bootstrap_cloudflare_tunnel_id }}"
|
TUNNEL_ID: "<< bootstrap_cloudflare_tunnel_id >>"
|
||||||
credentials.json: |
|
credentials.json: |
|
||||||
{
|
{
|
||||||
"AccountTag": "{{ bootstrap_cloudflare_account_tag }}",
|
"AccountTag": "<< bootstrap_cloudflare_account_tag >>",
|
||||||
"TunnelSecret": "{{ bootstrap_cloudflare_tunnel_secret }}",
|
"TunnelSecret": "<< bootstrap_cloudflare_tunnel_secret >>",
|
||||||
"TunnelID": "{{ bootstrap_cloudflare_tunnel_id }}"
|
"TunnelID": "<< bootstrap_cloudflare_tunnel_id >>"
|
||||||
}
|
}
|
||||||
@@ -71,14 +71,14 @@ 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.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
|
||||||
gethomepage.dev/icon: mdi-video-input-antenna
|
gethomepage.dev/icon: mdi-video-input-antenna
|
||||||
{% endif %}
|
<% endif %>
|
||||||
hosts:
|
hosts:
|
||||||
- host: &host "{% raw %}{{ .Release.Name }}{% endraw %}.${SECRET_DOMAIN}"
|
- host: &host "{{ .Release.Name }}.${SECRET_DOMAIN}"
|
||||||
paths:
|
paths:
|
||||||
- path: /
|
- path: /
|
||||||
service:
|
service:
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ kind: Secret
|
|||||||
metadata:
|
metadata:
|
||||||
name: external-dns-secret
|
name: external-dns-secret
|
||||||
stringData:
|
stringData:
|
||||||
api-token: "{{ bootstrap_cloudflare_token }}"
|
api-token: "<< bootstrap_cloudflare_token >>"
|
||||||
@@ -31,5 +31,5 @@ spec:
|
|||||||
type: LoadBalancer
|
type: LoadBalancer
|
||||||
port: 53
|
port: 53
|
||||||
annotations:
|
annotations:
|
||||||
io.cilium/lb-ipam-ips: "{{ bootstrap_k8s_gateway_addr }}"
|
io.cilium/lb-ipam-ips: "<< bootstrap_k8s_gateway_addr >>"
|
||||||
externalTrafficPolicy: Cluster
|
externalTrafficPolicy: Cluster
|
||||||
+2
-2
@@ -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 %>
|
||||||
+4
-4
@@ -33,7 +33,7 @@ spec:
|
|||||||
service:
|
service:
|
||||||
annotations:
|
annotations:
|
||||||
external-dns.alpha.kubernetes.io/hostname: "external.${SECRET_DOMAIN}"
|
external-dns.alpha.kubernetes.io/hostname: "external.${SECRET_DOMAIN}"
|
||||||
io.cilium/lb-ipam-ips: "{{ bootstrap_external_ingress_addr }}"
|
io.cilium/lb-ipam-ips: "<< bootstrap_external_ingress_addr >>"
|
||||||
externalTrafficPolicy: Cluster
|
externalTrafficPolicy: Cluster
|
||||||
ingressClassResource:
|
ingressClassResource:
|
||||||
name: external
|
name: external
|
||||||
@@ -71,11 +71,11 @@ 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"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
topologySpreadConstraints:
|
topologySpreadConstraints:
|
||||||
- maxSkew: 1
|
- maxSkew: 1
|
||||||
topologyKey: kubernetes.io/hostname
|
topologyKey: kubernetes.io/hostname
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ spec:
|
|||||||
service:
|
service:
|
||||||
annotations:
|
annotations:
|
||||||
external-dns.alpha.kubernetes.io/hostname: "internal.${SECRET_DOMAIN}"
|
external-dns.alpha.kubernetes.io/hostname: "internal.${SECRET_DOMAIN}"
|
||||||
io.cilium/lb-ipam-ips: "{{ bootstrap_internal_ingress_addr }}"
|
io.cilium/lb-ipam-ips: "<< bootstrap_internal_ingress_addr >>"
|
||||||
externalTrafficPolicy: Cluster
|
externalTrafficPolicy: Cluster
|
||||||
ingressClassResource:
|
ingressClassResource:
|
||||||
name: internal
|
name: internal
|
||||||
@@ -69,11 +69,11 @@ 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"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
topologySpreadConstraints:
|
topologySpreadConstraints:
|
||||||
- maxSkew: 1
|
- maxSkew: 1
|
||||||
topologyKey: kubernetes.io/hostname
|
topologyKey: kubernetes.io/hostname
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if grafana.enabled | default(false) %}
|
<% if grafana.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -160,7 +160,7 @@ spec:
|
|||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
ingressClassName: internal
|
ingressClassName: internal
|
||||||
{% if homepage.enabled | default(false) %}
|
<% if homepage.enabled | default(false) %>
|
||||||
annotations:
|
annotations:
|
||||||
gethomepage.dev/enabled: "true"
|
gethomepage.dev/enabled: "true"
|
||||||
gethomepage.dev/icon: grafana.png
|
gethomepage.dev/icon: grafana.png
|
||||||
@@ -168,9 +168,9 @@ spec:
|
|||||||
gethomepage.dev/group: Observability
|
gethomepage.dev/group: Observability
|
||||||
gethomepage.dev/widget.type: grafana
|
gethomepage.dev/widget.type: grafana
|
||||||
gethomepage.dev/widget.url: http://grafana.observability
|
gethomepage.dev/widget.url: http://grafana.observability
|
||||||
gethomepage.dev/widget.username: "{% raw %}{{`{{HOMEPAGE_VAR_GRAFANA_USERNAME}}`}}{% endraw %}"
|
gethomepage.dev/widget.username: "{{`{{HOMEPAGE_VAR_GRAFANA_USERNAME}}`}}"
|
||||||
gethomepage.dev/widget.password: "{% raw %}{{`{{HOMEPAGE_VAR_GRAFANA_PASSWORD}}`}}{% endraw %}"
|
gethomepage.dev/widget.password: "{{`{{HOMEPAGE_VAR_GRAFANA_PASSWORD}}`}}"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
hosts:
|
hosts:
|
||||||
- &host "grafana.${SECRET_DOMAIN}"
|
- &host "grafana.${SECRET_DOMAIN}"
|
||||||
tls:
|
tls:
|
||||||
@@ -181,4 +181,4 @@ spec:
|
|||||||
storageClassName: openebs-hostpath
|
storageClassName: openebs-hostpath
|
||||||
testFramework:
|
testFramework:
|
||||||
enabled: false
|
enabled: false
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
{% if grafana.enabled | default(false) %}
|
<% if grafana.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./secret.sops.yaml
|
- ./secret.sops.yaml
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if grafana.enabled | default(false) %}
|
<% if grafana.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
@@ -6,5 +6,5 @@ metadata:
|
|||||||
name: grafana-admin-secret
|
name: grafana-admin-secret
|
||||||
stringData:
|
stringData:
|
||||||
admin-user: admin
|
admin-user: admin
|
||||||
admin-password: "{{ grafana.password }}"
|
admin-password: "<< grafana.password >>"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if grafana.enabled | default(false) %}
|
<% if grafana.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -19,4 +19,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+18
-18
@@ -1,4 +1,4 @@
|
|||||||
{% if kube_prometheus_stack.enabled | default(false) %}
|
<% if kube_prometheus_stack.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -54,7 +54,7 @@ spec:
|
|||||||
enabled: true
|
enabled: true
|
||||||
serviceMonitor:
|
serviceMonitor:
|
||||||
metricRelabelings:
|
metricRelabelings:
|
||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
# Remove duplicate labels provided by k3s
|
# Remove duplicate labels provided by k3s
|
||||||
- action: keep
|
- action: keep
|
||||||
sourceLabels: ["__name__"]
|
sourceLabels: ["__name__"]
|
||||||
@@ -62,7 +62,7 @@ spec:
|
|||||||
- action: replace
|
- action: replace
|
||||||
sourceLabels: ["node"]
|
sourceLabels: ["node"]
|
||||||
targetLabel: instance
|
targetLabel: instance
|
||||||
{% endif %}
|
<% endif %>
|
||||||
# Drop high cardinality labels
|
# Drop high cardinality labels
|
||||||
- action: labeldrop
|
- action: labeldrop
|
||||||
regex: (uid)
|
regex: (uid)
|
||||||
@@ -75,12 +75,12 @@ spec:
|
|||||||
enabled: true
|
enabled: true
|
||||||
serviceMonitor:
|
serviceMonitor:
|
||||||
metricRelabelings:
|
metricRelabelings:
|
||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
# Remove duplicate labels provided by k3s
|
# Remove duplicate labels provided by k3s
|
||||||
- action: keep
|
- action: keep
|
||||||
sourceLabels: ["__name__"]
|
sourceLabels: ["__name__"]
|
||||||
regex: (aggregator_openapi|aggregator_unavailable|apiextensions_openapi|apiserver_admission|apiserver_audit|apiserver_cache|apiserver_cel|apiserver_client|apiserver_crd|apiserver_current|apiserver_envelope|apiserver_flowcontrol|apiserver_init|apiserver_kube|apiserver_longrunning|apiserver_request|apiserver_requested|apiserver_response|apiserver_selfrequest|apiserver_storage|apiserver_terminated|apiserver_tls|apiserver_watch|apiserver_webhooks|authenticated_user|authentication|disabled_metric|etcd_bookmark|etcd_lease|etcd_request|field_validation|get_token|go|grpc_client|hidden_metric|kube_apiserver|kubernetes_build|kubernetes_feature|node_authorizer|pod_security|process_cpu|process_max|process_open|process_resident|process_start|process_virtual|registered_metric|rest_client|scrape_duration|scrape_samples|scrape_series|serviceaccount_legacy|serviceaccount_stale|serviceaccount_valid|watch_cache|workqueue)_(.+)
|
regex: (aggregator_openapi|aggregator_unavailable|apiextensions_openapi|apiserver_admission|apiserver_audit|apiserver_cache|apiserver_cel|apiserver_client|apiserver_crd|apiserver_current|apiserver_envelope|apiserver_flowcontrol|apiserver_init|apiserver_kube|apiserver_longrunning|apiserver_request|apiserver_requested|apiserver_response|apiserver_selfrequest|apiserver_storage|apiserver_terminated|apiserver_tls|apiserver_watch|apiserver_webhooks|authenticated_user|authentication|disabled_metric|etcd_bookmark|etcd_lease|etcd_request|field_validation|get_token|go|grpc_client|hidden_metric|kube_apiserver|kubernetes_build|kubernetes_feature|node_authorizer|pod_security|process_cpu|process_max|process_open|process_resident|process_start|process_virtual|registered_metric|rest_client|scrape_duration|scrape_samples|scrape_series|serviceaccount_legacy|serviceaccount_stale|serviceaccount_valid|watch_cache|workqueue)_(.+)
|
||||||
{% endif %}
|
<% endif %>
|
||||||
# Drop high cardinality labels
|
# Drop high cardinality labels
|
||||||
- action: drop
|
- action: drop
|
||||||
sourceLabels: ["__name__"]
|
sourceLabels: ["__name__"]
|
||||||
@@ -91,49 +91,49 @@ spec:
|
|||||||
kubeControllerManager:
|
kubeControllerManager:
|
||||||
enabled: true
|
enabled: true
|
||||||
endpoints: &endpoints
|
endpoints: &endpoints
|
||||||
{% for item in bootstrap_nodes.master %}
|
<% for item in bootstrap_nodes.master %>
|
||||||
- {{ item.address }}
|
- << item.address >>
|
||||||
{% endfor %}
|
<% endfor %>
|
||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
serviceMonitor:
|
serviceMonitor:
|
||||||
metricRelabelings:
|
metricRelabelings:
|
||||||
# Remove duplicate labels provided by k3s
|
# Remove duplicate labels provided by k3s
|
||||||
- action: keep
|
- action: keep
|
||||||
sourceLabels: ["__name__"]
|
sourceLabels: ["__name__"]
|
||||||
regex: "(apiserver_audit|apiserver_client|apiserver_delegated|apiserver_envelope|apiserver_storage|apiserver_webhooks|attachdetach_controller|authenticated_user|authentication|cronjob_controller|disabled_metric|endpoint_slice|ephemeral_volume|garbagecollector_controller|get_token|go|hidden_metric|job_controller|kubernetes_build|kubernetes_feature|leader_election|node_collector|node_ipam|process_cpu|process_max|process_open|process_resident|process_start|process_virtual|pv_collector|registered_metric|replicaset_controller|rest_client|retroactive_storageclass|root_ca|running_managed|scrape_duration|scrape_samples|scrape_series|service_controller|storage_count|storage_operation|ttl_after|volume_operation|workqueue)_(.+)"
|
regex: "(apiserver_audit|apiserver_client|apiserver_delegated|apiserver_envelope|apiserver_storage|apiserver_webhooks|attachdetach_controller|authenticated_user|authentication|cronjob_controller|disabled_metric|endpoint_slice|ephemeral_volume|garbagecollector_controller|get_token|go|hidden_metric|job_controller|kubernetes_build|kubernetes_feature|leader_election|node_collector|node_ipam|process_cpu|process_max|process_open|process_resident|process_start|process_virtual|pv_collector|registered_metric|replicaset_controller|rest_client|retroactive_storageclass|root_ca|running_managed|scrape_duration|scrape_samples|scrape_series|service_controller|storage_count|storage_operation|ttl_after|volume_operation|workqueue)_(.+)"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
kubeEtcd:
|
kubeEtcd:
|
||||||
{% if bootstrap_nodes.master | length > 1 %}
|
<% if bootstrap_nodes.master | length > 1 %>
|
||||||
enabled: true
|
enabled: true
|
||||||
{% else %}
|
<% else %>
|
||||||
enabled: false
|
enabled: false
|
||||||
{% endif %}
|
<% endif %>
|
||||||
endpoints: *endpoints
|
endpoints: *endpoints
|
||||||
kubeScheduler:
|
kubeScheduler:
|
||||||
enabled: true
|
enabled: true
|
||||||
endpoints: *endpoints
|
endpoints: *endpoints
|
||||||
{% if bootstrap_distribution == 'k3s' %}
|
<% if bootstrap_distribution == 'k3s' %>
|
||||||
serviceMonitor:
|
serviceMonitor:
|
||||||
metricRelabelings:
|
metricRelabelings:
|
||||||
# Remove duplicate labels provided by k3s
|
# Remove duplicate labels provided by k3s
|
||||||
- action: keep
|
- action: keep
|
||||||
sourceLabels: ["__name__"]
|
sourceLabels: ["__name__"]
|
||||||
regex: "(apiserver_audit|apiserver_client|apiserver_delegated|apiserver_envelope|apiserver_storage|apiserver_webhooks|authenticated_user|authentication|disabled_metric|go|hidden_metric|kubernetes_build|kubernetes_feature|leader_election|process_cpu|process_max|process_open|process_resident|process_start|process_virtual|registered_metric|rest_client|scheduler|scrape_duration|scrape_samples|scrape_series|workqueue)_(.+)"
|
regex: "(apiserver_audit|apiserver_client|apiserver_delegated|apiserver_envelope|apiserver_storage|apiserver_webhooks|authenticated_user|authentication|disabled_metric|go|hidden_metric|kubernetes_build|kubernetes_feature|leader_election|process_cpu|process_max|process_open|process_resident|process_start|process_virtual|registered_metric|rest_client|scheduler|scrape_duration|scrape_samples|scrape_series|workqueue)_(.+)"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
kubeProxy:
|
kubeProxy:
|
||||||
enabled: false # Disabled due to eBPF
|
enabled: false # Disabled due to eBPF
|
||||||
prometheus:
|
prometheus:
|
||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
ingressClassName: internal
|
ingressClassName: internal
|
||||||
{% if homepage.enabled | default(false) %}
|
<% if homepage.enabled | default(false) %>
|
||||||
annotations:
|
annotations:
|
||||||
gethomepage.dev/enabled: "true"
|
gethomepage.dev/enabled: "true"
|
||||||
gethomepage.dev/icon: prometheus.png
|
gethomepage.dev/icon: prometheus.png
|
||||||
gethomepage.dev/name: Prometheus
|
gethomepage.dev/name: Prometheus
|
||||||
gethomepage.dev/group: Observability
|
gethomepage.dev/group: Observability
|
||||||
gethomepage.dev/widget.type: prometheus
|
gethomepage.dev/widget.type: prometheus
|
||||||
{% endif %}
|
<% endif %>
|
||||||
pathType: Prefix
|
pathType: Prefix
|
||||||
hosts:
|
hosts:
|
||||||
- "prometheus.${SECRET_DOMAIN}"
|
- "prometheus.${SECRET_DOMAIN}"
|
||||||
@@ -164,4 +164,4 @@ spec:
|
|||||||
multicluster:
|
multicluster:
|
||||||
etcd:
|
etcd:
|
||||||
enabled: true
|
enabled: true
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
{% if kube_prometheus_stack.enabled | default(false) %}
|
<% if kube_prometheus_stack.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if kube_prometheus_stack.enabled | default(false) %}
|
<% if kube_prometheus_stack.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -19,4 +19,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+4
-4
@@ -1,4 +1,4 @@
|
|||||||
{% if kubernetes_dashboard.enabled | default(false) %}
|
<% if kubernetes_dashboard.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -32,13 +32,13 @@ spec:
|
|||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
className: internal
|
className: internal
|
||||||
{% if homepage.enabled | default(false) %}
|
<% if 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
|
||||||
gethomepage.dev/name: Kubernetes Dashboard
|
gethomepage.dev/name: Kubernetes Dashboard
|
||||||
gethomepage.dev/group: Observability
|
gethomepage.dev/group: Observability
|
||||||
{% endif %}
|
<% endif %>
|
||||||
hosts:
|
hosts:
|
||||||
- &host "kubernetes.${SECRET_DOMAIN}"
|
- &host "kubernetes.${SECRET_DOMAIN}"
|
||||||
tls:
|
tls:
|
||||||
@@ -46,4 +46,4 @@ spec:
|
|||||||
- *host
|
- *host
|
||||||
metricsScraper:
|
metricsScraper:
|
||||||
enabled: true
|
enabled: true
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
{% if kubernetes_dashboard.enabled | default(false) %}
|
<% if kubernetes_dashboard.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./rbac.yaml
|
- ./rbac.yaml
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
{% if kubernetes_dashboard.enabled | default(false) %}
|
<% if 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
|
||||||
---
|
---
|
||||||
@@ -38,4 +38,4 @@ subjects:
|
|||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: kubernetes-dashboard
|
name: kubernetes-dashboard
|
||||||
namespace: observability
|
namespace: observability
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if kubernetes_dashboard.enabled | default(false) %}
|
<% if kubernetes_dashboard.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -22,4 +22,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -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.enabled | default(false) %>
|
||||||
- ./grafana/ks.yaml
|
- ./grafana/ks.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
{% if kube_prometheus_stack.enabled | default(false) %}
|
<% if 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.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.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -27,4 +27,4 @@ spec:
|
|||||||
values:
|
values:
|
||||||
externalSnapshotter:
|
externalSnapshotter:
|
||||||
enabled: false
|
enabled: false
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
{% if csi_driver_nfs.enabled | default(false) %}
|
<% if csi_driver_nfs.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
- ./storageclass.yaml
|
- ./storageclass.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
{% if csi_driver_nfs.enabled | default(false) %}
|
<% if 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
|
||||||
kind: StorageClass
|
kind: StorageClass
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ item.name }}
|
name: << item.name >>
|
||||||
provisioner: nfs.csi.k8s.io
|
provisioner: nfs.csi.k8s.io
|
||||||
parameters:
|
parameters:
|
||||||
server: {{ item.server }}
|
server: << item.server >>
|
||||||
share: {{ item.share }}
|
share: << item.share >>
|
||||||
reclaimPolicy: Delete
|
reclaimPolicy: Delete
|
||||||
volumeBindingMode: Immediate
|
volumeBindingMode: Immediate
|
||||||
mountOptions: ["hard", "noatime"]
|
mountOptions: ["hard", "noatime"]
|
||||||
{% endfor %}
|
<% endfor %>
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if csi_driver_nfs.enabled | default(false) %}
|
<% if csi_driver_nfs.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -19,4 +19,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -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.enabled | default(false) %>
|
||||||
- ./volsync/ks.yaml
|
- ./volsync/ks.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
{% if csi_driver_nfs.enabled | default(false) %}
|
<% if csi_driver_nfs.enabled | default(false) %>
|
||||||
- ./csi-driver-nfs/ks.yaml
|
- ./csi-driver-nfs/ks.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -29,5 +29,5 @@ spec:
|
|||||||
enabled: true
|
enabled: true
|
||||||
name: openebs-hostpath
|
name: openebs-hostpath
|
||||||
isDefaultClass: false
|
isDefaultClass: false
|
||||||
basePath: "{{ bootstrap_local_storage_path }}"
|
basePath: "<< bootstrap_local_storage_path >>"
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if volsync.enabled | default(false) %}
|
<% if volsync.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -41,4 +41,4 @@ spec:
|
|||||||
tag: *tag
|
tag: *tag
|
||||||
metrics:
|
metrics:
|
||||||
disableAuth: true
|
disableAuth: true
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
{% if volsync.enabled | default(false) %}
|
<% if volsync.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
- ./prometheusrule.yaml
|
- ./prometheusrule.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if volsync.enabled | default(false) %}
|
<% if volsync.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: PrometheusRule
|
kind: PrometheusRule
|
||||||
@@ -17,9 +17,9 @@ spec:
|
|||||||
severity: critical
|
severity: critical
|
||||||
- alert: VolSyncVolumeOutOfSync
|
- alert: VolSyncVolumeOutOfSync
|
||||||
annotations:
|
annotations:
|
||||||
summary: "{% raw %}{{ $labels.obj_namespace }}/{{ $labels.obj_name }} volume is out of sync.{% endraw %}"
|
summary: "{{ $labels.obj_namespace }}/{{ $labels.obj_name }} volume is out of sync."
|
||||||
expr: volsync_volume_out_of_sync == 1
|
expr: volsync_volume_out_of_sync == 1
|
||||||
for: 15m
|
for: 15m
|
||||||
labels:
|
labels:
|
||||||
severity: critical
|
severity: critical
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if volsync.enabled | default(false) %}
|
<% if volsync.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -39,4 +39,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
{% if volsync.enabled | default(false) %}
|
<% if volsync.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -32,4 +32,4 @@ spec:
|
|||||||
create: true
|
create: true
|
||||||
webhook:
|
webhook:
|
||||||
enabled: false
|
enabled: false
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
{% if volsync.enabled | default(false) %}
|
<% if volsync.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -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.enabled | default(false) %>
|
||||||
- ./system-upgrade-controller/ks.yaml
|
- ./system-upgrade-controller/ks.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -29,4 +29,4 @@ spec:
|
|||||||
readOnlyRootFileSystem: true
|
readOnlyRootFileSystem: true
|
||||||
podMonitor:
|
podMonitor:
|
||||||
enabled: true
|
enabled: true
|
||||||
namespace: "{% raw %}{{ .Release.Namespace }}{% endraw %}"
|
namespace: "{{ .Release.Namespace }}"
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %}
|
<% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -103,4 +103,4 @@ spec:
|
|||||||
globalMounts:
|
globalMounts:
|
||||||
- path: /etc/ca-certificates
|
- path: /etc/ca-certificates
|
||||||
readOnly: true
|
readOnly: true
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %}
|
<% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -7,4 +7,4 @@ resources:
|
|||||||
- https://github.com/rancher/system-upgrade-controller/releases/download/v0.13.2/crd.yaml
|
- https://github.com/rancher/system-upgrade-controller/releases/download/v0.13.2/crd.yaml
|
||||||
- helmrelease.yaml
|
- helmrelease.yaml
|
||||||
- rbac.yaml
|
- rbac.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %}
|
<% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
@@ -12,4 +12,4 @@ subjects:
|
|||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: system-upgrade
|
name: system-upgrade
|
||||||
namespace: tools
|
namespace: tools
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %}
|
<% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -41,4 +41,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %}
|
<% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: upgrade.cattle.io/v1
|
apiVersion: upgrade.cattle.io/v1
|
||||||
kind: Plan
|
kind: Plan
|
||||||
@@ -17,4 +17,4 @@ spec:
|
|||||||
args: ["prepare", "server"]
|
args: ["prepare", "server"]
|
||||||
upgrade:
|
upgrade:
|
||||||
image: rancher/k3s-upgrade
|
image: rancher/k3s-upgrade
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
{% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %}
|
<% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./server.yaml
|
- ./server.yaml
|
||||||
- ./agent.yaml
|
- ./agent.yaml
|
||||||
{% endif %}
|
<% endif %>
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
{% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %}
|
<% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %>
|
||||||
---
|
---
|
||||||
apiVersion: upgrade.cattle.io/v1
|
apiVersion: upgrade.cattle.io/v1
|
||||||
kind: Plan
|
kind: Plan
|
||||||
@@ -22,4 +22,4 @@ spec:
|
|||||||
- {key: CriticalAddonsOnly, operator: Exists}
|
- {key: CriticalAddonsOnly, operator: Exists}
|
||||||
upgrade:
|
upgrade:
|
||||||
image: rancher/k3s-upgrade
|
image: rancher/k3s-upgrade
|
||||||
{% endif %}
|
<% endif %>
|
||||||
@@ -7,14 +7,14 @@ 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 >>"
|
||||||
{% else %}
|
<% else %>
|
||||||
url: "https://github.com/{{ bootstrap_github_username }}/{{ bootstrap_github_repository_name }}.git"
|
url: "https://github.com/<< bootstrap_github_username >>/<< bootstrap_github_repository_name >>.git"
|
||||||
{% endif %}
|
<% endif %>
|
||||||
ignore: |
|
ignore: |
|
||||||
# exclude all
|
# exclude all
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -5,6 +5,6 @@ metadata:
|
|||||||
name: cluster-secrets
|
name: cluster-secrets
|
||||||
namespace: flux-system
|
namespace: flux-system
|
||||||
stringData:
|
stringData:
|
||||||
SECRET_DOMAIN: "{{ bootstrap_cloudflare_domain }}"
|
SECRET_DOMAIN: "<< bootstrap_cloudflare_domain >>"
|
||||||
SECRET_ACME_EMAIL: "{{ bootstrap_acme_email }}"
|
SECRET_ACME_EMAIL: "<< bootstrap_acme_email >>"
|
||||||
SECRET_CLOUDFLARE_TUNNEL_ID: "{{ bootstrap_cloudflare_tunnel_id }}"
|
SECRET_CLOUDFLARE_TUNNEL_ID: "<< bootstrap_cloudflare_tunnel_id >>"
|
||||||
@@ -5,17 +5,17 @@ metadata:
|
|||||||
name: cluster-settings
|
name: cluster-settings
|
||||||
namespace: flux-system
|
namespace: flux-system
|
||||||
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 and not bootstrap_kube_api_addr %}
|
<% if bootstrap_nodes.master | length == 1 and not bootstrap_kube_api_addr %>
|
||||||
KUBE_API_ADDR: "{{ bootstrap_nodes.master[0].address }}"
|
KUBE_API_ADDR: "<< bootstrap_nodes.master[0].address >>"
|
||||||
{% else %}
|
<% else %>
|
||||||
KUBE_API_ADDR: "{{ bootstrap_kube_api_addr }}"
|
KUBE_API_ADDR: "<< bootstrap_kube_api_addr >>"
|
||||||
{% 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 %>
|
||||||
@@ -26,20 +26,3 @@
|
|||||||
|
|
||||||
- name: Verify configuration
|
- name: Verify configuration
|
||||||
ansible.builtin.include_tasks: tasks/validation/main.yaml
|
ansible.builtin.include_tasks: tasks/validation/main.yaml
|
||||||
|
|
||||||
# - name: Template Sops configuration
|
|
||||||
# ansible.builtin.include_tasks: tasks/sops/main.yaml
|
|
||||||
|
|
||||||
# - name: Template k0s configuration
|
|
||||||
# when: bootstrap_distribution == "k0s"
|
|
||||||
# ansible.builtin.include_tasks: tasks/k0s/main.yaml
|
|
||||||
|
|
||||||
# - name: Template Ansible configuration
|
|
||||||
# when: bootstrap_distribution == "k0s" or bootstrap_distribution == "k3s"
|
|
||||||
# ansible.builtin.include_tasks: tasks/ansible/main.yaml
|
|
||||||
|
|
||||||
# - name: Template Kubernetes configuration
|
|
||||||
# ansible.builtin.include_tasks: tasks/kubernetes/main.yaml
|
|
||||||
|
|
||||||
# - name: Template Kubernetes addon configuration
|
|
||||||
# ansible.builtin.include_tasks: tasks/addons/main.yaml
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
[makejinja]
|
||||||
|
inputs = ["./bootstrap/templates"]
|
||||||
|
output = "./"
|
||||||
|
data = ["./bootstrap/vars/addons.yaml", "./bootstrap/vars/config.yaml"]
|
||||||
|
import_paths = ["./bootstrap/scripts"]
|
||||||
|
loaders = ["loader:Loader"]
|
||||||
|
jinja_suffix = ".j2"
|
||||||
|
|
||||||
|
[makejinja.delimiter]
|
||||||
|
block_start = "<%"
|
||||||
|
block_end = "%>"
|
||||||
|
comment_start = "<#"
|
||||||
|
comment_end = "#>"
|
||||||
|
variable_start = "<<"
|
||||||
|
variable_end = ">>"
|
||||||
Reference in new issue
Block a user