Skip to content

Commit 86017f8

Browse files
authored
Merge pull request #2583 from replicatedhq/110902
Clarify EC template func limitation
2 parents da0c671 + 8bac93b commit 86017f8

File tree

3 files changed

+62
-46
lines changed

3 files changed

+62
-46
lines changed

docs/reference/embedded-config.mdx

Lines changed: 51 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
11
# Embedded Cluster Config (Beta)
22

3-
This topic is a reference for the Replicated embedded cluster config custom resource. For more information about embedded cluster, see [Using Embedded Cluster](/vendor/embedded-overview).
3+
This topic is a reference for the Replicated Embedded Cluster Config custom resource. For more information about Embedded Cluster, see [Using Embedded Cluster](/vendor/embedded-overview).
44

55
:::note
6-
Embedded cluster is in beta. If you are instead looking for information about creating Kubernetes Installers with Replicated kURL, see the [Replicated kURL](/vendor/packaging-embedded-kubernetes) section.
6+
Embedded Cluster is in beta. If you are instead looking for information about creating Kubernetes Installers with Replicated kURL, see the [Replicated kURL](/vendor/packaging-embedded-kubernetes) section.
77
:::
88

99
## Overview
1010

11-
To install your application in an embedded cluster, an embedded cluster config must be created in a release. Embedded cluster binaries are available only for releases that include an embedded cluster config.
11+
To install your application with Embedded Cluster, an Embedded Cluster Config must be created in a release. Embedded Cluster installation artifacts are available only for releases that include an Embedded Cluster Config.
1212

13-
The embedded cluster config lets you define several aspects of the Kubernetes cluster that will be created.
13+
The Embedded Cluster Config lets you define several aspects of the Kubernetes cluster that will be created.
1414

15-
**Example**:
15+
### Limitations
16+
17+
* The Embedded Cluster Config does not support the use of Go template functions, including [KOTS template functions](/reference/template-functions-about).
18+
19+
For additional property-specific limitations, see the sections below.
20+
21+
### Example
1622

