mirror of
https://github.com/PyratLabs/ansible-role-k3s.git
synced 2024-11-29 12:55:51 +01:00
Merge pull request #14 from PyratLabs/carpenike-master
Carpenike master
This commit is contained in:
commit
554fada914
18
README.md
18
README.md
@ -125,6 +125,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_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_external_address` | External IP Address to advertise for this node. | _NULL_ |
|
||||||
| `k3s_node_labels` | List of node labels. | _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_taints` | List of node taints. | _NULL_ |
|
||||||
| `k3s_node_data_dir` | Folder to hold state. | `/var/lib/rancher/k3s` |
|
| `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_ |
|
| `k3s_tls_san` | Add additional hosname or IP as Subject Alternate Name in the TLS cert. | _NULL_ |
|
||||||
@ -155,6 +156,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
|
necessary to have the flannel interface on a network interface that is routable
|
||||||
to the master node(s).
|
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
|
||||||
|
cloud controller 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`
|
#### Notes about `k3s_node_labels` and `k3s_node_taints`
|
||||||
|
|
||||||
Both these variables are lists that will be iterated on. The below example will
|
Both these variables are lists that will be iterated on. The below example will
|
||||||
|
@ -19,5 +19,8 @@
|
|||||||
- hello: world
|
- hello: world
|
||||||
k3s_node_taints:
|
k3s_node_taints:
|
||||||
- key1: value1:NoExecute
|
- key1: value1:NoExecute
|
||||||
|
k3s_kubelet_args:
|
||||||
|
- cloud-provider: external
|
||||||
|
- provider-id: azure
|
||||||
roles:
|
roles:
|
||||||
- role: xanmanning.k3s
|
- role: xanmanning.k3s
|
||||||
|
@ -118,6 +118,14 @@
|
|||||||
fail_msg: "Node Taints are not supported in {{ k3s_release_version }}"
|
fail_msg: "Node Taints are not supported in {{ k3s_release_version }}"
|
||||||
when: k3s_node_taints is defined and k3s_node_taints
|
when: k3s_node_taints is defined and k3s_node_taints
|
||||||
|
|
||||||
|
- name: Check k3s_kubelet_args against k3s version
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- (k3s_release_version | replace('v', '')) is version_compare('0.4.0', '>=')
|
||||||
|
success_msg: "Kubelet args supported in {{ k3s_release_version }}"
|
||||||
|
fail_msg: "Kubelet args are not supported in {{ k3s_release_version }}"
|
||||||
|
when: k3s_kubelet_args is defined and k3s_kubelet_args | length > 0
|
||||||
|
|
||||||
- name: Check k3s_flannel_backend against k3s version
|
- name: Check k3s_flannel_backend against k3s version
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -129,6 +129,13 @@ ExecStart={{ k3s_install_dir }}/k3s
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% 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 %}
|
||||||
{% endfilter %}
|
{% endfilter %}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user