|
| 1 | +--- |
| 2 | +sidebar_label: "Registry Connect" |
| 3 | +title: "Registry Connect" |
| 4 | +description: "Registry Connect pack in Palette Edge." |
| 5 | +hide_table_of_contents: true |
| 6 | +type: "registry" |
| 7 | +sidebar_class_name: "hide-from-sidebar" |
| 8 | +tags: ["packs", "registry", "edge"] |
| 9 | +--- |
| 10 | + |
| 11 | +<RedirectPackPage packName="registry-connect" /> |
| 12 | + |
| 13 | +### Use External Image Registries |
| 14 | + |
| 15 | +You can use external registries with the Registry Connect pack. |
| 16 | + |
| 17 | +Modify the `imageReplacementRules` parameter to rewrite container image references to an external registry. |
| 18 | + |
| 19 | +#### Rewrite All Image References |
| 20 | + |
| 21 | +Use the `all` keyword to add a prefix to all image references. The following example shows how to use this keyword in your pack's YAML file. |
| 22 | + |
| 23 | +```yaml |
| 24 | +pack: |
| 25 | + ... |
| 26 | +charts: |
| 27 | + registry-connect: |
| 28 | + config: |
| 29 | + ... |
| 30 | + registry: |
| 31 | + imageReplacementRules: | |
| 32 | + "all": "example.registry.com/internal-images" |
| 33 | +``` |
| 34 | +
|
| 35 | +In this case, the prefix `example.registry.com/internal-images` is prepended to all image references. For example, |
| 36 | +`us-docker.pkg.dev/palette-images/packs/flannel/0.27.0/cni-plugins:v1.6.2` |
| 37 | +is rewritten as |
| 38 | +`example.registry.com/internal-images/us-docker.pkg.dev/palette-images/packs/flannel/0.27.0/cni-plugins:v1.6.2`. |
| 39 | + |
| 40 | +#### Rewrite Image References for Specific Registries |
| 41 | + |
| 42 | +You can rewrite image references by replacing one or more source registry prefixes with external registry prefixes. |
| 43 | + |
| 44 | +The following example shows how to rewrite image references to use `example.registry.com/internal-images`. |
| 45 | + |
| 46 | + |
| 47 | +```yaml |
| 48 | +pack: |
| 49 | + namespace: "cluster-{{ .spectro.system.cluster.uid }}" |
| 50 | + content: |
| 51 | + layer: core |
| 52 | + images: |
| 53 | + - image: us-docker.pkg.dev/palette-images/third-party/ubuntu-util:22.04 |
| 54 | +
|
| 55 | +charts: |
| 56 | + registry-connect: |
| 57 | + config: |
| 58 | + content: |
| 59 | + sync: |
| 60 | + enable: false |
| 61 | + registry: |
| 62 | + imageReplacementRules: | |
| 63 | + "us-east1-docker.pkg.dev/spectro-images/daily": "example.registry.com/internal-images" |
| 64 | + "us-docker.pkg.dev/palette-images": "example.registry.com/internal-images" |
| 65 | + "grc.io/spectro-dev-public": "example.registry.com/internal-images" |
| 66 | + "grc.io/spectro-images-public": "example.registry.com/internal-images" |
| 67 | + credentials: |
| 68 | + - domain: 10.10.10.10 |
| 69 | + username: admin # you may provide value with 'username' key or you may use 'usernameRef' to refer |
| 70 | + password: "" |
| 71 | +... |
| 72 | +``` |
| 73 | + |
| 74 | +Based on the defined rules, an image originally referenced as `us-docker.pkg.dev/palette-images/packs/flannel/0.27.0/cni-plugins:v1.6.2` is rewritten to `example.registry.com/internal-images/packs/flannel/0.27.0/cni-plugins:v1.6.2`. |
| 75 | +This replacement occurs whenever the image reference matches one of the specified source registry prefixes. |
0 commit comments