-
Notifications
You must be signed in to change notification settings - Fork 35
Add image template functions docs for EC v3 #3940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f082648
9908008
8f89004
6f6c2bf
aefdfb5
4a5dbf2
d93c1f2
122f35c
e8f65c1
f917f66
a2ad426
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| 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. | ||
| 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. | ||
|
|
||
| The proxy registry URL has the following format: `DOMAIN/proxy/APP_SLUG/UPSTREAM_REGISTRY/IMAGE_PATH` | ||
|
|
||
| The proxy registry URL has the following format: `DOMAIN/proxy/APP_SLUG/EXTERNAL_REGISTRY_IMAGE_URL` | ||
|
|
||
| Where: | ||
| * `DOMAIN` is either `proxy.replicated.com` or your custom domain. | ||
| * `APP_SLUG` is the unique slug of your application. | ||
| * `EXTERNAL_REGISTRY_IMAGE_URL` is the path to the private image on your external registry. | ||
| - `DOMAIN` is either `proxy.replicated.com` or your custom domain | ||
| - `APP_SLUG` is the unique slug of your application | ||
| - `UPSTREAM_REGISTRY/IMAGE_PATH` is the full upstream image path. For example, `ghcr.io/my-org/my-image` or `docker.io/bitnami/postgresql`. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated this guidance to use "upstream" terminology instead of "external" based on Salah's language in |
||
|
|
||
| **Example:** | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ This topic describes Replicated template functions, including information about | |
|
|
||
| ## Overview | ||
|
|
||
| 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. | ||
| 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). | ||
|
|
||
| <UseCases/> | ||
|
|
||
|
|
@@ -26,16 +26,6 @@ You can use Replicated template functions in Kubernetes manifest files for appli | |
| * Kubernetes objects like Deployments, Services, Secrets, or ConfigMaps | ||
| * Kubernetes Operators | ||
|
|
||
| ### Limitations | ||
|
|
||
| * 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_. | ||
|
|
||
| * Templating is not supported in the [Embedded Cluster Config](/embedded-cluster/v3/embedded-config) resource. | ||
|
|
||
| * Replicated template functions are not directly supported in Helm charts. For more information, see [Helm Charts](#helm-charts) below. | ||
|
|
||
| ### Helm charts | ||
|
|
||
| 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. | ||
|
|
||
| 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 | |
|
|
||
| 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). | ||
|
|
||
| ### Limitations | ||
|
|
||
| * 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_. | ||
|
|
||
| * Templating is not supported in the [Embedded Cluster Config](/embedded-cluster/v3/embedded-config) resource. | ||
|
|
||
| * Replicated template functions are not directly supported in Helm charts. For more information, see [Helm Charts](#helm-charts) on this page. | ||
|
|
||
| * Embedded Cluster v3 does not support the following template functions: | ||
| * HasLocalRegistry | ||
| * LocalRegistryAddress | ||
| * LocalRegistryHost | ||
| * LocalRegistryNamespace | ||
| * LocalImageName | ||
|
|
||
| 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). | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^ Added this limitation to call out that the image temp funcs are not supported in ec v3 installations |
||
| ## Syntax {#syntax} | ||
|
|
||
| The Replicated template function syntax supports the following functionally equivalent delimiters: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -194,6 +194,10 @@ Returns true if the configuration option value is not equal to the supplied valu | |
|
|
||
| ## LocalRegistryAddress | ||
|
|
||
| :::note | ||
| 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). | ||
| ::: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added these notes to each of the unsupported image templates functions |
||
|
|
||
| ```go | ||
| func LocalRegistryAddress() string | ||
| ``` | ||
|
|
@@ -203,6 +207,10 @@ This will always return everything before the image name and tag. | |
|
|
||
| ## LocalRegistryHost | ||
|
|
||
| :::note | ||
| 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). | ||
| ::: | ||
|
|
||
| ```go | ||
| func LocalRegistryHost() string | ||
| ``` | ||
|
|
@@ -236,6 +244,10 @@ For more information, see [Set Helm Values with KOTS](/vendor/helm-optional-valu | |
|
|
||
| ## LocalRegistryNamespace | ||
|
|
||
| :::note | ||
| 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). | ||
| ::: | ||
|
|
||
| ```go | ||
| func LocalRegistryNamespace() string | ||
| ``` | ||
|
|
@@ -267,6 +279,10 @@ For more information, see [Set Helm Values with KOTS](/vendor/helm-optional-valu | |
|
|
||
| ## LocalImageName | ||
|
|
||
| :::note | ||
| 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). | ||
| ::: | ||
|
|
||
| ```go | ||
| func LocalImageName(remoteImageName string) string | ||
| ``` | ||
|
|
@@ -346,6 +362,10 @@ spec: | |
|
|
||
| ## HasLocalRegistry | ||
|
|
||
| :::note | ||
| 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). | ||
| ::: | ||
|
|
||
| ```go | ||
| func HasLocalRegistry() bool | ||
| ``` | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,9 +11,29 @@ This topic describes how to use the Replicated proxy registry for applications d | |
|
|
||
| ## Configure your application to use the proxy registry | ||
|
|
||
| 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. | ||
| 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. | ||
|
|
||
| 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. | ||
| 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. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [vale] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| ### Embedded Cluster v3 (Beta) {#configure-v3} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added these new steps for ECv3. The main difference is that you don't need to inject the image pull secret anymore since EC v3 automatically configures the cluster to authenticate to the proxy registry for all pods |
||
|
|
||
| Follow these steps to use the proxy registry with applications installed with [Embedded Cluster v3 (Beta)](/embedded-cluster/v3/embedded-overview). | ||
|
|
||
| Embedded Cluster v3 configures the cluster to automatically authenticate to the Replicated proxy registry for all pods. | ||
|
|
||
| For installations Embedded Cluster v3, | ||
|
|
||
| 1. <StepCreds/> | ||
|
|
||
| 1. <StepCustomDomain/> | ||
|
|
||
| 1. <RewriteHelmValues/> | ||
|
|
||
| 1. Create a new release with your changes. Promote the release to a development channel. See [Managing Releases with Vendor Portal](releases-creating-releases). | ||
|
|
||
| 1. Install in a development environment to test your changes. See [Online installation with Embedded Cluster](/embedded-cluster/v3/installing-embedded). | ||
|
|
||
| ### Embedded Cluster v2, KOTS, or kURL | ||
|
|
||
| To configure your application to use the proxy registry for installations with a Replicated installer: | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 [vale] reported by reviewdog 🐶
[Replicated.SentenceLength] Try to keep your sentence length to 26 words or fewer.