Skip to content

Commit 39ea171

Browse files
Add regcache chart and use it as an ace-installer subchart (#1280)
Signed-off-by: Tamal Saha <tamal@appscode.com> Signed-off-by: Arnob kumar saha <arnob@appscode.com> Co-authored-by: Arnob kumar saha <arnob@appscode.com>
1 parent c47fbfa commit 39ea171

50 files changed

Lines changed: 4595 additions & 1037 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ _testmain.go
3838

3939
/charts/acaas/charts
4040
/charts/ace/charts
41+
/charts/ace-installer/charts
42+
/charts/ace-installer-certified/charts
4143
/charts/opscenter-features/charts
4244
/charts/platform-opscenter/charts
4345
/charts/service-gateway/charts

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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ type AceInstallerSpec struct {
5858
SelfManagement configapi.SelfManagement `json:"selfManagement"`
5959
Precheck AceInstallerPrecheckSpec `json:"precheck"`
6060
Tester AceInstallerPodSpec `json:"tester"`
61+
// Regcache configures the in-cluster pull-through Docker registry cache
62+
// (CNCF Distribution / registry:3) deployed via the regcache subchart. When
63+
// enabled, it transparently proxies images from the upstream registry
64+
// (ghcr.io by default), so that ghcr.io/appscode-charts images can be served
65+
// from within the cluster.
66+
Regcache RegcacheSpec `json:"regcache"`
6167
// +optional
6268
Options string `json:"options"`
6369
}

apis/installer/v1alpha1/ace_options_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ type AceOptionsSpec struct {
7171
Gateway AceOptionsGateway `json:"gateway"`
7272
Nats AceOptionsNatsSettings `json:"nats"`
7373
Trickster AceOptionsComponentSpec `json:"trickster"`
74+
Regcache AceOptionsComponentSpec `json:"regcache"`
7475
Openfga AceOptionsComponentSpec `json:"openfga"`
7576
PgOutbox AceOptionsComponentSpec `json:"pgoutbox"`
7677
OutboxSyncer AceOptionsComponentSpec `json:"outbox-syncer"`
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
/*
2+
Copyright AppsCode Inc. and Contributors
3+
4+
Licensed under the AppsCode Community License 1.0.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
import (
20+
core "k8s.io/api/core/v1"
21+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
"kmodules.xyz/resource-metadata/apis/shared"
23+
)
24+
25+
const (
26+
ResourceKindRegcache = "Regcache"
27+
ResourceRegcache = "regcache"
28+
ResourceRegcaches = "regcaches"
29+
)
30+
31+
// Regcache defines the schema for the regcache chart values.
32+
33+
// +genclient
34+
// +genclient:skipVerbs=updateStatus
35+
// +k8s:openapi-gen=true
36+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
37+
38+
// +kubebuilder:object:root=true
39+
// +kubebuilder:resource:path=regcaches,singular=regcache,categories={kubeops,appscode}
40+
type Regcache struct {
41+
metav1.TypeMeta `json:",inline,omitempty"`
42+
metav1.ObjectMeta `json:"metadata,omitempty"`
43+
Spec RegcacheSpec `json:"spec,omitempty"`
44+
}
45+
46+
// RegcacheSpec is the schema for the regcache chart values. It deploys an
47+
// in-cluster pull-through Docker registry cache (CNCF Distribution / registry:3)
48+
// that transparently proxies images from an upstream registry (ghcr.io by
49+
// default), so that ghcr.io/appscode-charts images can be served from within
50+
// the cluster.
51+
type RegcacheSpec struct {
52+
Enabled bool `json:"enabled"`
53+
ReplicaCount int `json:"replicaCount"`
54+
//+optional
55+
NameOverride string `json:"nameOverride"`
56+
//+optional
57+
FullnameOverride string `json:"fullnameOverride"`
58+
// RegistryFQDN is the docker registry fqdn used to pull the registry image.
59+
RegistryFQDN string `json:"registryFQDN"`
60+
Image ImageReference `json:"image"`
61+
//+optional
62+
ImagePullSecrets []string `json:"imagePullSecrets"`
63+
// RemoteURL is the upstream registry that this instance proxies as a
64+
// pull-through cache.
65+
RemoteURL string `json:"remoteURL"`
66+
// TTL is how long a cached blob/manifest is kept before the pull-through
67+
// cache scheduler purges it. This is the only mechanism that frees disk:
68+
// the cache has no capacity-based (LRU) eviction, so lower values bound
69+
// disk usage at the cost of re-fetching from upstream more often.
70+
//+optional
71+
TTL string `json:"ttl"`
72+
// Username is an optional credential for authenticating against the
73+
// upstream registry. Leave empty for anonymous pulls.
74+
//+optional
75+
Username string `json:"username"`
76+
// Password is an optional credential for authenticating against the
77+
// upstream registry. Leave empty for anonymous pulls.
78+
//+optional
79+
Password string `json:"password"`
80+
//+optional
81+
PodAnnotations map[string]string `json:"podAnnotations"`
82+
//+optional
83+
PodSecurityContext *core.PodSecurityContext `json:"podSecurityContext"`
84+
//+optional
85+
SecurityContext *core.SecurityContext `json:"securityContext"`
86+
Service AceServiceSpec `json:"service"`
87+
Persistence RegcachePersistence `json:"persistence"`
88+
//+optional
89+
Resources core.ResourceRequirements `json:"resources"`
90+
//+optional
91+
NodeSelector map[string]string `json:"nodeSelector"`
92+
// If specified, the pod's tolerations.
93+
//+optional
94+
Tolerations []core.Toleration `json:"tolerations"`
95+
// If specified, the pod's scheduling constraints
96+
//+optional
97+
Affinity *core.Affinity `json:"affinity"`
98+
Infra RegcacheInfra `json:"infra"`
99+
//+optional
100+
Distro shared.DistroSpec `json:"distro"`
101+
}
102+
103+
type RegcacheInfra struct {
104+
StorageClass LocalObjectReference `json:"storageClass"`
105+
}
106+
107+
type RegcachePersistence struct {
108+
Enabled bool `json:"enabled"`
109+
StorageClass string `json:"storageClass"`
110+
AccessMode string `json:"accessMode"`
111+
Size string `json:"size"`
112+
}
113+
114+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
115+
116+
// RegcacheList is a list of Regcaches
117+
type RegcacheList struct {
118+
metav1.TypeMeta `json:",inline"`
119+
metav1.ListMeta `json:"metadata,omitempty"`
120+
// Items is a list of Regcache CRD objects
121+
Items []Regcache `json:"items,omitempty"`
122+
}

apis/installer/v1alpha1/register.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
130130
&NatsList{},
131131
&Openfga{},
132132
&OpenfgaList{},
133+
&Regcache{},
134+
&RegcacheList{},
133135
&Reloader{},
134136
&ReloaderList{},
135137
&S3proxy{},

apis/installer/v1alpha1/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)