Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CDAP-21096] Split Appfabric into stateless service and stateful processor #123

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading