You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/configuration.md
+71-10Lines changed: 71 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,17 +31,78 @@ The type of persistence used for this can be configurable via `spec.persistence`
31
31
32
32
## K0s configuration
33
33
34
-
K0smotron allows you to configure k0s via `spec.k0sConfig` field. If empty, the default configuration will be used.
34
+
K0smotron allows you to configure k0s via `spec.k0sConfig` field. This field expects a k0s **ClusterConfig** resource as value, which defines the configuration parameters for k0s. If `spec.k0sConfig` is left empty, the default k0s configuration will be applied.
35
35
36
-
Refer to [k0s docs](https://docs.k0sproject.io/stable/configuration/) for a reference on k0s configuration.
36
+
Refer to [k0s docs](https://docs.k0sproject.io/stable/configuration/) for a reference on configuring k0s via the ClusterConfig resource.
37
37
38
-
**Note**: Some fields will be overwritten by k0smotron. K0smotron will set the following fields:
39
-
40
-
- `spec.k0sConfig.spec.api.externalAddress`will be set to the value of `spec.externalAddress` if `spec.externalAddress` is set.
41
-
If not, k0smotron will use load balancer IP or try to detect `externalAddress` out of nodes IP addresses.
42
-
- `spec.k0sConfig.spec.api.port`will be set to the value of `spec.service.apiPort`.
43
-
- `spec.k0sConfig.spec.konnectivity.port`will be set to the value of `spec.service.konnectivityPort`.
44
-
- `spec.k0sConfig.spec.storage.kine.dataSource`will be set to the value of `spec.kineDataSourceURL` if `spec.kineDataSourceURL` is set.
45
-
`spec.k0sConfig.spec.storage.type`will be set to `kine`.
38
+
### ClusterConfig for K0smotron
46
39
40
+
K0smotron can automatically generate `spec.k0sConfig` or override some fields (if provided) based on the values provided for the [Cluster](resource-reference.md/#clusterspec) resource, following specific configuration rules:
47
41
42
+
<table>
43
+
<tr>
44
+
<th style="width: 30%;">ClusterConfig Field</th>
45
+
<th style="width: 30%;">Value</th>
46
+
<th>Condition</th>
47
+
</tr>
48
+
<tr>
49
+
<td><code>api.externalAddress</code></td>
50
+
<td>Value in <code>spec.externalAddress</code> if provided. Otherwise, depending of the service type, K0smotron attempts to detect an external address from the load balancer or available node IPs.</td>
51
+
<td>Only set if <code>nodeLocalLoadBalancing.enabled</code> is <code>false</code>.</td>
52
+
</tr>
53
+
<tr>
54
+
<td><code>api.port</code></td>
55
+
<td>Value in <code>spec.service.apiPort</code></td>
56
+
<td>Always.</td>
57
+
</tr>
58
+
<tr>
59
+
<td><code>api.sans</code></td>
60
+
<td><code>[<spec.externalAddress>, <cluster-svc-ips>, <cluster-service-name>, <cluster-service-name-namespaced>, <cluster-service-name-DNS>], <cluster-service-name-FQDNS></code> plus the possible provided ones.</td>
61
+
<td>Always.</td>
62
+
</tr>
63
+
<tr>
64
+
<td><code>konnectivity.port</code></td>
65
+
<td>Value in <code>spec.service.konnectivityPort</code></td>
66
+
<td>Always.</td>
67
+
</tr>
68
+
<tr>
69
+
<td><code>storage.kine.dataSource</code></td>
70
+
<td>Value in <code>spec.kineDataSourceURL</code></td>
71
+
<td>Only set if <code>spec.kineDataSourceURL</code> is defined.</td>
72
+
</tr>
73
+
<tr>
74
+
<td><code>storage.type</code></td>
75
+
<td><code>kine</code></td>
76
+
<td>Only set if <code>spec.kineDataSourceURL</code> is defined.</td>
77
+
</tr>
78
+
<tr>
79
+
<td><code>storage.type</code></td>
80
+
<td><code>etcd</code></td>
81
+
<td>Only set if <code>spec.kineDataSourceURL</code> is not defined.</td>
0 commit comments