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
@@ -2,102 +2,77 @@ import KotsHelmCrDescription from "../partials/helm/_kots-helm-cr-description.md
2
2
3
3
# Support Installations with HelmChart v2
4
4
5
-
This topic describes how to configure your application to support installations with the Replicated HelmChart custom resource version `kots.io/v1beta2`.
5
+
This topic describes how to configure your application to support installations with the Replicated HelmChart custom resource version `kots.io/v1beta2` (HelmChart v2).
6
6
7
7
## Prerequisite
8
8
9
-
Update your Helm chart values to proxy your application images through the Replicated proxy registry. See [Configure Your Application to Use the Proxy Registry](/vendor/private-images-kots) in _Use the Proxy Registry with Replicated Installers_.
9
+
For each Helm chart in your release, update all image references in your Helm values to use the domain of the Replicated proxy registry. See [Configure Your Application to Use the Proxy Registry](/vendor/private-images-kots) in _Use the Proxy Registry with Replicated Installers_.
10
10
11
11
## Configure HelmChart v2
12
12
13
-
1. Configure the `builder` key. This ensures that all of the required and optional images for your application are available to users to push their own local registry. See [`builder`](/reference/custom-resource-helmchart-v2#builder) in _HelmChart v2_.
13
+
To support installations with HelmChart v2:
14
14
15
-
1.Configure the `optionalValues` key so that image references in your Helm values are correctly rewritten to the user's local registry.To support the use of local image registries in air gap and online installations. Local image registries are required for installations in air-gapped environments with limited or no outbound internet access. Also, users in online environments can optionally use a local registry. For more information about how users configure a local image registry, see [Configuring Local Image Registries](/enterprise/image-registry-settings).
15
+
1.In the HelmChart v2 custom resource, configure the `builder` key. This ensures that all the required and optional images for your application are available for users to push to their own local image registry. See [`builder`](/reference/custom-resource-helmchart-v2#builder) in _HelmChart v2_.
16
16
17
-
You will use the KOTS [HasLocalRegistry](/reference/template-functions-config-context#haslocalregistry) template function to create the conditional statement. You will use the KOTS [LocalRegistryHost](/reference/template-functions-config-context#localregistryhost) and [LocalRegistryNamespace](/reference/template-functions-config-context#localregistrynamespace) template functions to inject the hostname and namespace for the user's registry in the image reference(s).
17
+
1. Configure the HelmChart v2 [`optionalValues`](/reference/custom-resource-helmchart-v2#optionalValues) key so that KOTS conditionally rewrites any application image references in your Helm values if the user configured a local image registry.
18
18
19
-
<details>
20
-
<summary>What is the registry namespace?</summary>
21
-
22
-
The registry namespace is the path between the registry and the image name. For example, `images.yourcompany.com/namespace/image:tag`.
23
-
</details>
24
-
25
-
Do the following:
26
-
27
-
1. Rewrite each of the application image references in your Helm values.
28
-
29
-
**Example:**
30
-
31
-
```yaml
32
-
# KOTS HelmChart custom resource
33
-
34
-
apiVersion: kots.io/v1beta2
35
-
kind: HelmChart
36
-
metadata:
37
-
name: samplechart
38
-
spec:
39
-
optionalValues:
40
-
# Define the conditional statement in the when field
1. To avoid errors caused by reaching the Docker Hub rate limit, add the `<app-slug>-kotsadm-dockerhub` pull secret to a field in the `values` key of the HelmChart custom resource, along with a matching field in your Helm chart `values.yaml` file. For more information about Docker Hub rate limiting, see [Understanding Docker Hub rate limiting](https://www.docker.com/increase-rate-limits) on the Docker website.
19
+
You will use the KOTS [LocalRegistryHost](/reference/template-functions-config-context#localregistryhost) and [LocalRegistryNamespace](/reference/template-functions-config-context#localregistrynamespace) template functions to inject the hostname and namespace for the user's registry in the image reference(s). You will use the KOTS [HasLocalRegistry](/reference/template-functions-config-context#haslocalregistry) template function to create a conditional statement that evaluates if a local registry is configured.
74
20
75
21
<details>
76
-
<summary>Why?</summary>
22
+
<summary>What is the registry namespace?</summary>
77
23
78
-
Docker Hub enforces rate limits for Anonymous and Free users. To avoid errors caused by reaching the rate limit, your users can run the `kots docker ensure-secret` command, which creates an `<app-slug>-kotsadm-dockerhub` secret for pulling Docker Hub images and applies the secret to Kubernetes manifests that have images. For more information, see [Avoiding Docker Hub Rate Limits](/enterprise/image-registry-rate-limits).
24
+
The registry namespace is the path between the registry and the image name. For example, `images.yourcompany.com/namespace/image:tag`.
25
+
</details>
79
26
80
-
If you are deploying a Helm chart with Docker Hub images that could be rate limited, to support the use of the `kots docker ensure-secret` command, any Pod definitions in your Helm chart templates that reference the rate-limited image must be updated to access the `<app-slug>-kotsadm-dockerhub` pull secret, where `<app-slug>` is your application slug. For more information, see [Get the Application Slug](/vendor/vendor-portal-manage-app#slug).
27
+
**Example:**
81
28
82
-
During installation, KOTS sets the value of the matching field in the `values.yaml` file with the `<app-slug>-kotsadm-dockerhub` pull secret, and any Helm chart templates that access the value are updated.
83
-
</details>
29
+
```yaml
30
+
# KOTS HelmChart custom resource
84
31
85
-
**Example:**
32
+
apiVersion: kots.io/v1beta2
33
+
kind: HelmChart
34
+
metadata:
35
+
name: samplechart
36
+
spec:
37
+
optionalValues:
38
+
# Create a conditional statement in the `when` field
The following Helm chart `values.yaml` file includes `image.registry`, `image.repository`, and `image.pullSecrets` for a rate-limited Docker Hub image:
47
+
1. In the [`optionalValues`](/reference/custom-resource-helmchart-v2#optionalValues) key, use the same method as in the previous step to update the Replicated SDK image reference.
88
48
89
-
```yaml
90
-
# Helm chart values.yaml file
49
+
**Example:**
91
50
92
-
image:
93
-
registry: docker.io
94
-
repository: my-org/example-docker-hub-image
95
-
pullSecrets: []
96
-
```
51
+
```yaml
52
+
# KOTS HelmChart custom resource
53
+
apiVersion: kots.io/v1beta2
54
+
kind: HelmChart
55
+
metadata:
56
+
name: samplechart
57
+
spec:
58
+
optionalValues:
59
+
# Conditionally rewrite SDK image when a local registry
1. To avoid errors caused by reaching the Docker Hub rate limit, do the following:
97
72
98
-
The following HelmChart custom resource includes `spec.values.image.registry`, `spec.values.image.repository`, and `spec.values.image.pullSecrets`, which correspond to those in the Helm chart `values.yaml` file above.
73
+
1. In the HelmChart v2 [`values`](/reference/custom-resource-helmchart-v2#values) key, add a new value with the KOTS `APP_SLUG-kotsadm-dockerhub` pull secret, where `APP_SLUG` is your unique application slug.
99
74
100
-
The `spec.values.image.pullSecrets` array lists the `<app-slug>-kotsadm-dockerhub` pull secret, where the slug for the application is `example-app-slug`:
75
+
**Example:**
101
76
102
77
```yaml
103
78
# kots.io/v1beta2 HelmChart custom resource
@@ -110,27 +85,56 @@ Update your Helm chart values to proxy your application images through the Repli
110
85
values:
111
86
image:
112
87
registry: docker.io
113
-
repository: my-org/example-docker-hub-image
88
+
repository: your-org/example-docker-hub-image
89
+
# Add a new pullSecrets array with the <app-slug>-kotsadm-dockerhub pull secret
114
90
pullSecrets:
115
-
- name: example-app-slug-kotsadm-dockerhub
91
+
- name: your-app-slug-kotsadm-dockerhub
116
92
```
93
+
<details>
94
+
<summary>How does the `kotsadm-dockerhub` pull secret avoid Docker Hub rate limiting errors?</summary>
117
95
118
-
During installation, KOTS adds the `example-app-slug-kotsadm-dockerhub` secret to the `image.pullSecrets` array in the Helm chart `values.yaml` file. Any templates in the Helm chart that access `image.pullSecrets` are updated to use `example-app-slug-kotsadm-dockerhub`:
96
+
Docker Hub enforces rate limits for Anonymous and Free users. For more information, see [Understanding Docker Hub rate limiting](https://www.docker.com/increase-rate-limits) on the Docker website.
97
+
98
+
To avoid errors caused by reaching the rate limit, your users can run the `kots docker ensure-secret` command, which creates an `<app-slug>-kotsadm-dockerhub` secret for pulling Docker Hub images and applies the secret to Kubernetes manifests that have images. For more information, see [Avoiding Docker Hub Rate Limits](/enterprise/image-registry-rate-limits).
If you are deploying a Helm chart with Docker Hub images that could be rate limited, to support the use of the `kots docker ensure-secret` command, any Pod definitions in your Helm chart templates that reference the rate-limited image must be updated to access the `<app-slug>-kotsadm-dockerhub` pull secret.
101
+
102
+
During installation, KOTS sets the value of the matching field in the `values.yaml` file with the `<app-slug>-kotsadm-dockerhub` pull secret, and any Helm chart templates that access the value are updated.
103
+
</details>
104
+
105
+
1. Ensure that there is a matching value in your Helm chart `values.yaml`.
106
+
107
+
**Example:**
108
+
109
+
```yaml
110
+
# Helm chart values.yaml file
111
+
112
+
image:
113
+
registry: docker.io
114
+
repository: your-org/your-docker-hub-image
115
+
# include the new pullSecrets array
116
+
pullSecrets: []
117
+
```
118
+
119
+
1. In your Helm chart templates, update any Pod definitions that reference rate-limited Docker Hub images to access the Helm value with the Docker Hub pull secret.
# the kotsadm-dockerhub pull secret is access from values and added to this array
133
+
{{- with .Values.image.pullSecrets }}
134
+
imagePullSecrets:
135
+
{{- toYaml . | nindent 2 }}
136
+
{{- end }}
137
+
```
134
138
135
139
1. (KOTS Existing Cluster and kURL Installations Only) To support backup and restore with snapshots, configure the HelmChart v2 [optionalValues](/reference/custom-resource-helmchart-v2#optionalvalues) key so that the required `kots.io/backup: velero` and `kots.io/app-slug: APP_SLUG` labels are added to all resources that you want to be included in backups.
136
140
@@ -170,9 +174,7 @@ Update your Helm chart values to proxy your application images through the Repli
The `kots.io/v1beta2` HelmChart custom resource has the following differences from `kots.io/v1beta1`:
178
180
@@ -204,8 +206,8 @@ The `kots.io/v1beta2` HelmChart custom resource has the following differences fr
204
206
</tr>
205
207
</table>
206
208
207
-
### Migrate Existing KOTS Installations to HelmChart v2
209
+
## Next Step: Migrate Existing Installations to HelmChart v2
208
210
209
-
Existing KOTS installations can be migrated to use the KOTS HelmChart v2 method, without having to reinstall the application.
211
+
Existing installations can be migrated to use the KOTS HelmChart v2 method, without having to reinstall the application.
210
212
211
213
There are different steps for migrating to HelmChart v2 depending on the application deployment method used previously. For more information, see [Migrating Existing Installations to HelmChart v2](helm-v2-migrate).
0 commit comments