feat: do not template out k3s ansible when k0s is choosen

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl committed 2024-01-11 16:46:36 -05:00
1 parent 8e7d36c0c5
commit c8ebab7508
29 files changed
+33 -15

No files matched your search

@@ -1,33 +0,0 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
---
#
# Below vars are for the xanmanning.k3s role
# ...see https://github.com/PyratLabs/ansible-role-k3s
#
# renovate: datasource=github-releases depName=k3s-io/k3s
k3s_release_version: "v1.29.0+k3s1"
k3s_install_hard_links: true
k3s_become: true
{% if bootstrap_nodes.master | length > 1 %}
k3s_etcd_datastore: true
{% else %}
k3s_etcd_datastore: false
{% endif %}
k3s_registration_address: "{% raw %}{{ kubeapi_addr }}{% endraw %}"
# /var/lib/rancher/k3s/server/manifests
k3s_server_manifests_templates:
- custom-cilium-helmchart.yaml.j2
{% if not bootstrap_ipv6_enabled | default(false) %}
- custom-cilium-l2.yaml.j2
{% endif %}
- custom-coredns-helmchart.yaml.j2
{% if bootstrap_kube_vip_enabled | default(true) %}
# /var/lib/rancher/k3s/server/manifests
k3s_server_manifests_urls:
- url: https://raw.githubusercontent.com/kube-vip/website/main/content/manifests/rbac.yaml
filename: kube-vip-rbac.yaml
# /var/lib/rancher/k3s/agent/pod-manifests
k3s_server_pod_manifests_templates:
- kube-vip-static-pod.yaml.j2
{% endif %}
@@ -1,13 +0,0 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
---
timezone: "{{ bootstrap_timezone }}"
github_username: "{{ bootstrap_github_username }}"
coredns_addr: "{{ bootstrap_service_cidr.split(',')[0] | ansible.utils.nthhost(10) }}"
kubeapi_addr: "{{ bootstrap_kubeapi_addr }}"
cluster_cidr: "{{ bootstrap_cluster_cidr.split(',')[0] }}"
service_cidr: "{{ bootstrap_service_cidr.split(',')[0] }}"
node_cidr: "{{ bootstrap_node_cidr }}"
{% if bootstrap_ipv6_enabled | default(false) %}
cluster_cidr_v6: "{{ bootstrap_cluster_cidr.split(',')[1] }}"
service_cidr_v6: "{{ bootstrap_service_cidr.split(',')[1] }}"
{% endif %}
@@ -1,47 +0,0 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
---
# https://rancher.com/docs/k3s/latest/en/installation/install-options/server-config/
# https://github.com/PyratLabs/ansible-role-k3s
k3s_control_node: true
k3s_server:
{% if bootstrap_ipv6_enabled | default(false) %}
node-ip: "{% raw %}{{ ansible_host }},{{ ansible_default_ipv6.address }}{% endraw %}"
{% else %}
node-ip: "{% raw %}{{ ansible_host }}{% endraw %}"
{% endif %}
tls-san:
- "{% raw %}{{ kubeapi_addr }}{% endraw %}"
docker: false
flannel-backend: "none" # This needs to be in quotes
disable:
- coredns # Disable coredns - replaced with Coredns Helm Chart
- flannel # Disable flannel - replaced with Cilium Helm Chart
- local-storage # Disable local-path-provisioner - replaced with democratic-csi
- metrics-server # Disable metrics-server - installed with Flux
- servicelb # Disable servicelb - replaced with Cilium Helm Chart
- traefik # Disable traefik - replaced with ingress-nginx and installed with Flux
disable-network-policy: true
disable-cloud-controller: true
disable-kube-proxy: true # Cilium uses eBPF
write-kubeconfig-mode: "644"
pause-image: registry.k8s.io/pause:3.9
secrets-encryption: true
{% if bootstrap_ipv6_enabled | default(false) %}
cluster-cidr: "{% raw %}{{ cluster_cidr }},{{ cluster_cidr_v6 }}{% endraw %}"
service-cidr: "{% raw %}{{ service_cidr }},{{ service_cidr_v6 }}{% endraw %}"
{% else %}
cluster-cidr: "{% raw %}{{ cluster_cidr }}{% endraw %}"
service-cidr: "{% raw %}{{ service_cidr }}{% endraw %}"
{% endif %}
etcd-expose-metrics: true # Required to monitor etcd with kube-prometheus-stack
kube-controller-manager-arg:
- "bind-address=0.0.0.0" # Required to monitor kube-controller-manager with kube-prometheus-stack
kube-scheduler-arg:
- "bind-address=0.0.0.0" # Required to monitor kube-scheduler with kube-prometheus-stack
kube-apiserver-arg:
- "anonymous-auth=true" # Required for HAProxy health-checks
# TODO: Move these options to a kubelet config file
kubelet-arg:
- "image-gc-high-threshold=55"
- "image-gc-low-threshold=50"
@@ -1,17 +0,0 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
---
# https://rancher.com/docs/k3s/latest/en/installation/install-options/agent-config/
# https://github.com/PyratLabs/ansible-role-k3s
k3s_control_node: false
k3s_agent:
{% if bootstrap_ipv6_enabled | default(false) %}
node-ip: "{% raw %}{{ ansible_host }},{{ ansible_default_ipv6.address }}{% endraw %}"
{% else %}
node-ip: "{% raw %}{{ ansible_host }}{% endraw %}"
{% endif %}
pause-image: registry.k8s.io/pause:3.9
# TODO: Move these options to a kubelet config file
kubelet-arg:
- "image-gc-high-threshold=55"
- "image-gc-low-threshold=50"
Whitespace-only changes.
@@ -1,28 +0,0 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
---
kubernetes:
children:
master:
hosts:
{% for item in bootstrap_nodes.master %}
{{ item.name }}:
ansible_user: {{ item.username }}
{% if item.external_address is defined %}
ansible_host: {{ item.external_address }}
{% else %}
ansible_host: {{ item.address }}
{% endif %}
{% endfor %}
{% if bootstrap_nodes.worker | default([]) | length > 0 %}
worker:
hosts:
{% for item in bootstrap_nodes.worker %}
{{ item.name }}:
ansible_user: {{ item.username }}
{% if item.external_address is defined %}
ansible_host: {{ item.external_address }}
{% else %}
ansible_host: {{ item.address }}
{% endif %}
{% endfor %}
{% endif %}