Skip to content

Commit a337b01

Browse files
addyessCopilot
andauthored
docs: ensure its clear one should deploy workers with the containerd relation (#2071)
* docs: ensure its clear one should deploy workers with the containerd relation * Update docs/canonicalk8s/charm/howto/custom-registry.md Co-authored-by: Copilot <[email protected]> * Integration suggestions Signed-off-by: Adam Dyess <[email protected]> * How-to documentation should be more prescriptive and less choose-your-own-way * Integrate review comments --------- Signed-off-by: Adam Dyess <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 96f75b5 commit a337b01

File tree

1 file changed

+31
-10
lines changed

1 file changed

+31
-10
lines changed

docs/canonicalk8s/charm/howto/custom-registry.md

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
The `k8s` charm can be configured to use a custom container registry for its
44
container images. This is particularly useful if you have a private registry or
55
operate in an air-gapped environment where you need to pull images from a
6-
different registry. This guide will walk you through the steps to set up `k8s`
7-
charm to pull images from a custom registry.
6+
different registry.
87

98
## Prerequisites
109

@@ -13,14 +12,15 @@ charm to pull images from a custom registry.
1312
- Access to a custom container registry from the cluster (e.g., docker registry
1413
or Harbor).
1514

16-
## Adding a custom registry
15+
## Add a custom registry
1716

1817
To configure the charm to use a custom registry, you need to set the
19-
`containerd-custom-registries` configuration option. This options allows
20-
the charm to configure `containerd` to pull images from registries that require
21-
authentication. This configuration option should be a JSON-formatted array of
22-
credential objects. For more details on the `containerd-custom-registries`
23-
option, refer to the [charm configurations] documentation.
18+
`containerd-custom-registries` configuration option of the control-plane
19+
application. This options allows the charm to configure `containerd` to pull
20+
images from registries that require authentication. This configuration option
21+
should be a JSON-formatted array of credential objects. For more details on the
22+
`containerd-custom-registries` option, refer to the [charm configurations]
23+
documentation.
2424

2525
For example, to configure the charm to use a custom registry at
2626
`myregistry.example.com:5000` with the username `myuser` and password
@@ -44,7 +44,7 @@ progress by running:
4444
juju status --watch 2s
4545
```
4646

47-
### Adding a registry mirror
47+
### Add a registry mirror
4848

4949
To configure the charm to use a registry mirror, you need to add to the
5050
`containerd-custom-registries` configuration option.
@@ -65,7 +65,7 @@ juju config k8s containerd-custom-registries='[{
6565
}]'
6666
```
6767

68-
### Adding a nested path registry mirror
68+
### Add a nested path registry mirror
6969

7070
To configure the charm to use a registry mirror where the path to the images is
7171
nested deeper, you need to add set the `override_path` flag to true
@@ -88,6 +88,26 @@ juju config k8s containerd-custom-registries='[{
8888
}]'
8989
```
9090

91+
## Share with all workers in the cluster
92+
93+
If the model contains Kubernetes workers, ensure the `containerd` relation
94+
is integrated with each worker application. This configures containerd with the
95+
same custom configuration, not only to every control-plane node, but to each
96+
worker node as well.
97+
98+
> **Note:** This assumes worker applications are already deployed and integrated
99+
> in the cluster. If you haven't yet deployed workers, refer to the how-to on
100+
> [adding kubernetes workers][] for complete deployment instructions
101+
102+
```bash
103+
for WORKER_APP in $(
104+
juju status --format json |
105+
jq -r '.applications | to_entries[] | select(.value["charm-name"]=="k8s-worker") | .key'
106+
); do
107+
juju integrate k8s "${WORKER_APP}:containerd"
108+
done
109+
```
110+
91111
## Verify the configuration
92112

93113
Once the charm is configured and active, verify that the custom registry is
@@ -119,3 +139,4 @@ myregistry.example.com:5000/nginx:latest->true
119139
<!-- LINKS -->
120140

121141
[charm configurations]: https://charmhub.io/k8s/configurations
142+
[adding kubernetes workers]: ./install/custom-workers.md

0 commit comments

Comments
 (0)