Skip to content

Commit

Permalink
Split Appfabric into stateless service and stateful processor
Browse files Browse the repository at this point in the history
  • Loading branch information
vsethi09 committed Dec 16, 2024
1 parent 5a1bcbe commit 9bb3aa5
Show file tree
Hide file tree
Showing 7 changed files with 2,924 additions and 13 deletions.
7 changes: 7 additions & 0 deletions api/v1alpha1/cdapmaster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ type CDAPMasterSpec struct {
LogLevels map[string]string `json:"logLevels,omitempty"`
// AppFabric is specification for the CDAP app-fabric service.
AppFabric AppFabricSpec `json:"appFabric,omitempty"`
// AppFabricProcessor is specification for the CDAP app-fabric processor service.
AppFabricProcessor AppFabricProcessorSpec `json:"appFabricProcessor,omitempty"`
// Logs is specification for the CDAP logging service.
Logs LogsSpec `json:"logs,omitempty"`
// Messaging is specification for the CDAP messaging service.
Expand Down Expand Up @@ -218,6 +220,11 @@ type CDAPScalableStatefulServiceSpec struct {

// AppFabricSpec defines the specification for the AppFabric service.
type AppFabricSpec struct {
CDAPScalableServiceSpec `json:",inline"`
}

// AppFabricProcessorSpec defines the specification for the AppFabric Processor service.
type AppFabricProcessorSpec struct {
CDAPStatefulServiceSpec `json:",inline"`
}

Expand Down
19 changes: 18 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2,883 changes: 2,883 additions & 0 deletions config/crd/bases/cdap.cdap.io_cdapmasters.yaml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions controllers/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const (
// serviceAppFabric defines the service type for app-fabric
serviceAppFabric ServiceName = "AppFabric"

// serviceAppFabricProcessor defines the service type for app-fabric processor
serviceAppFabricProcessor ServiceName = "AppFabricProcessor"

// serviceLogs defines the service type for log processing and serving service
serviceLogs ServiceName = "Logs"

Expand Down
19 changes: 10 additions & 9 deletions controllers/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,18 @@ func (d *DeploymentPlan) Init() {
// Default: each service runs in its own Pod
d.planMap[0] = ServiceGroups{
stateful: map[ServiceGroupName]ServiceGroup{
"logs": {serviceLogs},
"messaging": {serviceMessaging},
"metrics": {serviceMetrics},
"preview": {servicePreview},
"appfabric": {serviceAppFabric},
"runtime": {serviceRuntime},
"supportbundle": {serviceSupportBundle},
"tetheringagent": {serviceTetheringAgent},
"artifactcache": {serviceArtifactCache},
"appfabricprocessor": {serviceAppFabricProcessor},
"logs": {serviceLogs},
"messaging": {serviceMessaging},
"metrics": {serviceMetrics},
"preview": {servicePreview},
"runtime": {serviceRuntime},
"supportbundle": {serviceSupportBundle},
"tetheringagent": {serviceTetheringAgent},
"artifactcache": {serviceArtifactCache},
},
deployment: map[ServiceGroupName]ServiceGroup{
"appfabric": {serviceAppFabric},
"authentication": {serviceAuthentication},
"metadata": {serviceMetadata},
"router": {serviceRouter},
Expand Down
2 changes: 1 addition & 1 deletion controllers/testdata/appfabric.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"apiVersion": "apps/v1",
"kind": "StatefulSet",
"kind": "Deployment",
"metadata": {
"annotations": {
"deployment.kubernetes.io/revision": "8"
Expand Down
4 changes: 2 additions & 2 deletions controllers/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var _ = Describe("Controller Suite", func() {
}
serviceToScalableSpec = map[string]*v1alpha1.CDAPScalableServiceSpec{
serviceLogs: nil,
serviceAppFabric: nil,
serviceAppFabric: &master.Spec.AppFabric.CDAPScalableServiceSpec,
serviceMetrics: nil,
serviceRouter: &master.Spec.Router.CDAPScalableServiceSpec,
serviceMessaging: nil,
Expand All @@ -39,7 +39,7 @@ var _ = Describe("Controller Suite", func() {
}
serviceToStatefulSpec = map[string]*v1alpha1.CDAPStatefulServiceSpec{
serviceLogs: &master.Spec.Logs.CDAPStatefulServiceSpec,
serviceAppFabric: &master.Spec.AppFabric.CDAPStatefulServiceSpec,
serviceAppFabric: nil,
serviceMetrics: &master.Spec.Metrics.CDAPStatefulServiceSpec,
serviceRouter: nil,
serviceMessaging: &master.Spec.Messaging.CDAPStatefulServiceSpec,
Expand Down

0 comments on commit 9bb3aa5

Please sign in to comment.