From c473f932c45892bcb253701817c061a5e694a694 Mon Sep 17 00:00:00 2001 From: Ryan Holt Date: Wed, 26 Feb 2020 18:03:08 -0500 Subject: [PATCH 1/3] added kubelet args key Signed-off-by: Ryan Holt --- README.md | 1 + templates/k3s.service.j2 | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 2a2ed01..4b2d557 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,7 @@ Below are variables that are set against specific hosts in your inventory. | `k3s_node_ip_address` | IP Address to advertise for this node. | _NULL_ | | `k3s_node_external_address` | External IP Address to advertise for this node. | _NULL_ | | `k3s_node_labels` | List of node labels. | _NULL_ | +| `k3s_kubelet_args` | A list of kubelet args to pass to the server. | [] | | `k3s_node_taints` | List of node taints. | _NULL_ | | `k3s_node_data_dir` | Folder to hold state. | `/var/lib/rancher/k3s` | | `k3s_tls_san` | Add additional hosname or IP as Subject Alternate Name in the TLS cert. | _NULL_ | diff --git a/templates/k3s.service.j2 b/templates/k3s.service.j2 index 7f096c6..06fb371 100644 --- a/templates/k3s.service.j2 +++ b/templates/k3s.service.j2 @@ -129,6 +129,13 @@ ExecStart={{ k3s_install_dir }}/k3s {% endfor %} {% endfor %} {% endif %} +{% if k3s_kubelet_args is defined and k3s_kubelet_args is iterable %} + {% for arg in k3s_kubelet_args %} + {% for key, value in arg.items() %} + --kubelet-arg {{ key }}={{ value }} + {% endfor %} + {% endfor %} +{% endif %} {% endfilter %} {% endfilter %} From db96168491a7dab49eba53b0b8dc54143cd4fe1b Mon Sep 17 00:00:00 2001 From: Ryan Holt Date: Wed, 26 Feb 2020 21:16:52 -0500 Subject: [PATCH 2/3] added example for kubelet_args in README Signed-off-by: Ryan Holt --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 4b2d557..a20761c 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,23 @@ If you are running k3s on systems with multiple network interfaces, it is necessary to have the flannel interface on a network interface that is routable to the master node(s). +#### Notes about `k3s_kubelet_args` + +This parameter allows for assigning additional kubelet args to the server during +runtime. For instance, to use the Azure Cloud Controller, assign the following to +the master node's configuration in your host file. + +Note, when using an external cloud controller as below, ensure that the native k3s +option is disabled by setting the `k3s_disable_cloud_controller` to `true`. + +**YAML**: + +```yaml +k3s_kubelet_args: + - cloud-provider: external + - provider-id: azure +``` + #### Notes about `k3s_node_labels` and `k3s_node_taints` Both these variables are lists that will be iterated on. The below example will From 3f6ce99369a0056b1e257a232961c513e7872b86 Mon Sep 17 00:00:00 2001 From: Ryan Holt Date: Wed, 26 Feb 2020 21:17:51 -0500 Subject: [PATCH 3/3] rephrase option to cloud controller Signed-off-by: Ryan Holt --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a20761c..9022485 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ runtime. For instance, to use the Azure Cloud Controller, assign the following t the master node's configuration in your host file. Note, when using an external cloud controller as below, ensure that the native k3s -option is disabled by setting the `k3s_disable_cloud_controller` to `true`. +cloud controller is disabled by setting the `k3s_disable_cloud_controller` to `true`. **YAML**: