-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add registry addon #1116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: add registry addon #1116
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
929b5c3
feat: add registryMirror API
dkoshkin 84f2d3b
feat: add registryMirror handler
dkoshkin e6eb6ad
build: add docker-registry chart and build changes
dkoshkin 7db74e9
test: add registryMirror in docker examples
dkoshkin 495720a
test: add registryMirror e2e test
dkoshkin 046352f
docs: new registryMirror page
dkoshkin 802e716
fixup! increase PVC disk size
dkoshkin 50a5fd1
fixup! fix: remove unnecessary code to pre-create the namespace
dkoshkin 6e6c70b
fixup! docs: package level comment
dkoshkin 56af092
fixup! correct log
dkoshkin 816ffaa
refactor: rename variable to just registry
dkoshkin c97c129
fixup! fix: rename to CNCFDistribution
dkoshkin 90a9f14
fixup! fix: let CAPI default Service CIDR
dkoshkin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
12 changes: 12 additions & 0 deletions
12
...r-api-runtime-extensions-nutanix/addons/registry-mirror/distribution/values-template.yaml
This file contains hidden or 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,12 @@ | ||
replicaCount: 2 | ||
dkoshkin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
persistence: | ||
enabled: true | ||
size: 50Gi | ||
service: | ||
type: ClusterIP | ||
clusterIP: {{ .ServiceIP }} | ||
port: 80 | ||
statefulSet: | ||
enabled: true | ||
syncer: | ||
interval: 2m |
This file contains hidden or 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
12 changes: 12 additions & 0 deletions
12
...me-extensions-nutanix/templates/registry-mirror/distribution/helm-addon-installation.yaml
This file contains hidden or 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,12 @@ | ||
# Copyright 2025 Nutanix. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
{{- if .Values.hooks.registryMirror.distribution.defaultValueTemplateConfigMap.name }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: '{{ .Values.hooks.registryMirror.distribution.defaultValueTemplateConfigMap.name }}' | ||
data: | ||
values.yaml: |- | ||
{{- .Files.Get "addons/registry-mirror/distribution/values-template.yaml" | nindent 4 }} | ||
{{- end -}} |
This file contains hidden or 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 hidden or 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 hidden or 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,32 @@ | ||
+++ | ||
title = "Registry Mirror" | ||
icon = "fa-solid fa-eye" | ||
+++ | ||
|
||
By leveraging CAPI cluster lifecycle hooks, this handler deploys an OCI [Distribution] (Distribution) registry | ||
as a mirror on the new cluster at the `AfterControlPlaneInitialized` phase. | ||
|
||
Deployment of registry mirror is opt-in via the [provider-specific cluster configuration]({{< ref ".." >}}). | ||
|
||
The hook will use the [Cluster API Add-on Provider for Helm] to deploy the registry mirror resources. | ||
|
||
## Example | ||
|
||
To enable deployment of the registry mirror on a cluster, specify the following values: | ||
|
||
```yaml | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Cluster | ||
metadata: | ||
name: <NAME> | ||
spec: | ||
topology: | ||
variables: | ||
- name: clusterConfig | ||
value: | ||
addons: | ||
registryMirror: {} | ||
``` | ||
|
||
dkoshkin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[Distribution]: https://github.com/distribution/distribution | ||
[Cluster API Add-on Provider for Helm]: https://github.com/kubernetes-sigs/cluster-api-addon-provider-helm |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
27 changes: 27 additions & 0 deletions
27
hack/addons/kustomize/distribution-registry-mirror/kustomization.yaml.tmpl
This file contains hidden or 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,27 @@ | ||
# Copyright 2025 Nutanix. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# NOTE This file is used by the tool in `hack/tools/helm-cm` to add | ||
# docker-registry chart metadata to the "helm-addons" ConfigMap. The tool takes | ||
# a kustomization as input. We do not use this file with kustomize. | ||
|
||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
metadata: | ||
name: registry-distribution | ||
|
||
sortOptions: | ||
order: fifo | ||
|
||
helmCharts: | ||
- name: docker-registry | ||
repo: https://mesosphere.github.io/charts/staging/ | ||
releaseName: registry-mirror | ||
version: 2.3.1 | ||
valuesFile: helm-values.yaml | ||
includeCRDs: true | ||
skipTests: true | ||
namespace: registry-mirror-system | ||
|
||
namespace: registry-mirror-system |
This file contains hidden or 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 hidden or 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,6 @@ | ||
# Copyright 2025 Nutanix. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
- op: "add" | ||
path: "/spec/topology/variables/0/value/addons/registryMirror" | ||
value: {} |
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.