Skip to content

Commit d0cd6e9

Browse files
committed
Add in-cluster registry proxy to ace-installer chart
Add a CNCF Distribution (registry:3) pull-through cache to the ace-installer chart via regproxy.enabled (default true). It proxies the upstream registry (ghcr.io by default) so ghcr.io/appscode-charts images are served from within the cluster. Also add an appscode-wizards-oci HelmRepository, used by the platform UI deploy wizards. It defaults to the same upstream as appscode-charts-oci (oci://ghcr.io/appscode-charts). When regproxy is enabled, its URL is rewritten to the in-cluster proxy service so wizard chart pulls are served from the cache. The proxy serves plain HTTP, so the repository is marked insecure in that case. The cache image is ghcr.io/appscode-images/registry:3. Cache disk management: - regproxy.ttl (default 72h) bounds disk usage; the pull-through cache purges entries older than the ttl and has no capacity-based eviction. - The cache PVC storage class falls back to the ACE data/backup storage class (helm.releases.ace.values.global.infra.storageClass.name) when no explicit regproxy.persistence.storageClass is set, then to the cluster default. Document that charts/ace-installer-certified and ace-installer-certified-crds are generated from charts/ace-installer via chart-packer and must not be edited directly. Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent 802ccc5 commit d0cd6e9

32 files changed

Lines changed: 2715 additions & 312 deletions

File tree

AGENTS.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,12 @@ Helpers (invoked outside Make):
4444
- License: `LICENSE.md`. Sign off commits (`git commit -s`).
4545
- Vendor directory is checked in; keep `go mod tidy && go mod vendor` clean.
4646
- CRDs for charts are imported via `import-crds.sh`; don't hand-author `charts/*/crds/*.yaml`.
47-
- `-certified` charts mirror the standard charts for Red Hat certification — bumps must apply to both.
47+
- `-certified` charts mirror the standard charts for Red Hat certification. `charts/ace-installer-certified` and `charts/ace-installer-certified-crds` are **generated** — do not edit them directly. After changing `charts/ace-installer`, regenerate them with:
48+
49+
```sh
50+
rm -rf charts/ace-installer-certified charts/ace-installer-certified-crds
51+
chart-packer crd-less --input charts/ace-installer --output charts
52+
chart-packer crd-only --input charts/ace-installer --output charts
53+
make gen-chart-doc
54+
```
4855
- Adding a new chart: create `charts/<name>/`, add a values-schema Go type under `apis/installer/v1alpha1/`, list images in `imagelist.yaml`, then run `make gen`.

apis/installer/v1alpha1/ace_installer_types.go

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,65 @@ type AceInstallerSpec struct {
5858
SelfManagement configapi.SelfManagement `json:"selfManagement"`
5959
Precheck AceInstallerPrecheckSpec `json:"precheck"`
6060
Tester AceInstallerPodSpec `json:"tester"`
61+
// Regproxy configures an optional in-cluster pull-through Docker registry
62+
// cache (CNCF Distribution / registry:3). When enabled, it transparently
63+
// proxies images from the upstream registry (ghcr.io by default), so that
64+
// ghcr.io/appscode-charts images can be served from within the cluster.
65+
Regproxy Regproxy `json:"regproxy"`
6166
// +optional
6267
Options string `json:"options"`
6368
}
6469

70+
// Regproxy is an optional in-cluster pull-through Docker registry cache
71+
// (CNCF Distribution / registry:3).
72+
type Regproxy struct {
73+
Enabled bool `json:"enabled"`
74+
ReplicaCount int `json:"replicaCount"`
75+
Image ImageReference `json:"image"`
76+
// RemoteURL is the upstream registry that this instance proxies as a
77+
// pull-through cache.
78+
RemoteURL string `json:"remoteURL"`
79+
// TTL is how long a cached blob/manifest is kept before the pull-through
80+
// cache scheduler purges it. This is the only mechanism that frees disk:
81+
// the cache has no capacity-based (LRU) eviction, so lower values bound
82+
// disk usage at the cost of re-fetching from upstream more often.
83+
//+optional
84+
TTL string `json:"ttl"`
85+
// Username is an optional credential for authenticating against the
86+
// upstream registry. Leave empty for anonymous pulls.
87+
//+optional
88+
Username string `json:"username"`
89+
// Password is an optional credential for authenticating against the
90+
// upstream registry. Leave empty for anonymous pulls.
91+
//+optional
92+
Password string `json:"password"`
93+
//+optional
94+
PodAnnotations map[string]string `json:"podAnnotations"`
95+
//+optional
96+
PodSecurityContext *core.PodSecurityContext `json:"podSecurityContext"`
97+
//+optional
98+
SecurityContext *core.SecurityContext `json:"securityContext"`
99+
Service AceServiceSpec `json:"service"`
100+
Persistence RegproxyPersistence `json:"persistence"`
101+
//+optional
102+
Resources core.ResourceRequirements `json:"resources"`
103+
//+optional
104+
NodeSelector map[string]string `json:"nodeSelector"`
105+
// If specified, the pod's tolerations.
106+
//+optional
107+
Tolerations []core.Toleration `json:"tolerations"`
108+
// If specified, the pod's scheduling constraints
109+
//+optional
110+
Affinity *core.Affinity `json:"affinity"`
111+
}
112+
113+
type RegproxyPersistence struct {
114+
Enabled bool `json:"enabled"`
115+
StorageClass string `json:"storageClass"`
116+
AccessMode string `json:"accessMode"`
117+
Size string `json:"size"`
118+
}
119+
65120
type AceInstallerPrecheckSpec struct {
66121
Enabled bool `json:"enabled"`
67122
AceInstallerPodSpec `json:",inline"`

apis/installer/v1alpha1/zz_generated.deepcopy.go

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

catalog/imagelist.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
- alpine:3.20
22
- bats/bats:1.11.0
3+
- ghcr.io/appscode-images/registry:3
34
- ghcr.io/appscode/ace:v0.2.0
45
- ghcr.io/appscode/acerproxy:v0.2.0
56
- ghcr.io/appscode/aceshifter:v0.0.3

0 commit comments

Comments
 (0)