Skip to content

Commit 4d82786

Browse files
authored
Merge pull request #3940 from replicatedhq/docs/ec-image-template-functions
Add image template functions docs for EC v3
2 parents 7f03a1a + a2ad426 commit 4d82786

File tree

9 files changed

+495
-47
lines changed

9 files changed

+495
-47
lines changed

docs/partials/proxy-service/_step-inject-pull-secret.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
In the HelmChart v2 custom resource, configure the `values` key to inject the Replicated image pull secret into your Helm values. This provides authentication for the proxy registry. Use the KOTS [ImagePullSecretName](/reference/template-functions-config-context#imagepullsecretname) template function to get the pull secret name.
1+
In the HelmChart v2 custom resource, configure the `values` key to inject the Replicated image pull secret into your Helm values. This provides authentication for the proxy registry. Use the [ImagePullSecretName](/reference/template-functions-config-context#imagepullsecretname) template function to get the pull secret name.
22

33
<details>
44
<summary>What is the Replicated image pull secret?</summary>
@@ -34,7 +34,7 @@ In the HelmChart v2 custom resource, configure the `values` key to inject the Re
3434
containers:
3535
- name: nginx
3636
image: {{ .Values.image.registry }}/{{ .Values.image.repository }}
37-
# Access the value to provide the KOTS pull secret
37+
# Access the value to provide the pull secret
3838
{{- with .Values.image.pullSecrets }}
3939
imagePullSecrets:
4040
{{- toYaml . | nindent 2 }}

docs/partials/proxy-service/_step-rewrite-helm-values.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
For each image reference in your Helm chart values file, set the image repository URL to the location of the image in the proxy registry.
1+
For each Helm chart used by your application, in the Helm chart's `values.yaml` file, update all references to private or third-party images to use the Replicated proxy registry domain.
2+
3+
The proxy registry URL has the following format: `DOMAIN/proxy/APP_SLUG/UPSTREAM_REGISTRY/IMAGE_PATH`
24

3-
The proxy registry URL has the following format: `DOMAIN/proxy/APP_SLUG/EXTERNAL_REGISTRY_IMAGE_URL`
4-
55
Where:
6-
* `DOMAIN` is either `proxy.replicated.com` or your custom domain.
7-
* `APP_SLUG` is the unique slug of your application.
8-
* `EXTERNAL_REGISTRY_IMAGE_URL` is the path to the private image on your external registry.
6+
- `DOMAIN` is either `proxy.replicated.com` or your custom domain
7+
- `APP_SLUG` is the unique slug of your application
8+
- `UPSTREAM_REGISTRY/IMAGE_PATH` is the full upstream image path. For example, `ghcr.io/my-org/my-image` or `docker.io/bitnami/postgresql`.
99

1010
**Example:**
1111

docs/reference/template-functions-about.mdx

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This topic describes Replicated template functions, including information about
1212

1313
## Overview
1414

15-
For Kubernetes manifest files for applications deployed by a Replicated installer (Embedded Cluster, KOTS, kURL), Replicated provides a set of custom template functions based on the Go text/template library.
15+
Replicated provides a set of custom template functions based on the Go text/template library. You can use the Replicated template functions in Kubernetes manifest files for applications deployed by a Replicated installer (Embedded Cluster, KOTS, kURL).
1616

1717
<UseCases/>
1818

@@ -26,16 +26,6 @@ You can use Replicated template functions in Kubernetes manifest files for appli
2626
* Kubernetes objects like Deployments, Services, Secrets, or ConfigMaps
2727
* Kubernetes Operators
2828

29-
### Limitations
30-
31-
* 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_.
32-
33-
* Templating is not supported in the [Embedded Cluster Config](/embedded-cluster/v3/embedded-config) resource.
34-
35-
* Replicated template functions are not directly supported in Helm charts. For more information, see [Helm Charts](#helm-charts) below.
36-
37-
### Helm charts
38-
3929
Replicated template functions are _not_ directly supported in Helm charts. However, the HelmChart custom resource provides a way to map values rendered by Replicated template functions to Helm chart values. This allows you to use Replicated template functions with Helm charts without making changes to those Helm charts.
4030

4131
For information about how to map values from the HelmChart custom resource to Helm chart `values.yaml` files, see [Setting Helm Chart Values with KOTS](/vendor/helm-optional-value-keys).
@@ -46,6 +36,23 @@ During application installation and upgrade, KOTS templates all Kubernetes manif
4636

4737
For the [Config](/reference/custom-resource-config) custom resource, KOTS templates each item separately so that config items can be used in templates for other items. For examples of this, see [Using Conditional Statements in Configuration Fields](/vendor/config-screen-conditional) and [Template Function Examples](/reference/template-functions-examples).
4838

39+
### Limitations
40+
41+
* 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_.
42+
43+
* Templating is not supported in the [Embedded Cluster Config](/embedded-cluster/v3/embedded-config) resource.
44+
45+
* Replicated template functions are not directly supported in Helm charts. For more information, see [Helm Charts](#helm-charts) on this page.
46+
47+
* Embedded Cluster v3 does not support the following template functions:
48+
* HasLocalRegistry
49+
* LocalRegistryAddress
50+
* LocalRegistryHost
51+
* LocalRegistryNamespace
52+
* LocalImageName
53+
54+
These template functions are typically used to conditionally rewrite image references in air gap installations to reference the local image registry. For Embedded Cluster v3 installations, use the ReplicatedImageName, ReplicatedImageName, and ReplicatedImageName template functions instead. For more information, see [Template Functions for Embedded Cluster (Beta)](/embedded-cluster/v3/template-functions).
55+
4956
## Syntax {#syntax}
5057

5158
The Replicated template function syntax supports the following functionally equivalent delimiters:

docs/reference/template-functions-config-context.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ Returns true if the configuration option value is not equal to the supplied valu
194194
195195
## LocalRegistryAddress
196196
197+
:::note
198+
The LocalRegistryAddress template function is not supported for installations with Embedded Cluster v3. See [Template Functions for Embedded Cluster (Beta)](/embedded-cluster/v3/template-functions).
199+
:::
200+
197201
```go
198202
func LocalRegistryAddress() string
199203
```
@@ -203,6 +207,10 @@ This will always return everything before the image name and tag.
203207

204208
## LocalRegistryHost
205209

210+
:::note
211+
The LocalRegistryHost template function is not supported for installations with Embedded Cluster v3. See [Template Functions for Embedded Cluster (Beta)](/embedded-cluster/v3/template-functions).
212+
:::
213+
206214
```go
207215
func LocalRegistryHost() string
208216
```
@@ -236,6 +244,10 @@ For more information, see [Set Helm Values with KOTS](/vendor/helm-optional-valu
236244

237245
## LocalRegistryNamespace
238246

247+
:::note
248+
The LocalRegistryNamespace template function is not supported for installations with Embedded Cluster v3. See [Template Functions for Embedded Cluster (Beta)](/embedded-cluster/v3/template-functions).
249+
:::
250+
239251
```go
240252
func LocalRegistryNamespace() string
241253
```
@@ -267,6 +279,10 @@ For more information, see [Set Helm Values with KOTS](/vendor/helm-optional-valu
267279

268280
## LocalImageName
269281

282+
:::note
283+
The LocalImageName template function is not supported for installations with Embedded Cluster v3. See [Template Functions for Embedded Cluster (Beta)](/embedded-cluster/v3/template-functions).
284+
:::
285+
270286
```go
271287
func LocalImageName(remoteImageName string) string
272288
```
@@ -346,6 +362,10 @@ spec:
346362
347363
## HasLocalRegistry
348364
365+
:::note
366+
The HasLocalRegistry template function is not supported for installations with Embedded Cluster v3. See [Template Functions for Embedded Cluster (Beta)](/embedded-cluster/v3/template-functions).
367+
:::
368+
349369
```go
350370
func HasLocalRegistry() bool
351371
```

docs/vendor/private-images-kots.mdx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,29 @@ This topic describes how to use the Replicated proxy registry for applications d
1111

1212
## Configure your application to use the proxy registry
1313

14-
These steps assume that you package your application with Helm and that you install with the KOTS [HelmChart v2](/reference/custom-resource-helmchart-v2) custom resource.
14+
These steps assume that you package your application with Helm and that you install with the [HelmChart v2](/reference/custom-resource-helmchart-v2) custom resource.
1515

16-
If you are installing with the HelmChart v1 custom resource, or if your application is not packaged with Helm, there are different steps for configuring your application to use the proxy registry. See [Configure Other Application Types](#other) below.
16+
If you are installing with the HelmChart v1 custom resource, or if your application is not packaged with Helm, there are different steps for configuring your application to use the proxy registry. See [Configure other application types](#other) below.
17+
18+
### Embedded Cluster v3 (Beta) {#configure-v3}
19+
20+
Follow these steps to use the proxy registry with applications installed with [Embedded Cluster v3 (Beta)](/embedded-cluster/v3/embedded-overview).
21+
22+
Embedded Cluster v3 configures the cluster to automatically authenticate to the Replicated proxy registry for all pods.
23+
24+
For installations Embedded Cluster v3,
25+
26+
1. <StepCreds/>
27+
28+
1. <StepCustomDomain/>
29+
30+
1. <RewriteHelmValues/>
31+
32+
1. Create a new release with your changes. Promote the release to a development channel. See [Managing Releases with Vendor Portal](releases-creating-releases).
33+
34+
1. Install in a development environment to test your changes. See [Online installation with Embedded Cluster](/embedded-cluster/v3/installing-embedded).
35+
36+
### Embedded Cluster v2, KOTS, or kURL
1737

1838
To configure your application to use the proxy registry for installations with a Replicated installer:
1939

0 commit comments

Comments
 (0)