Skip to content

Commit 6d0a770

Browse files
authored
Merge pull request #3141 from replicatedhq/121666
Update steps for using the proxy registry in Helm installs
2 parents 042cbbe + 5740a9a commit 6d0a770

File tree

3 files changed

+67
-96
lines changed

3 files changed

+67
-96
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
Provide read-only credentials for the external private registry in your Replicated account. This allows Replicated to access the images through the proxy registry. See [Add Credentials for an External Registry](packaging-private-images#add-credentials-for-an-external-registry) in _Connecting to an External Registry_.
1+
In the Vendor Portal, go to **Images > Add external registry** and provide read-only credentials for your registry. This allows Replicated to access the images through the proxy registry. See [Add Credentials for an External Registry](packaging-private-images#add-credentials-for-an-external-registry) in _Connecting to an External Registry_.
2+
3+
<img alt="Link a new registry in the Vendor Portal" src="../images/add-external-registry.png" width="500"/>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(Optional) Add a custom domain for the proxy registry instead of `proxy.replicated.com`. See [Use Custom Domains](custom-domains-using).
1+
(Recommended) Go to **Custom Domains > Add custom domain** and add a custom domain for the proxy registry. See [Use Custom Domains](custom-domains-using).

docs/vendor/helm-image-registry.mdx

Lines changed: 63 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -7,127 +7,96 @@ This topic describes how to use the Replicated proxy registry to proxy images fo
77

88
## Overview
99

10-
With the Replicated proxy registry, each customer's unique license can grant proxy access to images in an external private registry. To enable the proxy registry for Helm installations, you must create a Secret with `type: kubernetes.io/dockerconfigjson` to authenticate with the proxy registry.
10+
With the Replicated proxy registry, each customer's unique license can grant proxy access to images in an external private registry.
1111

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 required pull secret.
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.
1313

14-
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.
14+
## Pull Private Images Through the Proxy Registry in Helm Installations
1515

16-
## Enable the Proxy Registry
17-
18-
This section describes how to enable the proxy registry for applications deployed with Helm, including how to use the `global.replicated.dockerconfigjson` field that is injected during application deployment to create the required pull secret.
19-
20-
To enable the proxy registry:
16+
To use the Replicated proxy registry for applications installed with Helm:
2117

2218
1. <StepCreds/>
2319

2420
1. <StepCustomDomain/>
2521

26-
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:
22+
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`.
23+
24+
The proxy registry URL has the following format: `DOMAIN/proxy/APP_SLUG/EXTERNAL_REGISTRY_IMAGE_URL`
25+
26+
Where:
27+
* `DOMAIN` is either `proxy.replicated.com` or your custom domain.
28+
* `APP_SLUG` is the unique slug of your application.
29+
* `EXTERNAL_REGISTRY_IMAGE_URL` is the path to the private image on your external registry.
30+
31+
**Example:**
32+
33+
```yaml
34+
# values.yaml
35+
api:
36+
image:
37+
# proxy.registry.com or your custom domain
38+
registry: ghcr.io
39+
repository: proxy/app/ghcr.io/cloudnative-pg/cloudnative-pg
40+
tag: catalog-1.24.0
41+
```
42+
43+
1. Ensure that any references to the image in your Helm chart access the field from your values file.
44+
45+
**Example**:
46+
47+
```yaml
48+
apiVersion: v1
49+
kind: Pod
50+
spec:
51+
containers:
52+
- name: api
53+
# Access the registry, repository, and tag fields from the values file
54+
image: {{ .Values.images.api.registry }}/{{ .Values.images.api.repository }}:{{ .Values.images.api.tag }}
55+
```
56+
57+
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.
58+
59+
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.
60+
61+
:::note
62+
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.
63+
:::
2764

2865
```yaml
29-
# /templates/replicated-pull-secret.yaml
66+
# templates/replicated-pull-secret.yaml
3067
3168
{{ if .Values.global.replicated.dockerconfigjson }}
3269
apiVersion: v1
3370
kind: Secret
3471
metadata:
72+
# Note: Do not use "replicated" for the name of the pull secret
3573
name: replicated-pull-secret
3674
type: kubernetes.io/dockerconfigjson
3775
data:
3876
.dockerconfigjson: {{ .Values.global.replicated.dockerconfigjson }}
3977
{{ end }}
4078
```
79+
4180

42-
:::note
43-
If you use the Replicated SDK, do not use `replicated` for the name of the image pull secret because the SDK automatically creates a Secret named `replicated`. Using the same name causes an error.
44-
:::
45-
46-
1. Ensure that you have a field in your Helm chart values file for your image repository URL, and that any references to the image in your Helm chart access the field from your values file.
47-
48-
**Example**:
49-
50-
```yaml
51-
# values.yaml
52-
...
53-
dockerconfigjson: '{{ .Values.global.replicated.dockerconfigjson }}'
54-
images:
55-
myapp:
56-
# Add image URL in the values file
57-
apiImageRepository: quay.io/my-org/api
58-
apiImageTag: v1.0.1
59-
```
60-
```yaml
61-
# /templates/deployment.yaml
62-
63-
apiVersion: apps/v1
64-
kind: Deployment
65-
metadata:
66-
name: example
67-
spec:
68-
template:
69-
spec:
70-
containers:
71-
- name: api
72-
# Access the apiImageRepository field from the values file
73-
image: {{ .Values.images.myapp.apiImageRepository }}:{{ .Values.images.myapp.apiImageTag }}
74-
```
75-
76-
1. In your Helm chart templates, add the image pull secret that you created to any manifests that reference the private image:
77-
78-
```yaml
79-
# /templates/example.yaml
80-
...
81-
{{ if .Values.global.replicated.dockerconfigjson }}
82-
imagePullSecrets:
83-
- name: replicated-pull-secret
84-
{{ end }}
85-
```
81+
1. Add the image pull secret that you created to any manifests that reference the image:
8682

8783
**Example:**
8884

8985
```yaml
90-
# /templates/deployment.yaml
91-
...
92-
image: "{{ .Values.images.myapp.apiImageRepository }}:{{ .Values.images.myapp.apiImageTag }}"
93-
{{ if .Values.global.replicated.dockerconfigjson }}
94-
imagePullSecrets:
95-
- name: replicated-pull-secret
96-
{{ end }}
97-
name: myapp
98-
ports:
99-
- containerPort: 3000
100-
name: http
86+
apiVersion: v1
87+
kind: Pod
88+
spec:
89+
containers:
90+
- name: api
91+
# Access the registry, repository, and tag fields from the values file
92+
image: {{ .Values.images.api.registry }}/{{ .Values.images.api.repository }}:{{ .Values.images.api.tag }}
93+
# Add the pull secret
94+
{{ if .Values.global.replicated.dockerconfigjson }}
95+
imagePullSecrets:
96+
- name: replicated-pull-secret
97+
{{ end }}
10198
```
10299

103100
1. Package your Helm chart and add it to a release. Promote the release to a development channel. See [Managing Releases with Vendor Portal](releases-creating-releases).
104101

105-
1. Install the chart in a development environment to test your changes:
106-
107-
1. Create a local `values.yaml` file to override the default external registry image URL with the URL for the image on `proxy.replicated.com`.
108-
109-
The proxy registry URL has the following format: `proxy.replicated.com/proxy/APP_SLUG/EXTERNAL_REGISTRY_IMAGE_URL`
110-
111-
Where:
112-
* `APP_SLUG` is the slug of your Replicated application.
113-
* `EXTERNAL_REGISTRY_IMAGE_URL` is the path to the private image on your external registry.
114-
115-
**Example**
116-
```yaml
117-
# A local values.yaml file
118-
...
119-
images:
120-
myapp:
121-
apiImageRepository: proxy.replicated.com/proxy/my-app/quay.io/my-org/api
122-
apiImageTag: v1.0.1
123-
124-
```
125-
126-
:::note
127-
If you configured a custom domain for the proxy registry, use the custom domain instead of `proxy.replicated.com`. For more information, see [Use Custom Domains](custom-domains-using).
128-
:::
129-
130-
1. Log in to the Replicated registry and install the chart, passing the local `values.yaml` file you created with the `--values` flag. See [Install with Helm](install-with-helm).
131-
132-
133-
102+
1. Install in a development environment to test your changes. See [Install with Helm](/vendor/install-with-helm).

0 commit comments

Comments
 (0)