Skip to content

Commit

Permalink
make rke2_kubelet_arg set root-dir by default, as it is somewhat unin…
Browse files Browse the repository at this point in the history
…tuitive that it does not follow the rke2_data_path
  • Loading branch information
Simon Ungar Felding committed Oct 11, 2024
1 parent 10fe5d9 commit 24d5e87
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ rke2_install_bash_url: https://get.rke2.io
# Local data directory for RKE2
rke2_data_path: /var/lib/rancher/rke2

# Extra kubelet arguments (https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/)
rke2_kubelet_arg:
- "root-dir=/var/lib/kubelet" # kubelet data directory (/var/lib/kubelet is the default but "{{ rke2_data_path }}/kubelet" could make more sense for you)
# - "system-reserved=cpu=100m,memory=100Mi"

# Default URL to fetch artifacts
rke2_artifact_url: https://github.com/rancher/rke2/releases/download/

Expand Down Expand Up @@ -322,10 +327,6 @@ rke2_wait_for_all_pods_to_be_ready: false
# Enable debug mode (rke2-service)
rke2_debug: false

# (Optional) Customize default kubelet arguments
# rke2_kubelet_arg:
# - "--system-reserved=cpu=100m,memory=100Mi"

# (Optional) Customize default kube-proxy arguments
# rke2_kube_proxy_arg:
# - "proxy-mode=ipvs"
Expand Down
10 changes: 6 additions & 4 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ rke2_install_bash_url: https://get.rke2.io
# Local data directory for RKE2
rke2_data_path: /var/lib/rancher/rke2

# Extra kubelet arguments (https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/)
rke2_kubelet_arg:
- "root-dir=/var/lib/kubelet" # kubelet data directory (/var/lib/kubelet is the default)
# - "root-dir={{ rke2_data_path }}/kubelet" # using rke2_data_path could make more sense in your setup.
# - "system-reserved=cpu=100m,memory=100Mi"

# Default URL to fetch artifacts
rke2_artifact_url: https://github.com/rancher/rke2/releases/download/

Expand Down Expand Up @@ -284,10 +290,6 @@ rke2_wait_for_all_pods_to_be_ready: false
# Enable debug mode (rke2-service)
rke2_debug: false

# (Optional) Customize default kubelet arguments
# rke2_kubelet_arg:
# - "--system-reserved=cpu=100m,memory=100Mi"

# (Optional) Customize default kube-proxy arguments
# rke2_kube_proxy_arg:
# - "proxy-mode=ipvs"
Expand Down
2 changes: 1 addition & 1 deletion tasks/first_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
path: /etc/rancher/rke2
owner: root
group: root
mode: 0755
mode: 075

- name: Set server taints
ansible.builtin.set_fact:
Expand Down
2 changes: 0 additions & 2 deletions templates/config.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,10 @@ kube-scheduler-arg:
{% if (rke2_debug | bool ) %}
debug: true
{% endif %}
{% if ( rke2_kubelet_arg is defined ) %}
kubelet-arg:
{% for argument in rke2_kubelet_arg %}
- {{ argument }}
{% endfor %}
{% endif %}
{% if ( rke2_kube_proxy_arg is defined ) %}
kube-proxy-arg:
{% for argument in rke2_kube_proxy_arg %}
Expand Down

0 comments on commit 24d5e87

Please sign in to comment.