Skip to content

Commit

Permalink
Merge pull request #123 from cdapio/feature/CDAP-21096_split_appfabri…
Browse files Browse the repository at this point in the history
…c_service_processor

[CDAP-21096] Split Appfabric into stateless service and stateful processor
  • Loading branch information
vsethi09 authored Jan 10, 2025
2 parents 5a1bcbe + c877f2d commit 5ed7d5c
Show file tree
Hide file tree
Showing 16 changed files with 3,389 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21
go-version: 1.23

- name: Install Kubebuilder
run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.19 as builder
FROM golang:1.23 as builder

# Copy everything in the go src
WORKDIR /go/src/cdap.io/cdap-operator
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.22
ENVTEST_K8S_VERSION = 1.30

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -113,7 +113,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
CONTROLLER_TOOLS_VERSION ?= v0.7.0
CONTROLLER_TOOLS_VERSION ?= v0.16.5
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"

.PHONY: kustomize
Expand Down
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
7 changes: 1 addition & 6 deletions 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 Expand Up @@ -151,11 +151,6 @@
"name": "cdap-sysappconf",
"readOnly": true
},
{
"mountPath": "/data",
"name": "cdap-test-appfabric-data",
"readOnly": true
},
{
"mountPath": "/etc/cdap/security",
"name": "cdap-security",
Expand Down
Loading

0 comments on commit 5ed7d5c

Please sign in to comment.