Skip to content

Commit 87eb215

Browse files
authored
Merge pull request #3366 from replicatedhq/modify-image-refs-in-values-file
Edit docs on using the proxy registry
2 parents e9172b2 + d710e96 commit 87eb215

File tree

7 files changed

+78
-76
lines changed

7 files changed

+78
-76
lines changed

docs/partials/helm/_helm-install-prereqs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
* The customer used to install must have the **Existing Cluster (Helm CLI)** install type enabled. If installing into an air gap environment, additionally enable the **Helm CLI Air Gap Instructions** option for the customer. For more information about enabling install types for customers in the Vendor Portal, see [Manage Install Types for a License](licenses-install-types).
44

5-
* To ensure that the Replicated proxy registry can be used to grant proxy access to your application images during Helm installations, you must create an image pull secret for the proxy registry and add it to your Helm chart. To do so, follow the steps in [Using the Proxy Registry with Helm Installations](/vendor/helm-image-registry).
5+
* To ensure that the Replicated proxy registry can be used to grant proxy access to your application images during Helm installations, you must create an image pull secret for the proxy registry and add it to your Helm chart. To do so, follow the steps in [Use the Proxy Registry with Helm CLI Installations](/vendor/helm-image-registry).
66

77
* Declare the SDK as a dependency in your Helm chart. For more information, see [Install the SDK as a Subchart](replicated-sdk-installing#install-the-sdk-as-a-subchart) in _Installing the Replicated SDK_.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
If you are deploying Pods to namespaces other than the application namespace, add the namespace to the `additionalNamespaces` attribute of the KOTS Application custom resource. This ensures that KOTS can provision the `imagePullSecret` in the namespace to allow the Pod to pull the image. For instructions, see [Define Additional Namespaces](operator-defining-additional-namespaces).

docs/vendor/helm-image-registry.mdx

Lines changed: 13 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,32 @@
11
import StepCreds from "../partials/proxy-service/_step-creds.mdx"
22
import StepCustomDomain from "../partials/proxy-service/_step-custom-domain.mdx"
3+
import RewriteHelmValues from "../partials/proxy-service/_step-rewrite-helm-values.mdx"
34

4-
# Use the Proxy Registry with Helm Installations
5+
# Use the Proxy Registry with Helm CLI Installations
56

6-
This topic describes how to use the Replicated proxy registry to proxy images for installations with the Helm CLI. For more information about the proxy registry, see [About the Replicated Proxy Registry](private-images-about).
7+
This topic describes how to configure your application to use the Replicated proxy registry with Helm CLI installations. For more information about the proxy registry, see [About the Replicated Proxy Registry](private-images-about). For more information about installing applications distributed with Replicated using Helm, see [About Helm Installations with Replicated](/vendor/helm-install-overview).
78

89
## Overview
910

10-
With the Replicated proxy registry, each customer's unique license can grant proxy access to images in an external private registry.
11+
During Helm CLI installations with Replicated, after customers provide their unique license ID, a `global.replicated.dockerconfigjson` field that contains a base64 encoded Docker configuration file is automatically injected in the Helm chart values.
1112

12-
During Helm installations, after customers provide their license ID, a `global.replicated.dockerconfigjson` field that contains a base64 encoded Docker configuration file is automatically injected in the Helm chart values. You can use this `global.replicated.dockerconfigjson` field to create the pull secret required to authenticate with the proxy registry, allowing you to use the proxy registry for images in your Helm charts.
13+
You can use this `global.replicated.dockerconfigjson` field to create the pull secret required to authenticate with the proxy registry. For more information about how Kubernetes uses the `kubernetes.io/dockerconfigjson` Secret type to provide authentication for a private registry, see [Pull an Image from a Private Registry](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) in the Kubernetes documentation.
1314

14-
Additionally, if you include the Replicated SDK as a dependency in your Helm chart, the image used by the Replicated SDK is automatically proxied through the proxy registry.
15+
:::note
16+
For Helm charts that include the Replicated SDK as a dependency, the image used by the Replicated SDK is automatically proxied through the proxy registry. No additional configuration is required. For more information, see [About the Replicated SDK](/vendor/replicated-sdk-overview).
17+
:::
1518

16-
## Pull Private Images Through the Proxy Registry in Helm Installations
19+
## Configure Your Application to Use the Proxy Registry
1720

18-
To use the Replicated proxy registry for applications installed with Helm:
21+
To configure your application to use the proxy registry with Helm CLI installations:
1922

2023
1. <StepCreds/>
2124

2225
1. <StepCustomDomain/>
2326

24-
1. In your Helm chart values file, set your image repository URL to the location of the image on the proxy registry. If you added a custom domain, use your custom domain. Otherwise, use `proxy.replicated.com`.
27+
1. <RewriteHelmValues/>
2528

26-
The proxy registry URL has the following format: `DOMAIN/proxy/APP_SLUG/EXTERNAL_REGISTRY_IMAGE_URL`
27-
28-
Where:
29-
* `DOMAIN` is either `proxy.replicated.com` or your custom domain.
30-
* `APP_SLUG` is the unique slug of your application.
31-
* `EXTERNAL_REGISTRY_IMAGE_URL` is the path to the private image on your external registry.
32-
33-
**Example:**
34-
35-
```yaml
36-
# values.yaml
37-
api:
38-
image:
39-
# proxy.replicated.com or your custom domain
40-
registry: proxy.replicated.com
41-
repository: proxy/your-app/ghcr.io/cloudnative-pg/cloudnative-pg
42-
tag: catalog-1.24.0
43-
```
44-
45-
1. Ensure that any references to the image in your Helm chart access the field from your values file.
46-
47-
**Example**:
48-
49-
```yaml
50-
apiVersion: v1
51-
kind: Pod
52-
spec:
53-
containers:
54-
- name: api
55-
# Access the registry, repository, and tag fields from the values file
56-
image: {{ .Values.images.api.registry }}/{{ .Values.images.api.repository }}:{{ .Values.images.api.tag }}
57-
```
58-
59-
1. In your Helm chart templates, create a Kubernetes Secret to evaluate if the `global.replicated.dockerconfigjson` value is set and then write the rendered value into a Secret on the cluster, as shown below.
60-
61-
This Secret is used to authenticate with the proxy registry. For information about how Kubernetes uses the `kubernetes.io/dockerconfigjson` Secret type to provide authentication for a private registry, see [Pull an Image from a Private Registry](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) in the Kubernetes documentation.
29+
1. In your Helm chart templates, add a YAML file that evaluates if the `global.replicated.dockerconfigjson` value is set, and then writes the rendered value into a Secret on the cluster, as shown below.
6230

6331
:::note
6432
Do not use `replicated` for the name of the image pull secret because the Replicated SDK automatically creates a Secret named `replicated`. Using the same name causes an error.
@@ -79,8 +47,7 @@ To use the Replicated proxy registry for applications installed with Helm:
7947
{{ end }}
8048
```
8149

82-
83-
1. Add the image pull secret that you created to any manifests that reference the image:
50+
1. Add the image pull secret that you created to any manifests that reference the image.
8451

8552
**Example:**
8653

docs/vendor/packaging-public-images.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ For more information about the Replicated proxy registry, see [About the Replica
66

77
## Pull Public Images Through the Replicated Proxy Registry
88

9-
You can use the Replicated proxy registry to pull both public and private images. Using the Replicated proxy registry for public images can simplify network access requirements for your customers, as they only need to whitelist a single domain (either `proxy.replicated.com` or your custom domain) instead of multiple registry domains. These are authenticated requests to avoid the proxy from hitting rate limits and preventing pulls. For more information about how to reference these in your values, see [Use the Proxy Registry with Helm Installations](/vendor/helm-image-registry).
9+
You can use the Replicated proxy registry to pull both public and private images. Using the Replicated proxy registry for public images can simplify network access requirements for your customers, as they only need to whitelist a single domain (either `proxy.replicated.com` or your custom domain) instead of multiple registry domains. These are authenticated requests to avoid the proxy from hitting rate limits and preventing pulls. For more information about how to reference these in your values, see [Use the Proxy Registry with Helm CLI Installations](/vendor/helm-image-registry).
1010

1111
> [!IMPORTANT]
1212
> For public images, you need to first configure registry credentials.

docs/vendor/private-images-about.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ The following diagram demonstrates how the proxy registry pulls images from your
1919
The proxy registry requires read-only credentials to your private registry to access your application images. See [Connect to an External Registry](/vendor/packaging-private-images).
2020

2121
After connecting your registry, the steps the enable the proxy registry vary depending on your application deployment method. For more information, see:
22-
* [Using the Proxy Registry with KOTS Installations](/vendor/private-images-kots)
23-
* [Using the Proxy Registry with Helm Installations](/vendor/helm-image-registry)
22+
* [Use the Proxy Registry with Replicated Installers](/vendor/private-images-kots)
23+
* [Use the Proxy Registry with Helm CLI Installations](/vendor/helm-image-registry)
2424

2525
## About Allowing Pull-Through Access of Public Images
2626

docs/vendor/private-images-kots.mdx

Lines changed: 59 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,67 @@
11
import Deprecated from "../partials/helm/_replicated-deprecated.mdx"
22
import StepCreds from "../partials/proxy-service/_step-creds.mdx"
33
import StepCustomDomain from "../partials/proxy-service/_step-custom-domain.mdx"
4+
import RewriteHelmValues from "../partials/proxy-service/_step-rewrite-helm-values.mdx"
5+
import AdditionalNs from "../partials/proxy-service/_step-additional-ns.mdx"
6+
import InjectPullSecret from "../partials/proxy-service/_step-inject-pull-secret.mdx"
47

5-
# Use the Proxy Registry with KOTS Installations
8+
# Use the Proxy Registry with Replicated Installers
69

7-
This topic describes how to use the Replicated proxy registry with applications deployed with Replicated KOTS.
10+
This topic describes how to use the Replicated proxy registry for applications deployed with Replicated installers (Embedded Cluster, KOTS existing cluster, or kURL). For more information about the proxy registry, see [About the Replicated Proxy Registry](private-images-about).
811

9-
## Overview
12+
## Configure Your Application to Use the Proxy Registry
1013

11-
Replicated KOTS automatically creates the required image pull secret for accessing the Replicated proxy registry during application deployment. When possible, KOTS also automatically rewrites image names in the application manifests to the location of the image at `proxy.replicated.com` or your custom domain.
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.
1215

13-
### Image Pull Secret
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.
1417

15-
During application deployment, KOTS automatically creates an `imagePullSecret` with `type: kubernetes.io/dockerconfigjson` that is based on the customer license. This secret is used to authenticate with the proxy registry and grant proxy access to private images.
18+
To configure your application to use the proxy registry for installations with a Replicated installer:
1619

17-
For information about how Kubernetes uses the `kubernetes.io/dockerconfigjson` Secret type to authenticate to a private image registry, see [Pull an Image from a Private Registry](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) in the Kubernetes documentation.
20+
1. <StepCreds/>
21+
22+
1. <StepCustomDomain/>
23+
24+
1. <RewriteHelmValues/>
25+
26+
1. <InjectPullSecret/>
27+
28+
1. Repeat steps 3 and 4 for each Helm chart used by your application.
29+
30+
1. <AdditionalNs/>
1831

19-
### Image Location Patching (Standard Manifests and HelmChart v1)
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).
2033

21-
For applications packaged with standard Kubernetes manifests (or Helm charts deployed with the [HelmChart v1](/reference/custom-resource-helmchart) custom resource), KOTS automatically patches image names to the location of the image at at `proxy.replicated.com` or your custom domain during deployment. If KOTS receives a 401 response when attempting to load image manifests using the image reference from the PodSpec, it assumes that this is a private image that must be proxied through the proxy registry.
34+
1. Install in a development environment to test your changes.
35+
36+
## Configure Other Application Types {#other}
37+
38+
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.
39+
40+
### HelmChart v1 or Standard Manifests
41+
42+
:::note
43+
<Deprecated/>
44+
:::
45+
46+
To use the proxy registry with HelmChart v1 or applications packaged with standard manifests:
47+
48+
1. <StepCreds/>
49+
50+
1. <StepCustomDomain/>
51+
52+
1. <AdditionalNs/>
53+
54+
1. Create a new release with your changes. Promote the release to a development channel. See [Managing Releases with Vendor Portal](releases-creating-releases).
55+
56+
1. Install in a development environment to test your changes.
57+
58+
For applications packed with Kubernetes manifests and for Helm charts deployed with the [HelmChart v1](/reference/custom-resource-helmchart) custom resource, KOTS automatically rewrites image names and injects image pull secrets during deployment for these application types. No additional configuration is required to rewrite image names.
59+
60+
<details>
61+
62+
<summary>How does KOTS patch image names?</summary>
63+
64+
KOTS automatically patches image names to the location of the image at at `proxy.replicated.com` or your custom domain during deployment. If KOTS receives a 401 response when attempting to load image manifests using the image reference from the PodSpec, it assumes that this is a private image that must be proxied through the proxy registry.
2265

2366
KOTS uses Kustomize to patch the `midstream/kustomization.yaml` file to change the image name during deployment to reference the proxy registry. For example, a PodSpec for a Deployment references a private image hosted at `quay.io/my-org/api:v1.0.1`:
2467

@@ -47,29 +90,20 @@ images:
4790
- name: quay.io/my-org/api:v1.0.1
4891
newName: proxy.replicated.com/proxy/my-kots-app/quay.io/my-org/api
4992
```
93+
</details>
5094

51-
## Enable the Proxy Registry
52-
53-
This section describes how to enable the proxy registry for applications deployed with KOTS, including how to ensure that image names are rewritten and that the required image pull secret is provided.
95+
### Kubernetes Operators
5496

55-
To enable the proxy registry:
97+
To use the proxy registry with applications packaged as Kubernetes Operators:
5698

5799
1. <StepCreds/>
58100

59101
1. <StepCustomDomain/>
60102

61-
1. Rewrite images names to the location of the image at `proxy.replicated.com` or your custom domain. Also, ensure that the correct image pull secret is provided for all private images. The steps required to configure image names and add the image pull secret vary depending on your application type:
62-
63-
* **HelmChart v2**: For Helm charts deployed with the[ HelmChart v2](/reference/custom-resource-helmchart-v2) custom resource, configure the HelmChart v2 custom resource to dynamically update image names in your Helm chart and to inject the image pull secret that is automatically created by KOTS. For instructions, see [Configure the HelmChart Custom Resource v2](/vendor/helm-native-v2-using).
64-
65-
* **Standard Manifests or HelmChart v1**: For standard manifest-based applications or Helm charts deployed with the [HelmChart v1](/reference/custom-resource-helmchart) custom resource, no additional configuration is required. KOTS automatically rewrites image names and injects image pull secrets during deployment for these application types.
66-
67-
:::note
68-
<Deprecated/>
69-
:::
103+
1. <AdditionalNs/>
70104

71-
* **Kubernetes Operators**: For applications packaged with Kubernetes Operators, KOTS cannot modify pods that are created at runtime by the Operator. To support the use of private images in all environments, the Operator code should use KOTS functionality to determine the image name and image pull secrets for all pods when they are created. For instructions, see [Reference Images](/vendor/operator-referencing-images) in the _Packaging Kubernetes Operators_ section.
105+
1. For applications packaged with Kubernetes Operators, KOTS cannot modify pods that are created at runtime by the Operator. To support the use of private images in all environments, the Operator code should use KOTS functionality to determine the image name and image pull secrets for all pods when they are created. For instructions, see [Reference Images](/vendor/operator-referencing-images) in the _Packaging Kubernetes Operators_ section.
72106

73-
1. If you are deploying Pods to namespaces other than the application namespace, add the namespace to the `additionalNamespaces` attribute of the KOTS Application custom resource. This ensures that KOTS can provision the `imagePullSecret` in the namespace to allow the Pod to pull the image. For instructions, see [Define Additional Namespaces](operator-defining-additional-namespaces).
107+
1. Create a new release with your changes. Promote the release to a development channel. See [Managing Releases with Vendor Portal](releases-creating-releases).
74108

75-
1. (Optional) Add a custom domain for the proxy registry instead of `proxy.replicated.com`. See [Use Custom Domains](custom-domains-using).
109+
1. Install in a development environment to test your changes.

docs/vendor/replicated-onboarding.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ Before you test Helm installations for your application, you can complete the [D
458458

459459
To support and test Helm installations:
460460

461-
1. Follow the steps in [Using the Proxy Registry with Helm Installations](/vendor/helm-image-registry) to authenticate with the Replicated proxy registry by creating a Secret with `type: kubernetes.io/dockerconfigjson` in your Helm chart.
461+
1. Follow the steps in [Use the Proxy Registry with Helm CLI Installations](/vendor/helm-image-registry) to authenticate with the Replicated proxy registry by creating a Secret with `type: kubernetes.io/dockerconfigjson` in your Helm chart.
462462

463463
1. Update dependencies and package the chart as a `.tgz` file:
464464

0 commit comments

Comments
 (0)