Skip to content

Commit dd251db

Browse files
committed
refactor: rename variable to just registry
Along with that rename all files and any other related variables
1 parent 56af092 commit dd251db

File tree

31 files changed

+171
-167
lines changed

31 files changed

+171
-167
lines changed

api/v1alpha1/addon_types.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const (
2727

2828
ServiceLoadBalancerProviderMetalLB = "MetalLB"
2929

30-
RegistryMirrorProviderDistribution = "Distribution"
30+
RegistryProviderCNCFDistribution = "CNCF Distribution"
3131

3232
AddonStrategyClusterResourceSet AddonStrategy = "ClusterResourceSet"
3333
AddonStrategyHelmAddon AddonStrategy = "HelmAddon"
@@ -104,7 +104,7 @@ type GenericAddons struct {
104104
ServiceLoadBalancer *ServiceLoadBalancer `json:"serviceLoadBalancer,omitempty"`
105105

106106
// +kubebuilder:validation:Optional
107-
RegistryMirror *RegistryMirror `json:"registryMirror,omitempty"`
107+
Registry *RegistryAddon `json:"registry,omitempty"`
108108
}
109109

110110
type AddonStrategy string
@@ -341,9 +341,9 @@ type AddressRange struct {
341341
End string `json:"end"`
342342
}
343343

344-
type RegistryMirror struct {
344+
type RegistryAddon struct {
345345
// The OCI registry provider to deploy.
346-
// +kubebuilder:default=Distribution
347-
// +kubebuilder:validation:Enum=Distribution
346+
// +kubebuilder:default="CNCF Distribution"
347+
// +kubebuilder:validation:Enum="CNCF Distribution"
348348
Provider string `json:"provider"`
349349
}

api/v1alpha1/constants.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ const (
2828
ClusterAutoscalerVariableName = "clusterAutoscaler"
2929
// ServiceLoadBalancerVariableName is the Service LoadBalancer config patch variable name.
3030
ServiceLoadBalancerVariableName = "serviceLoadBalancer"
31-
// RegistryMirrorVariableName is the OCI registry config patch variable name.
32-
RegistryMirrorVariableName = "registryMirror"
31+
// RegistryAddonVariableName is the OCI registry config patch variable name.
32+
RegistryAddonVariableName = "registry"
3333

3434
// GlobalMirrorVariableName is the global image registry mirror patch variable name.
3535
GlobalMirrorVariableName = "globalImageRegistryMirror"

api/v1alpha1/crds/caren.nutanix.com_awsclusterconfigs.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,13 @@ spec:
234234
- HelmAddon
235235
type: string
236236
type: object
237-
registryMirror:
237+
registry:
238238
properties:
239239
provider:
240-
default: Distribution
240+
default: CNCF Distribution
241241
description: The OCI registry provider to deploy.
242242
enum:
243-
- Distribution
243+
- CNCF Distribution
244244
type: string
245245
required:
246246
- provider

api/v1alpha1/crds/caren.nutanix.com_dockerclusterconfigs.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,13 @@ spec:
243243
- HelmAddon
244244
type: string
245245
type: object
246-
registryMirror:
246+
registry:
247247
properties:
248248
provider:
249-
default: Distribution
249+
default: CNCF Distribution
250250
description: The OCI registry provider to deploy.
251251
enum:
252-
- Distribution
252+
- CNCF Distribution
253253
type: string
254254
required:
255255
- provider

api/v1alpha1/crds/caren.nutanix.com_nutanixclusterconfigs.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,13 @@ spec:
243243
- HelmAddon
244244
type: string
245245
type: object
246-
registryMirror:
246+
registry:
247247
properties:
248248
provider:
249-
default: Distribution
249+
default: CNCF Distribution
250250
description: The OCI registry provider to deploy.
251251
enum:
252-
- Distribution
252+
- CNCF Distribution
253253
type: string
254254
required:
255255
- provider

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/cluster-api-runtime-extensions-nutanix/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ A Helm chart for cluster-api-runtime-extensions-nutanix
8585
| hooks.nfd.crsStrategy.defaultInstallationConfigMap.name | string | `"node-feature-discovery"` | |
8686
| hooks.nfd.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
8787
| hooks.nfd.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-nfd-helm-values-template"` | |
88-
| hooks.registryMirror.distribution.defaultValueTemplateConfigMap.create | bool | `true` | |
89-
| hooks.registryMirror.distribution.defaultValueTemplateConfigMap.name | string | `"default-distribution-registry-mirror-helm-values-template"` | |
88+
| hooks.registry.cncfDistribution.defaultValueTemplateConfigMap.create | bool | `true` | |
89+
| hooks.registry.cncfDistribution.defaultValueTemplateConfigMap.name | string | `"default-cncf-distribution-registry-helm-values-template"` | |
9090
| hooks.serviceLoadBalancer.metalLB.defaultValueTemplateConfigMap.create | bool | `true` | |
9191
| hooks.serviceLoadBalancer.metalLB.defaultValueTemplateConfigMap.name | string | `"default-metallb-helm-values-template"` | |
9292
| hooks.virtualIP.kubeVip.defaultTemplateConfigMap.create | bool | `true` | |

charts/cluster-api-runtime-extensions-nutanix/templates/helm-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ data:
2323
ChartName: cluster-autoscaler
2424
ChartVersion: 9.46.3
2525
RepositoryURL: '{{ if .Values.helmRepository.enabled }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://kubernetes.github.io/autoscaler{{ end }}'
26+
cncf-distribution-registry: |
27+
ChartName: docker-registry
28+
ChartVersion: 2.3.1
29+
RepositoryURL: '{{ if .Values.helmRepository.enabled }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://mesosphere.github.io/charts/staging/{{ end }}'
2630
cosi-controller: |
2731
ChartName: cosi
2832
ChartVersion: 0.0.1-alpha.5
2933
RepositoryURL: '{{ if .Values.helmRepository.enabled }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://mesosphere.github.io/charts/stable/{{ end }}'
30-
distribution-registry-mirror: |
31-
ChartName: docker-registry
32-
ChartVersion: 2.3.1
33-
RepositoryURL: '{{ if .Values.helmRepository.enabled }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://mesosphere.github.io/charts/staging/{{ end }}'
3434
local-path-provisioner-csi: |
3535
ChartName: local-path-provisioner
3636
ChartVersion: 0.0.31

charts/cluster-api-runtime-extensions-nutanix/templates/registry-mirror/distribution/helm-addon-installation.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright 2025 Nutanix. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
{{- if .Values.hooks.registry.cncfDistribution.defaultValueTemplateConfigMap.name }}
5+
apiVersion: v1
6+
kind: ConfigMap
7+
metadata:
8+
name: '{{ .Values.hooks.registry.cncfDistribution.defaultValueTemplateConfigMap.name }}'
9+
data:
10+
values.yaml: |-
11+
{{- .Files.Get "addons/registry/cncf-distribution/values-template.yaml" | nindent 4 }}
12+
{{- end -}}

charts/cluster-api-runtime-extensions-nutanix/values.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,9 @@
504504
},
505505
"type": "object"
506506
},
507-
"registryMirror": {
507+
"registry": {
508508
"properties": {
509-
"distribution": {
509+
"cncfDistribution": {
510510
"properties": {
511511
"defaultValueTemplateConfigMap": {
512512
"properties": {

charts/cluster-api-runtime-extensions-nutanix/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ hooks:
111111
defaultValueTemplateConfigMap:
112112
create: true
113113
name: default-cosi-controller-helm-values-template
114-
registryMirror:
115-
distribution:
114+
registry:
115+
cncfDistribution:
116116
defaultValueTemplateConfigMap:
117117
create: true
118-
name: default-distribution-registry-mirror-helm-values-template
118+
name: default-cncf-distribution-registry-helm-values-template
119119

120120
helmAddonsConfigMap: default-helm-addons-config
121121

docs/content/addons/registry-mirror.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

docs/content/addons/registry.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
+++
2+
title = "Registry"
3+
icon = "fa-solid fa-eye"
4+
+++
5+
6+
By leveraging CAPI cluster lifecycle hooks, this handler deploys an OCI [Distribution] registry,
7+
at the `AfterControlPlaneInitialized` phase and configures it as a mirror on the new cluster.
8+
The registry will be deployed as a StatefulSet with a persistent volume claim for storage
9+
and multiple replicas for high availability.
10+
A sidecar container in each Pod running [Regsync] will periodically sync the OCI artifacts across all replicas.
11+
12+
Deployment of this registry is opt-in via the [provider-specific cluster configuration]({{< ref ".." >}}).
13+
14+
The hook will use the [Cluster API Add-on Provider for Helm] to deploy the registry resources.
15+
16+
## Example
17+
18+
To enable deployment of the registry on a cluster, specify the following values:
19+
20+
```yaml
21+
apiVersion: cluster.x-k8s.io/v1beta1
22+
kind: Cluster
23+
metadata:
24+
name: <NAME>
25+
spec:
26+
topology:
27+
variables:
28+
- name: clusterConfig
29+
value:
30+
addons:
31+
registry: {}
32+
```
33+
34+
[Distribution]: https://github.com/distribution/distribution
35+
[Cluster API Add-on Provider for Helm]: https://github.com/kubernetes-sigs/cluster-api-addon-provider-helm
36+
[Regsync]: https://regclient.org/usage/regsync/

examples/capi-quick-start/docker-cluster-calico-crs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ spec:
4141
strategy: ClusterResourceSet
4242
nfd:
4343
strategy: ClusterResourceSet
44-
registryMirror: {}
44+
registry: {}
4545
serviceLoadBalancer:
4646
configuration:
4747
addressRanges:

examples/capi-quick-start/docker-cluster-calico-helm-addon.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ spec:
3636
default: {}
3737
snapshotController: {}
3838
nfd: {}
39-
registryMirror: {}
39+
registry: {}
4040
serviceLoadBalancer:
4141
configuration:
4242
addressRanges:

examples/capi-quick-start/docker-cluster-cilium-crs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ spec:
4141
strategy: ClusterResourceSet
4242
nfd:
4343
strategy: ClusterResourceSet
44-
registryMirror: {}
44+
registry: {}
4545
serviceLoadBalancer:
4646
configuration:
4747
addressRanges:

examples/capi-quick-start/docker-cluster-cilium-helm-addon.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ spec:
3636
default: {}
3737
snapshotController: {}
3838
nfd: {}
39-
registryMirror: {}
39+
registry: {}
4040
serviceLoadBalancer:
4141
configuration:
4242
addressRanges:

hack/addons/kustomize/distribution-registry-mirror/kustomization.yaml.tmpl renamed to hack/addons/kustomize/cncf-distribution-registry/kustomization.yaml.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ sortOptions:
1717
helmCharts:
1818
- name: docker-registry
1919
repo: https://mesosphere.github.io/charts/staging/
20-
releaseName: registry-mirror
20+
releaseName: cncf-distribution-registry
2121
version: 2.3.1
2222
valuesFile: helm-values.yaml
2323
includeCRDs: true
2424
skipTests: true
25-
namespace: registry-mirror-system
25+
namespace: registry-system
2626

27-
namespace: registry-mirror-system
27+
namespace: registry-system

hack/examples/bases/docker/cluster/kustomization.yaml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ patches:
4343
path: ../../../patches/docker/cosi.yaml
4444
- target:
4545
kind: Cluster
46-
path: ../../../patches/docker/registry-mirror.yaml
46+
path: ../../../patches/docker/registry.yaml
4747
- target:
4848
kind: Cluster
4949
path: ../../../patches/encryption.yaml

hack/examples/patches/docker/registry-mirror.yaml renamed to hack/examples/patches/docker/registry.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
- op: "add"
5-
path: "/spec/topology/variables/0/value/addons/registryMirror"
5+
path: "/spec/topology/variables/0/value/addons/registry"
66
value: {}

0 commit comments

Comments
 (0)