Skip to content

Commit

Permalink
Introduce acaas chart (#621)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha authored Dec 13, 2024
1 parent 13947dd commit 6f533d7
Show file tree
Hide file tree
Showing 28 changed files with 41,273 additions and 19,571 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ _testmain.go
.DS_Store
/.crds

/charts/acaas/charts
/charts/ace/charts
/charts/opscenter-features/charts
/charts/service-gateway/charts
110 changes: 110 additions & 0 deletions apis/installer/v1alpha1/ace_acaas_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/*
Copyright AppsCode Inc. and Contributors
Licensed under the AppsCode Community License 1.0.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
ResourceKindAcaas = "Acaas"
ResourceAcaas = "acaas"
ResourceAcaass = "Acaass"
)

// Acaas defines the schama for ACE Hosting Components.

// +genclient
// +genclient:skipVerbs=updateStatus
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=aces,singular=ace,categories={kubeops,appscode}
type Acaas struct {
metav1.TypeMeta `json:",inline,omitempty"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AcaasSpec `json:"spec,omitempty"`
}

// AcaasSpec is the schema for Ace Operator values file
type AcaasSpec struct {
Billing AceBilling `json:"billing"`
DeployUi AceDeployUi `json:"deploy-ui"`
DNSProxy AceDnsProxy `json:"dns-proxy"`
MarketplaceUi AceMarketplaceUi `json:"marketplace-ui"`
PlatformLinks AcePlatformLinks `json:"platform-links"`
SMTPRelay AceSmtprelay `json:"smtprelay"`
Global AcaasGlobalValues `json:"global"`
Ingress AcaasIngress `json:"ingress"`
}

type AceBilling struct {
Enabled bool `json:"enabled"`
*BillingSpec `json:",inline,omitempty"`
}

type AceDeployUi struct {
Enabled bool `json:"enabled"`
*DeployUiSpec `json:",inline,omitempty"`
}

type AceDnsProxy struct {
Enabled bool `json:"enabled"`
*DnsProxySpec `json:",inline,omitempty"`
}

type AceMarketplaceUi struct {
Enabled bool `json:"enabled"`
*MarketplaceUiSpec `json:",inline,omitempty"`
}

type AcePlatformLinks struct {
Enabled bool `json:"enabled"`
*PlatformLinksSpec `json:",inline,omitempty"`
}

type AceSmtprelay struct {
Enabled bool `json:"enabled"`
*SmtprelaySpec `json:",inline,omitempty"`
}

type AcaasGlobalValues struct {
NameOverride string `json:"nameOverride"`
FullnameOverride string `json:"fullnameOverride"`
Platform AcaasPlatformSettings `json:"platform"`
Registry string `json:"registry"`
RegistryFQDN string `json:"registryFQDN"`
}

type AcaasPlatformSettings struct {
Host string `json:"host"`
}

type AcaasIngress struct {
ClassName string `json:"className"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// AcaasList is a list of Aces
type AcaasList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
// Items is a list of Ace CRD objects
Items []Acaas `json:"items,omitempty"`
}
66 changes: 14 additions & 52 deletions apis/installer/v1alpha1/ace_ace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,21 @@ type Ace struct {

// AceSpec is the schema for Ace Operator values file
type AceSpec struct {
Billing AceBilling `json:"billing"`
PlatformUi AcePlatformUi `json:"platform-ui"`
ClusterUi AceClusterUi `json:"cluster-ui"`
DeployUi AceDeployUi `json:"deploy-ui"`
Grafana AceGrafana `json:"grafana"`
KubedbUi AceKubedbUi `json:"kubedb-ui"`
MarketplaceUi AceMarketplaceUi `json:"marketplace-ui"`
PlatformApi AcePlatformApi `json:"platform-api"`
PlatformLinks AcePlatformLinks `json:"platform-links"`
IngressNginx AceIngressNginx `json:"ingress-nginx"`
IngressDns AceIngressDns `json:"ingress-dns"`
Nats AceNats `json:"nats"`
NatsDns AceNatsDns `json:"nats-dns"`
Trickster AceTrickster `json:"trickster"`
DNSProxy AceDnsProxy `json:"dns-proxy"`
Openfga AceOpenfga `json:"openfga"`
SMTPRelay AceSmtprelay `json:"smtprelay"`
S3proxy AceS3proxy `json:"s3proxy"`
PlatformUi AcePlatformUi `json:"platform-ui"`
ClusterUi AceClusterUi `json:"cluster-ui"`
Grafana AceGrafana `json:"grafana"`
KubedbUi AceKubedbUi `json:"kubedb-ui"`
PlatformApi AcePlatformApi `json:"platform-api"`
IngressNginx AceIngressNginx `json:"ingress-nginx"`
IngressDns AceIngressDns `json:"ingress-dns"`
Nats AceNats `json:"nats"`
NatsDns AceNatsDns `json:"nats-dns"`
Trickster AceTrickster `json:"trickster"`
Openfga AceOpenfga `json:"openfga"`
S3proxy AceS3proxy `json:"s3proxy"`
// KubeBindServer AceKubeBindServer `json:"kube-bind-server"`
Global AceGlobalValues `json:"global"`
Settings Settings `json:"settings"`
//+optional
RegistryFQDN string `json:"registryFQDN"`
Global AceGlobalValues `json:"global"`
Settings Settings `json:"settings"`
Image ImageReference `json:"image"`
Kubectl ImageReference `json:"kubectl"`
PodAnnotations map[string]string `json:"podAnnotations"`
Expand All @@ -88,11 +80,6 @@ type AceSpec struct {
ExtraObjects map[string]*runtime.RawExtension `json:"extraObjects"`
}

type AceBilling struct {
Enabled bool `json:"enabled"`
*BillingSpec `json:",inline,omitempty"`
}

type AcePlatformUi struct {
Enabled bool `json:"enabled"`
*PlatformUiSpec `json:",inline,omitempty"`
Expand All @@ -108,11 +95,6 @@ type AceClusterUi struct {
*ClusterUiSpec `json:",inline,omitempty"`
}

type AceDeployUi struct {
Enabled bool `json:"enabled"`
*DeployUiSpec `json:",inline,omitempty"`
}

type AceGrafana struct {
Enabled bool `json:"enabled"`
*GrafanaSpec `json:",inline,omitempty"`
Expand All @@ -123,21 +105,11 @@ type AceKubedbUi struct {
*KubedbUiSpec `json:",inline,omitempty"`
}

type AceMarketplaceUi struct {
Enabled bool `json:"enabled"`
*MarketplaceUiSpec `json:",inline,omitempty"`
}

type AcePlatformApi struct {
Enabled bool `json:"enabled"`
*PlatformApiSpec `json:",inline,omitempty"`
}

type AcePlatformLinks struct {
Enabled bool `json:"enabled"`
*PlatformLinksSpec `json:",inline,omitempty"`
}

type AceIngressNginx struct {
Enabled bool `json:"enabled"`
*IngressNginxSpec `json:",inline,omitempty"`
Expand Down Expand Up @@ -168,22 +140,12 @@ type AceTrickster struct {
*openviz_installer.TricksterSpec `json:",inline,omitempty"`
}

type AceDnsProxy struct {
Enabled bool `json:"enabled"`
*DnsProxySpec `json:",inline,omitempty"`
}

type AceOpenfga struct {
Enabled bool `json:"enabled"`
DatastoreURI string `json:"datastoreURI"`
*OpenfgaSpec `json:",inline,omitempty"`
}

type AceSmtprelay struct {
Enabled bool `json:"enabled"`
*SmtprelaySpec `json:",inline,omitempty"`
}

type AceS3proxy struct {
Enabled bool `json:"enabled"`
*S3proxySpec `json:",inline,omitempty"`
Expand Down
42 changes: 18 additions & 24 deletions apis/installer/v1alpha1/ace_options_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,30 +53,24 @@ type AceOptions struct {

// AceOptionsSpec is the schema for AceOptions Operator values file
type AceOptionsSpec struct {
Context AceDeploymentContext `json:"context"`
Release ObjectReference `json:"release"`
Registry RegistrySpec `json:"registry"`
Monitoring GlobalMonitoring `json:"monitoring"`
Infra AceOptionsPlatformInfra `json:"infra"`
Settings AceOptionsSettings `json:"settings"`
Billing AceOptionsComponentSpec `json:"billing"`
PlatformUi AceOptionsComponentSpec `json:"platform-ui"`
ClusterUi AceOptionsComponentSpec `json:"cluster-ui"`
DeployUi AceOptionsComponentSpec `json:"deploy-ui"`
Grafana AceOptionsComponentSpec `json:"grafana"`
KubedbUi AceOptionsComponentSpec `json:"kubedb-ui"`
MarketplaceUi AceOptionsComponentSpec `json:"marketplace-ui"`
PlatformApi AceOptionsComponentSpec `json:"platform-api"`
PlatformLinks AceOptionsComponentSpec `json:"platform-links"`
Ingress AceOptionsIngressNginx `json:"ingress"`
Nats AceOptionsNatsSettings `json:"nats"`
Trickster AceOptionsComponentSpec `json:"trickster"`
DNSProxy AceOptionsComponentSpec `json:"dns-proxy"`
Openfga AceOptionsComponentSpec `json:"openfga"`
SMTPRelay AceOptionsComponentSpec `json:"smtprelay"`
S3proxy AceOptionsComponentSpec `json:"s3proxy"`
Branding AceBrandingSpec `json:"branding"`
InitialSetup configapi.AceSetupInlineOptions `json:"initialSetup"`
Context AceDeploymentContext `json:"context"`
Release ObjectReference `json:"release"`
Registry RegistrySpec `json:"registry"`
Monitoring GlobalMonitoring `json:"monitoring"`
Infra AceOptionsPlatformInfra `json:"infra"`
Settings AceOptionsSettings `json:"settings"`
PlatformUi AceOptionsComponentSpec `json:"platform-ui"`
ClusterUi AceOptionsComponentSpec `json:"cluster-ui"`
Grafana AceOptionsComponentSpec `json:"grafana"`
KubedbUi AceOptionsComponentSpec `json:"kubedb-ui"`
PlatformApi AceOptionsComponentSpec `json:"platform-api"`
Ingress AceOptionsIngressNginx `json:"ingress"`
Nats AceOptionsNatsSettings `json:"nats"`
Trickster AceOptionsComponentSpec `json:"trickster"`
Openfga AceOptionsComponentSpec `json:"openfga"`
S3proxy AceOptionsComponentSpec `json:"s3proxy"`
Branding AceBrandingSpec `json:"branding"`
InitialSetup configapi.AceSetupInlineOptions `json:"initialSetup"`
}

func (a *AceOptionsSpec) IsOptionsComplete() bool {
Expand Down
2 changes: 2 additions & 0 deletions apis/installer/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&AccountsUi{},
&AccountsUiList{},
&Acaas{},
&AcaasList{},
&Ace{},
&AceList{},
&AceInstaller{},
Expand Down
7 changes: 4 additions & 3 deletions apis/installer/v1alpha1/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (

func TestDefaultValues(t *testing.T) {
checker := sc.New(os.DirFS("../../.."),
sc.TestCase{Obj: v1alpha1.AcaasSpec{}},
sc.TestCase{Obj: v1alpha1.AccountsUiSpec{}},
sc.TestCase{Obj: v1alpha1.AceInstallerSpec{}},
sc.TestCase{Obj: v1alpha1.AceSpec{}},
Expand All @@ -44,10 +45,10 @@ func TestDefaultValues(t *testing.T) {
sc.TestCase{Obj: v1alpha1.DnsProxySpec{}},
sc.TestCase{Obj: v1alpha1.GrafanaSpec{}},
sc.TestCase{Obj: v1alpha1.InboxUiSpec{}},
sc.TestCase{Obj: v1alpha1.KubedbUiSpec{}},
sc.TestCase{Obj: v1alpha1.KubedbUiPresetsSpec{}},
sc.TestCase{Obj: v1alpha1.LicenseProxyserverSpec{}},
sc.TestCase{Obj: v1alpha1.KubedbUiSpec{}},
sc.TestCase{Obj: v1alpha1.LicenseProxyserverManagerSpec{}},
sc.TestCase{Obj: v1alpha1.LicenseProxyserverSpec{}},
sc.TestCase{Obj: v1alpha1.MarketplaceUiSpec{}},
sc.TestCase{Obj: v1alpha1.MinioSpec{}},
sc.TestCase{Obj: v1alpha1.OpscenterFeaturesSpec{}},
Expand All @@ -56,8 +57,8 @@ func TestDefaultValues(t *testing.T) {
sc.TestCase{Obj: v1alpha1.PlatformUiSpec{}},
sc.TestCase{Obj: v1alpha1.S3proxySpec{}},
sc.TestCase{Obj: v1alpha1.ServiceBackendSpec{}},
sc.TestCase{Obj: v1alpha1.ServiceGatewaySpec{}},
sc.TestCase{Obj: v1alpha1.ServiceGatewayPresetsSpec{}},
sc.TestCase{Obj: v1alpha1.ServiceGatewaySpec{}},
sc.TestCase{Obj: v1alpha1.ServiceProviderSpec{}},
sc.TestCase{Obj: v1alpha1.ServiceVaultSpec{}},
sc.TestCase{Obj: v1alpha1.SmtprelaySpec{}},
Expand Down
Loading

0 comments on commit 6f533d7

Please sign in to comment.