-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: global image registry mirror variable
- Loading branch information
Showing
19 changed files
with
389 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
+++ | ||
title = "Global Image Registry Mirror" | ||
+++ | ||
|
||
Add containerd image registry mirror configuration to all Nodes in the cluster. | ||
|
||
When the `globalImageRegistryMirror` variable is set, `files` with configurations for | ||
[Containerd default mirror](https://github.com/containerd/containerd/blob/main/docs/hosts.md#setup-default-mirror-for-all-registries) will be added. | ||
|
||
This customization will be available when the | ||
[provider-specific cluster configuration patch]({{< ref "..">}}) is included in the `ClusterClass`. | ||
|
||
## Example | ||
|
||
To provide image registry mirror with CA certificate, specify the following configuration: | ||
|
||
If your registry mirror requires self signed CA certifate, create a Kubernetes Secret with keys for `ca.crt`: | ||
|
||
```shell | ||
kubectl create secret generic my-mirror-ca-cert-secret \ | ||
--from-file=ca.crt=registry-ca.crt | ||
``` | ||
|
||
```yaml | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Cluster | ||
metadata: | ||
name: <NAME> | ||
spec: | ||
topology: | ||
variables: | ||
- name: clusterConfig | ||
value: | ||
globalImageRegistryMirror: | ||
url: https://my-mirror.io | ||
credentials: | ||
secretRef: | ||
name: my-mirror-ca-cert-secret | ||
``` | ||
Applying this configuration will result in following new files on the | ||
`KubeadmControlPlaneTemplate` and `KubeadmConfigTemplate` | ||
|
||
- `/etc/containerd/certs.d/_default/hosts.toml` | ||
- `/etc/certs/mirror.pem` | ||
|
||
To use a public hosted image registry (ex. ECR) as mirror, specify the following configuration: | ||
|
||
```yaml | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Cluster | ||
metadata: | ||
name: <NAME> | ||
spec: | ||
topology: | ||
variables: | ||
- name: clusterConfig | ||
value: | ||
globalImageRegistryMirror: | ||
url: https://123456789.dkr.ecr.us-east-1.amazonaws.com | ||
``` | ||
|
||
Applying this configuration will result in following new files on the | ||
`KubeadmControlPlaneTemplate` and `KubeadmConfigTemplate` | ||
|
||
- `/etc/containerd/certs.d/_default/hosts.toml` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.