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/vendor/enterprise-portal-configure.mdx
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,6 +122,12 @@ To customize the pre- and post-install instructions for your application:
122
122
123
123
1. Click **Save changes**.
124
124
125
+
## Exclude Certain Images from Helm CLI Install Instructions
126
+
127
+
You can use the `kots.io/installer-only` annotation to exclude the images for an entire Helm chart or for one or more resoures in a Helm chart's templates from the Helm CLI installation instructions displayed in the Enterprise Portal. This annotation is useful for charts or resources that are required for deployments with a Replicated installer (KOTS, Embedded Cluster, kURL) but should not be visible or deployed when customers install with the Helm CLI.
128
+
129
+
For more information, see [`kots.io/installer-only` Annotation](/vendor/packaging-include-resources#installer-only) in _Conditionally Include or Exclude Resources_.
Copy file name to clipboardExpand all lines: docs/vendor/packaging-include-resources.md
+78-19Lines changed: 78 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,18 @@
1
-
# Conditionally Including or Excluding Resources
1
+
# Conditionally Include or Exclude Resources
2
2
3
-
This topic describes how to include or exclude optional application resources based on one or more conditional statements. The information in this topic applies to Helm chart- and standard manifest-based applications.
3
+
This topic describes how to use Replicated `kots.io` annotations to explicitly include or exclude application resources from deployments based on one or more conditions.
4
4
5
5
## Overview
6
6
7
-
Software vendors often need a way to conditionally deploy resources for an application depending on users' configuration choices. For example, a common use case is giving the user the choice to use an external database or an embedded database. In this scenario, when a user chooses to use their own external database, it is not desirable to deploy the embedded database resources.
7
+
Software vendors often need a way to conditionally deploy one or more application resources. One common use case is giving the user the choice to use an external database or an embedded database. In this scenario, when a user chooses to use their own external database, it is not desirable to deploy the embedded database resources.
8
8
9
-
There are different options for creating conditional statements to include or exclude resources based on the application type (Helm chart- or standard manifest-based) and the installation method (Replicated KOTS or Helm CLI).
9
+
Another common use case is needing to explicitly include or exclude a resource from a customer deployment depending on if they install with the Helm CLI or with a Replicated installer. For example, some vendors provide additional services when the user deploys with a Replicated installer like Embedded Cluster, but do not want those services included when users deploy with the Helm CLI.
10
10
11
-
### About Replicated Template Functions
12
-
13
-
For applications deployed with KOTS, Replicated template functions are available for creating the conditional statements that control which optional resources are deployed for a given user. Replicated template functions can be used in standard manifest files such as Replicated custom resources or Kubernetes resources like StatefulSets, Secrets, and Services.
14
-
15
-
For example, the Replicated ConfigOptionEquals template functions returns true if the specified configuration option value is equal to a supplied value. This is useful for creating conditional statements that include or exclude a resource based on a user's application configuration choices.
16
-
17
-
For more information about the available Replicated template functions, see [About Template Functions](/reference/template-functions-about).
11
+
For applications distributed with Replicated, there are options for explicitly including and excluding entire Helm charts, resources within a Helm chart's templates, and resources defined by standalone Kubernetes manifests.
18
12
19
13
## Include or Exclude Helm Charts
20
14
21
-
This section describes methods for including or excluding Helm charts from your application deployment.
15
+
This section describes methods for including or excluding Helm charts and resources within a chart's templates.
22
16
23
17
### Helm Optional Dependencies
24
18
@@ -28,9 +22,9 @@ For more information about working with dependencies and defining optional depen
28
22
29
23
### HelmChart `exclude` Field
30
24
31
-
For Helm chart-based applications installed with KOTS, you can configure KOTS to exclude certain Helm charts from deployment using the HelmChart custom resource [`exclude`](/reference/custom-resource-helmchart#exclude) field. When the `exclude` field is set to a conditional statement, KOTS excludes the chart if the condition evaluates to `true`.
25
+
For Helm chart applications installed with a Replicated installer (Embedded Cluster, KOTS, kURL), you can exclude certain Helm charts from deployment using the HelmChart custom resource [`exclude`](/reference/custom-resource-helmchart#exclude) field. When the `exclude` field is set to a conditional statement, the chart is excluded if the condition evaluates to `true`.
32
26
33
-
The following example uses the `exclude` field and the ConfigOptionEquals template function to exclude a postgresql Helm chart when the `external_postgres` option is selected on the Replicated Admin Console **Config** page:
27
+
The following example uses the `exclude` field and the Replicated [ConfigOptionEquals](/reference/template-functions-config-context#configoptionequals) template function to exclude a postgresql Helm chart when the `external_postgres` option is selected on the Replicated Admin Console **Config** page:
You can use the `kots.io/installer-only` annotation to prevent an entire Helm chart or one or more resoures in a Helm chart's templates from being deployed in installations with the Helm CLI. Charts or resources with `kots.io/installer-only: "true"` are deployed _only_ when installing with a Replicated installer (Embedded Cluster, KOTS, and kURL).
45
+
46
+
The `kots.io/installer-only` annotation does the following:
47
+
- Excludes the chart (or the resource in a chart's templates) from the Helm CLI installation and update instructions in the Enterprise Portal and Vendor Portal. For more information about how users can view these instructions in the Enterprise Portal, see [View Insall and Update Instructions](/vendor/enterprise-portal-use#view-install-and-update-instructions) in _Log In To and Use the Enterprise Portal_.
48
+
- Excludes the chart (or the resource in a chart's templates) from Security Center reports for Helm CLI installations. For more information about the Security Center, see [About the Security Center (Alpha)](/vendor/security-center-about).
49
+
50
+
This annotation is useful for charts that are required for Replicated installer-based deployments but should not be visible or deployed when customers install with the Helm CLI.
51
+
52
+
:::note
53
+
Any Kubernetes resources in your releases that are not part of a Helm chart are never included in Helm CLI installations. You do not need to add this annotation to standalone manifests.
54
+
:::
55
+
56
+
#### Exclude an Entire Helm Chart from Helm CLI Installations
57
+
58
+
You can add `kots.io/installer-only` to a Replicated [HelmChart](/reference/custom-resource-helmchart) custom resource to prevent the associated Helm chart from being deployed in Helm CLI installations.
59
+
60
+
**Example:**
61
+
62
+
```yaml
63
+
apiVersion: kots.io/v1beta2
64
+
kind: HelmChart
65
+
metadata:
66
+
name: installers-only-chart
67
+
annotations:
68
+
kots.io/installer-only: "true"
69
+
spec:
70
+
chart:
71
+
name: installers-only-chart
72
+
chartVersion: 1.0.0
73
+
```
74
+
75
+
:::note
76
+
HelmChart custom resources are never deployed by Helm CLI. The annotation controls whether the chart they reference is included in Helm CLI installation and update instructions.
77
+
:::
78
+
79
+
#### Exclude Resources Inside a Chart's Templates from Helm CLI Installations
80
+
81
+
You can add `kots.io/installer-only` to a Kubernetes resource in a Helm chart's templates directory to prevent the resource from being deployed in Helm CLI installations.
82
+
83
+
**Example:**
84
+
85
+
The following example shows a Kubernetes Job inside a Helm chart's templates that should only run during Replicated installer deployments:
For standard manifest-based applications installed with KOTS, you can use the `kots.io/exclude` or `kots.io/when` annotations to include or exclude resources based on a conditional statement.
109
+
You can use the `kots.io/exclude` or `kots.io/when` annotations to include or exclude standalone Kubernetes manifests that are not part of a Helm chart. By default, if neither `kots.io/exclude` nor `kots.io/when` is present on a resource, the resource is included.
51
110
52
-
By default, if neither `kots.io/exclude` nor `kots.io/when` is present on a resource, the resource is included.
111
+
These annotations accept a boolean value. To create a conditional statement that evaluates to true or false, you can use Replicated template functions. For more information about working with Replicated template functions, see [About Template Functions](/reference/template-functions-about).
53
112
54
113
### Requirements
55
114
@@ -63,7 +122,7 @@ The `kots.io/exclude` and `kots.io/when` annotations have the following requirem
63
122
64
123
When the `kots.io/exclude: '<bool>'` annotation is present on a resource and evaluates to true, the resource is excluded from the deployment.
65
124
66
-
The following example uses the `kots.io/exclude` annotation and the ConfigOptionEquals template function to exclude the postgresql `StatefulSet` when an `install_postgres` checkbox on the Admin Console **Config** page is disabled:
125
+
The following example uses the `kots.io/exclude` annotation and the [ConfigOptionEquals](/reference/template-functions-config-context#configoptionequals) template function to exclude the postgresql `StatefulSet` when an `install_postgres` checkbox on the Admin Console **Config** page is disabled:
67
126
68
127
```yaml
69
128
apiVersion: apps/v1
@@ -96,7 +155,7 @@ spec:
96
155
97
156
When the `kots.io/when: '<bool>'` annotation is present on a resource and evaluates to true, the resource is included in the deployment.
98
157
99
-
The following example uses the `kots.io/when` annotation and the ConfigOptionEquals template function to include the postgresql `StatefulSet` resource when the `install_postgres` checkbox on the Admin Console **Config** page is enabled:
158
+
The following example uses the `kots.io/when` annotation and the [ConfigOptionEquals](/reference/template-functions-config-context#configoptionequals) template function to include the postgresql `StatefulSet` resource when the `install_postgres` checkbox on the Admin Console **Config** page is enabled:
0 commit comments