From 4c1acae99ee66042e43a7ea85417651e05cdfd3b Mon Sep 17 00:00:00 2001 From: Paige Calvert Date: Thu, 27 Feb 2025 15:09:25 -0700 Subject: [PATCH 1/3] clarify how to use custom domain when rewriting images --- docs/vendor/helm-native-v2-using.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/vendor/helm-native-v2-using.md b/docs/vendor/helm-native-v2-using.md index d1bee82bbf..db61e7f709 100644 --- a/docs/vendor/helm-native-v2-using.md +++ b/docs/vendor/helm-native-v2-using.md @@ -19,7 +19,7 @@ To support Helm chart installations with the KOTS `kots.io/v1beta2` HelmChart cu ## Task 1: Rewrite Image Names {#rewrite-image-names} Configure the KOTS HelmChart custom resource `values` key so that KOTS rewrites the names for both private and public images in your Helm values during deployment. This allows images to be accessed at one of the following locations, depending on where they were pushed: -* The [Replicated proxy registry](private-images-about) (`proxy.replicated.com`) +* The [Replicated proxy registry](private-images-about) (`proxy.replicated.com` or your custom domain) * A public image registry * Your customer's local registry * The built-in registry used in Replicated Embedded Cluster or Replicated kURL installations in air-gapped environments @@ -39,11 +39,12 @@ You will use the following KOTS template functions to conditionally rewrite imag For any private images used by your application, configure the HelmChart custom resource so that image names are rewritten to either the Replicated proxy registry (for online installations) or to the local registry in the user's installation environment (for air gap installations or online installations where the user configured a local registry). -To rewrite image names to the location of the image in the proxy registry, use the format `proxy.replicated.com/proxy//`, where: +To rewrite image names to the location of the image in the proxy registry, use the format `/proxy//`, where: +* `` is `proxy.replicated.com` or your custom domain. For more information about configuring a custom domain for the proxy registry, see [Using Custom Domains](/vendor/custom-domains-using). * `` is the unique application slug in the Vendor Portal * `` is the path to the image in your registry -For example, if the private image is `quay.io/my-org/nginx:v1.0.1`, then the image name should be rewritten to `proxy.replicated.com/proxy/my-app-slug/quay.io/my-org/nginx:v1.0.1`. +For example, if the private image is `quay.io/my-org/nginx:v1.0.1` and no custom domain is used for the proxy registry, then the image name should be rewritten to `proxy.replicated.com/proxy/my-app-slug/quay.io/my-org/nginx:v1.0.1`. For more information, see the example below. @@ -63,10 +64,10 @@ spec: values: image: # If a registry is configured by the user or by Embedded Cluster/kURL, use that registry's hostname - # Else use proxy.replicated.com - registry: '{{repl HasLocalRegistry | ternary LocalRegistryHost "proxy.replicated.com" }}' + # Else use proxy.replicated.com or your custom proxy registry domain + registry: '{{repl HasLocalRegistry | ternary LocalRegistryHost "my.registry.io" }}' # If a registry is configured by the user or by Embedded Cluster/kURL, use that registry namespace - # Else use the image's namespace at proxy.replicated.com + # Else use the image's namespace at the proxy registry domain repository: '{{repl HasLocalRegistry | ternary LocalRegistryNamespace "proxy/my-app/quay.io/my-org" }}/nginx' tag: v1.0.1 ``` @@ -171,6 +172,7 @@ metadata: spec: values: image: + # Use proxy.replicated.com or your custom domain for the proxy registry registry: '{{repl HasLocalRegistry | ternary LocalRegistryHost "proxy.replicated.com" }}' repository: '{{repl HasLocalRegistry | ternary LocalRegistryNamespace "proxy/my-app/ecr.us-east-1.amazonaws.com/my-org" }}/api' pullSecrets: From ec2eba0d7002f6c40480e7a8eb8cc780ee355369 Mon Sep 17 00:00:00 2001 From: Paige Calvert Date: Thu, 27 Feb 2025 15:12:05 -0700 Subject: [PATCH 2/3] edits --- docs/vendor/helm-native-v2-using.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/vendor/helm-native-v2-using.md b/docs/vendor/helm-native-v2-using.md index db61e7f709..d46fc3e3af 100644 --- a/docs/vendor/helm-native-v2-using.md +++ b/docs/vendor/helm-native-v2-using.md @@ -171,9 +171,9 @@ metadata: name: samplechart spec: values: - image: - # Use proxy.replicated.com or your custom domain for the proxy registry + image: registry: '{{repl HasLocalRegistry | ternary LocalRegistryHost "proxy.replicated.com" }}' + # Note: Use proxy.replicated.com or your custom domain repository: '{{repl HasLocalRegistry | ternary LocalRegistryNamespace "proxy/my-app/ecr.us-east-1.amazonaws.com/my-org" }}/api' pullSecrets: - name: '{{repl ImagePullSecretName }}' From 4be1dd344ee590153cfb9568882bfa4f360f4343 Mon Sep 17 00:00:00 2001 From: Paige Calvert Date: Thu, 27 Feb 2025 15:27:39 -0700 Subject: [PATCH 3/3] edits based on review --- docs/vendor/helm-native-v2-using.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/vendor/helm-native-v2-using.md b/docs/vendor/helm-native-v2-using.md index d46fc3e3af..862701ecec 100644 --- a/docs/vendor/helm-native-v2-using.md +++ b/docs/vendor/helm-native-v2-using.md @@ -32,7 +32,7 @@ You will use the following KOTS template functions to conditionally rewrite imag
What is the registry namespace? - The registry namespace is the path between the registry and the image name. For example, `my.registry.com/namespace/image:tag`. + The registry namespace is the path between the registry and the image name. For example, `images.mycompany.com/namespace/image:tag`.
### Task 1a: Rewrite Private Image Names @@ -44,7 +44,7 @@ To rewrite image names to the location of the image in the proxy registry, use t * `` is the unique application slug in the Vendor Portal * `` is the path to the image in your registry -For example, if the private image is `quay.io/my-org/nginx:v1.0.1` and no custom domain is used for the proxy registry, then the image name should be rewritten to `proxy.replicated.com/proxy/my-app-slug/quay.io/my-org/nginx:v1.0.1`. +For example, if the private image is `quay.io/my-org/nginx:v1.0.1` and `images.mycompany.com` is the custom proxy registry domain, then the image name should be rewritten to `images.mycompany.com/proxy/my-app-slug/quay.io/my-org/nginx:v1.0.1`. For more information, see the example below. @@ -65,7 +65,7 @@ spec: image: # If a registry is configured by the user or by Embedded Cluster/kURL, use that registry's hostname # Else use proxy.replicated.com or your custom proxy registry domain - registry: '{{repl HasLocalRegistry | ternary LocalRegistryHost "my.registry.io" }}' + registry: '{{repl HasLocalRegistry | ternary LocalRegistryHost "images.mycompany.com" }}' # If a registry is configured by the user or by Embedded Cluster/kURL, use that registry namespace # Else use the image's namespace at the proxy registry domain repository: '{{repl HasLocalRegistry | ternary LocalRegistryNamespace "proxy/my-app/quay.io/my-org" }}/nginx' @@ -172,8 +172,8 @@ metadata: spec: values: image: - registry: '{{repl HasLocalRegistry | ternary LocalRegistryHost "proxy.replicated.com" }}' # Note: Use proxy.replicated.com or your custom domain + registry: '{{repl HasLocalRegistry | ternary LocalRegistryHost "proxy.replicated.com" }}' repository: '{{repl HasLocalRegistry | ternary LocalRegistryNamespace "proxy/my-app/ecr.us-east-1.amazonaws.com/my-org" }}/api' pullSecrets: - name: '{{repl ImagePullSecretName }}'