From 78760cfdf25f7bdd37806250408ed0049fc609bd Mon Sep 17 00:00:00 2001 From: iwilltry42 Date: Mon, 18 Jan 2021 16:52:14 +0100 Subject: [PATCH] add some documentation --- docs/usage/guides/registries.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/docs/usage/guides/registries.md b/docs/usage/guides/registries.md index 66c336a1..22da3ede 100644 --- a/docs/usage/guides/registries.md +++ b/docs/usage/guides/registries.md @@ -2,8 +2,11 @@ ## Registries configuration file -You can add registries by specifying them in a `registries.yaml` and mounting them at creation time: -`#!bash k3d cluster create mycluster --volume "/home/YOU/my-registries.yaml:/etc/rancher/k3s/registries.yaml"`. +You can add registries by specifying them in a `registries.yaml` and referencing it at creation time: +`#!bash k3d cluster create mycluster --registry-config "/home/YOU/my-registries.yaml"`. + +??? Tip "Pre v4.0.0 solution" + Before we added the `--registry-config` flag in k3d v4.0.0, you had to bind-mount the file to the correct location: `--volume "/home/YOU/my-registries.yaml:/etc/rancher/k3s/registries.yaml"` This file is a regular [k3s registries configuration file](https://rancher.com/docs/k3s/latest/en/installation/private-registry/), and looks like this: @@ -21,6 +24,27 @@ Note well there is an important limitation: **this configuration file will only This file can also be used for providing additional information necessary for accessing some registries, like [authentication](#authenticated-registries) and [certificates](#secure-registries). +### Registries Configuration File embedded in k3d's SimpleConfig + +If you're using a `SimpleConfig` file to configure your k3d cluster, you may as well embed the registries.yaml in there directly: + +```yaml +apiVersion: k3d.io/v1alpha1 +kind: Simple +name: test +servers: 1 +agents: 2 +registries: + create: true + config: | + mirrors: + "my.company.registry": + endpoint: + - http://my.company.registry:5000 +``` + +Here, the config for the k3d-managed registry, created by the `create: true` flag will be merged with the config specified under `config: |`. + ### Authenticated registries When using authenticated registries, we can add the _username_ and _password_ in a