1723
```yaml
1824
apiVersion: embeddedcluster.replicated.com/v1beta1
1925
kind: Config
2026
spec:
21-
version: 1.9.1+k8s-1.29
27+
version: 1.10.0+k8s-1.29
2228
roles:
2329
controller:
2430
name: management
@@ -64,21 +70,21 @@ spec:
6470
service-node-port-range: 80-32767
6571
```
6672
67-
## Version
73+
## version
6874
69-
You must specify which version of embedded cluster to install. Each version of embedded cluster includes particular versions of components like KOTS (admin console) and OpenEBS.
75+
You must specify which version of Embedded Cluster to install. Each version of Embedded Cluster includes particular versions of components like KOTS (Admin Console) and OpenEBS.
7076
71-
For a full list of versions, see the embedded cluster [releases page](https://github.com/replicatedhq/embedded-cluster/releases) in GitHub. It's recommended to keep this version as up to date as possible because embedded cluster is changing rapidly.
77+
For a full list of versions, see the Embedded Cluster [releases page](https://github.com/replicatedhq/embedded-cluster/releases) in GitHub. It's recommended to keep this version as up to date as possible because Embedded Cluster is changing rapidly.
7278
73-
## Roles
79+
## roles
7480
75-
You can define node roles in the embedded cluster config. Roles are particularly useful for multi-node clusters. One or more roles can be selected and assigned to a node when it is joined to the cluster. Node roles can be used to determine which nodes run the Kubernetes control plane, and to assign application workloads to particular nodes.
81+
You can define node roles in the Embedded Cluster Config. Roles are particularly useful for multi-node clusters. One or more roles can be selected and assigned to a node when it is joined to the cluster. Node roles can be used to determine which nodes run the Kubernetes control plane, and to assign application workloads to particular nodes.
7682
7783
:::note
7884
Roles are not updated or changed after a node is added. If you need to change a node’s role, reset the node and add it again.
7985
:::
8086
81-
### Controller
87+
### controller
8288
8389
The controller role is required in any cluster. Nodes with this role are “controller workers” because they run the control plane and can run other workloads too. The first node in a cluster will always have the controller role because a cluster needs a control plane. Any node that doesn't have the controller role is a worker node.
8490
@@ -93,7 +99,7 @@ spec:
9399
name: management
94100
```
95101

96-
### Custom
102+
### custom
97103

98104
You can define custom roles for other purposes in the cluster. This is particularly useful when combined with labels.
99105

@@ -108,7 +114,7 @@ spec:
108114
- name: app
109115
```
110116

111-
### Labels
117+
### labels
112118

113119
Roles can have associated Kubernetes labels that are applied to any node in the cluster that is assigned that role. This is useful for things like assigning workloads to nodes.
114120

@@ -129,19 +135,25 @@ spec:
129135
app: "true" # Label applied to "app" nodes
130136
```
131137

132-
## Helm Extensions
133-
134-
If you need to install Helm charts before your application and as part of the embedded cluster itself, you can do this with Helm extensions. One situation where this is useful is if you want to ship an ingress controller, because embedded cluster does not yet include one.
138+
## extensions
135139

136-
Helm extensions are updated when new versions of your application are deployed from the admin console. So, for example, you can change the values for a Helm extension from one release to another, and those changes will be applied to the cluster when the new release is deployed.
140+
If you need to install Helm charts before your application and as part of the Embedded Cluster itself, you can do this with Helm extensions. One situation where this is useful is if you want to ship an ingress controller, because Embedded Cluster does not yet include one.
137141

138-
**Limitation**: If a Helm extension is removed from the embedded cluster config, the associated Helm chart is not removed from the cluster. This is a limitation that we intend to address in the future.
142+
Helm extensions are updated when new versions of your application are deployed from the Admin Console. So, for example, you can change the values for a Helm extension from one release to another, and those changes will be applied to the cluster when the new release is deployed.
139143

140144
The format for specifying Helm extensions uses the same k0s Helm extensions format from the k0s configuration. For more information about these fields, see the [k0s documentation](https://docs.k0sproject.io/stable/helm-charts/#example).
141145

142-
The `version` field is required. Failing to specify a chart version will cause problems for upgrades.
146+
### Limitation
147+
148+
If a Helm extension is removed from the Embedded Cluster Config, the associated Helm chart is not removed from the cluster.
149+
150+
### Requirements
151+
152+
* The `version` field is required. Failing to specify a chart version will cause problems for upgrades.
143153

144-
**Example**:
154+
* If you need to install multiple charts in a particular order, set the `order` field to a value greater than or equal to 10. Numbers below 10 are reserved for use by Embedded Cluster to deploy things like a storage provider and the Admin Console. If an `order` is not provided, Helm extensions are installed with order 10.
155+
156+
### Example
145157

146158
```yaml
147159
apiVersion: embeddedcluster.replicated.com/v1beta1
@@ -176,23 +188,19 @@ spec:
176188
digest: ""
177189
```
178190

179-
:::note
180-
If an order is not provided, Helm extensions are installed with order 10. Numbers below 10 are reserved for use by embedded cluster to deploy things like a storage provider and the admin console. If you need to install multiple charts in a particular order, choose orders greater than or equal to 10.
181-
:::
182-
183-
## Unsupported Overrides
191+
## unsupportedOverrides
184192

185193
:::important
186194
This feature should be used with caution by advanced users who understand the risks and ramifications of changing the default configuration.
187195
:::
188196

189-
Unsupported overrides allow you to override embedded cluster's default configuration, including the k0s config and the Helm values for extensions like KOTS and OpenEBS. This should be used with caution because changes here are untested and can disrupt or break embedded clusters. Any issues that are caused by unsupported overrides are not supported.
197+
Unsupported overrides allow you to override Embedded Cluster's default configuration, including the k0s config and the Helm values for extensions like KOTS and OpenEBS. This should be used with caution because changes here are untested and can disrupt or break Embedded Clusters. Any issues that are caused by unsupported overrides are not supported.
190198

191-
While they should be used with caution, unsupported overrides are useful if you need to make changes that are not yet otherwise exposed by embedded cluster.
199+
While they should be used with caution, unsupported overrides are useful if you need to make changes that are not otherwise exposed by Embedded Cluster.
192200

193201
### Override the k0s Config
194202

195-
By default, embedded cluster uses a k0s config that is tested and known to work for embedded clusters. In some circumstances, you might want to change the k0s config.
203+
By default, Embedded Cluster uses a k0s config that is tested and known to work for Embedded Clusters. In some circumstances, you might want to change the k0s config.
196204

197205
For more information on the k0s config, see [Configuration options](https://docs.k0sproject.io/stable/configuration/#configuration-file-reference) in the k0s documentation.
198206

@@ -211,19 +219,27 @@ spec:
211219
service-node-port-range: 80-32767
212220
```
213221

214-
Overrides overwrite the corresponding fields in the k0s configuration. They are not merged into embedded cluster’s default configuration. When using overrides to override a list, for example, ensure that you include other elements in the list that embedded cluster includes by default.
222+
#### Limtiations
223+
224+
* The `spec.api` and `spec.storage` keys in the k0s config cannot be changed after installation. Whereas most keys in the k0s config apply to the whole cluster, these two keys are set for each node. Embedded Cluster cannot update these keys on each individual node during updates, so they cannot be changed after installation.
215225

216-
**Limitation:** The `spec.api` and `spec.storage` keys in the k0s config cannot be changed after installation. Whereas most keys in the k0s config apply to the whole cluster, these two keys are set for each node. Embedded Cluster cannot update these keys on each individual node during updates, so they cannot be changed after installation.
226+
* Overrides overwrite the corresponding fields in the k0s configuration. They are not merged into Embedded Cluster’s default configuration. When using overrides to override a list, for example, ensure that you include other elements in the list that Embedded Cluster includes by default.
217227

218228
### Override the Helm Values for Built-In Extensions
219229

220-
> Introduced in embedded cluster v1.2.0.
230+
Embedded Cluster deploys built-in extensions like KOTS and OpenEBS to provide capabilities like storage and application management. These extensions are deployed with Helm, and the Helm values for each can be modified if necessary.
231+
232+
To modify these values, you can use the `unsupportedOverrides.builtInExtensions` key of the Embedded Cluster Config. Each chart you want to modify is an item in the array. The `name` key identifies the Helm chart that you want to modify, and the `values` key is a string where you specify your modified Helm values. Your modified values are merged into the values used by Embedded Cluster.
221233

222-
Embedded cluster deploys built-in extensions like KOTS and OpenEBS to provide capabilities like storage and application management. These extensions are deployed with Helm, and the Helm values for each can be modified if necessary.
234+
The following are the built-in extensions available for modification:
223235

224-
To modify these values, you can use the `unsupportedOverrides.builtInExtensions` key of the embedded cluster config. Each chart you want to modify is an item in the array. The `name` key identifies the Helm chart that you want to modify, and the `values` key is a string where you specify your modified Helm values. Your modified values are merged into the values used by embedded cluster.
236+
- `openebs`
237+
- `admin-console`
238+
- `velero`
239+
- `embedded-cluster-operator`
240+
241+
#### Example
225242

226-
Example:
227243
```yaml
228244
apiVersion: embeddedcluster.replicated.com/v1beta1
229245
kind: Config
@@ -234,10 +250,3 @@ spec:
234250
values: |
235251
key: value
236252
```
237-
238-
The following are the built-in extensions available for modification:
239-
240-
- `openebs`
241-
- `admin-console`
242-
- `velero`
243-
- `embedded-cluster-operator`

docs/reference/template-functions-about.mdx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,20 @@ All functionality of the Go templating language, including if statements, loops,
1414

1515
### Supported File Types
1616

17-
You can use KOTS template functions in any Kubernetes manifest files for applications deployed by KOTS, such as:
17+
You can use KOTS template functions in Kubernetes manifest files for applications deployed by KOTS, such as:
1818
* Custom resources in the `kots.io` API group like Application, Config, or HelmChart
19-
:::note
20-
Not all fields in the Config custom resource support templating. For more information, see [Item Properties](/reference/custom-resource-config#item-properties) in _Config_.
21-
:::
2219
* Custom resources in other API groups like Preflight, SupportBundle, or Backup
2320
* Kubernetes objects like Deployments, Services, Secrets, or ConfigMaps
2421
* Kubernetes Operators
2522

23+
### Limitations
24+
25+
* Not all fields in the Config and Application custom resources support templating. For more information, see [Application](/reference/custom-resource-application) and [Item Properties](/reference/custom-resource-config#item-properties) in _Config_.
26+
27+
* Templating is not supported in the [Embedded Cluster Config](/reference/embedded-config) resource.
28+
29+
* KOTS template functions are not directly supported in Helm charts. For more information, see [Helm Charts](#helm-charts) below.
30+
2631
### Helm Charts
2732

2833
KOTS template functions are _not_ directly supported in Helm charts. However, the HelmChart custom resource provides a way to map values rendered by KOTS template functions to Helm chart values. This allows you to use KOTS template functions with Helm charts without making changes to those Helm charts.

docs/vendor/embedded-overview.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ Embedded Cluster has the following limitations:
5757

5858
* **Downgrading Kubernetes not supported**: Embedded Cluster does not support downgrading Kubernetes. The admin console will not prevent end-users from attempting to downgrade Kubernetes if a more recent version of your application specifies a previous Embedded Cluster version. You must ensure that you do not promote new versions with previous Embedded Cluster versions.
5959

60+
* **Templating not supported in Embedded Cluster Config**: The [Embedded Cluster Config](/reference/embedded-config) resource does not support the use of Go template functions, including [KOTS template functions](/reference/template-functions-about).
61+
6062
## Quick Start
6163

6264
You can use the following steps to get started quickly with Embedded Cluster. More detailed documentation is available below.

0 commit comments

Comments
 (0)