Skip to content

Conversation

@kasiakoziol
Copy link
Collaborator

@kasiakoziol kasiakoziol commented Jul 28, 2025

Description

This PR implements a separation between ingestion and indexing services within the Splunk Operator for Kubernetes. The goal is to enable the operator to independently manage the ingestion service while maintaining seamless integration with the indexing service.

Key Changes

  • Introduction of new Custom Resource Definition for IngestorCluster
  • Support for Remote Queue and Pipeline inputs in IngestorCluster and IndexerCluster

Testing and Verification

These changed were tested manually and as a part of the further enhancements, automated tests will be implemented.

Related Issues

Jira Epic: https://splunk.atlassian.net/browse/CSPL-3549

Notes

  • Enhance documentation to reflect on the changes (Done - docs/IndexIngestionSeparation.md)
  • Address TODOs (Done - only role update to splunk_ingestor left till new Docker image with this Ansible role gets released (CSPL-4002))
  • Implement and enhance helm charts (CSPL-4003)
  • Implement automated tests
    • Unit tests
    • Integration tests (CSPL-3558)
  • Refactor
    • If message bus type changes, then there are two configs kept in the .conf files
    • .conf files get updated with all values, not only values that changed
  • Separate PushBus and PipelineConfig into a separate resource (CSPL-4022)
  • Do we need to support migration? As of now, only new customers are supported. Document it.

PR Checklist

  • Code changes adhere to the project's coding standards.
  • Relevant unit and integration tests are included.
  • Documentation has been updated accordingly.
  • All tests pass locally.
  • The PR description follows the project's guidelines.

@kasiakoziol kasiakoziol force-pushed the CSPL-3551-ingestion-cr branch 6 times, most recently from ca230a9 to eb21049 Compare July 28, 2025 15:15
@kasiakoziol kasiakoziol force-pushed the CSPL-3551-ingestion-cr branch from eb21049 to 2cca0d7 Compare July 29, 2025 08:24
@coveralls
Copy link
Collaborator

coveralls commented Jul 29, 2025

Pull Request Test Coverage Report for Build 17610018166

Details

  • 332 of 467 (71.09%) changed or added relevant lines in 9 files are covered.
  • 6 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.5%) to 86.098%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/splunk/client/enterprise.go 25 29 86.21%
pkg/splunk/enterprise/util.go 10 14 71.43%
internal/controller/ingestorcluster_controller.go 70 76 92.11%
pkg/splunk/enterprise/indexercluster.go 62 75 82.67%
pkg/splunk/enterprise/ingestorcluster.go 146 254 57.48%
Files with Coverage Reduction New Missed Lines %
pkg/splunk/enterprise/afwscheduler.go 1 92.93%
pkg/splunk/enterprise/cp.go 1 33.33%
pkg/splunk/enterprise/indexercluster.go 4 73.4%
Totals Coverage Status
Change from base Build 17296474155: -0.5%
Covered Lines: 11049
Relevant Lines: 12833

💛 - Coveralls

@kasiakoziol kasiakoziol force-pushed the CSPL-3551-ingestion-cr branch from d3779b0 to 44349fa Compare July 29, 2025 14:54
@kasiakoziol kasiakoziol force-pushed the CSPL-3551-ingestion-cr branch 13 times, most recently from 3b2cf1c to 5cad7f9 Compare August 5, 2025 08:49
@kasiakoziol kasiakoziol force-pushed the CSPL-3551-ingestion-cr branch 3 times, most recently from 8e32bd1 to 4df319e Compare August 19, 2025 15:39
Replicas int32 `json:"replicas"`

// Splunk Enterprise app repository that specifies remote app location and scope for Splunk app management
AppFrameworkConfig AppFrameworkSpec `json:"appRepo,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't have to happen right now, but when we do more productization, we should update the AppFramework and CustomResources docs to include this CR.

- op: add
path: "/spec/versions/-"
value:
name: v1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this be supported for v1 and v2? I don't see these files for clustermanager and licensemanager for example, which were later CRs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It got generated by make command as far as I remember. Will revisit it later.

# without permissions to modify them. It is ideal for monitoring purposes and limited-access viewing.

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will probably need to add this to the helm chart as well: https://github.com/splunk/splunk-operator/tree/main/helm-chart/splunk-operator/templates/rbac

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

- clustermanagers
- clustermasters
- indexerclusters
- ingestorclusters
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will probably need to add this to the helm chart as well: https://github.com/splunk/splunk-operator/tree/main/helm-chart/splunk-operator/templates/rbac

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@kasiakoziol kasiakoziol force-pushed the CSPL-3551-ingestion-cr branch 3 times, most recently from f2d467a to 713eac7 Compare August 21, 2025 13:45
@kasiakoziol kasiakoziol force-pushed the CSPL-3551-ingestion-cr branch from 713eac7 to 1c77634 Compare August 21, 2025 13:46
@kasiakoziol kasiakoziol changed the title Cspl 3551 ingestion cr CSPL-3549 Splunk Operator Enhancement – Ingestion and Indexing Separation Aug 21, 2025
@kasiakoziol kasiakoziol force-pushed the CSPL-3551-ingestion-cr branch 2 times, most recently from b12dbb4 to 68e8c7c Compare September 1, 2025 12:06
@kasiakoziol kasiakoziol force-pushed the CSPL-3551-ingestion-cr branch from 68e8c7c to e62f381 Compare September 1, 2025 12:15
@kasiakoziol kasiakoziol mentioned this pull request Sep 19, 2025
5 tasks
Copy link
Collaborator

@vivekr-splunk vivekr-splunk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few changes are requested

utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(enterpriseApi.AddToScheme(scheme))
utilruntime.Must(enterpriseApiV3.AddToScheme(scheme))
utilruntime.Must(enterprisev4.AddToScheme(scheme))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have utilruntime.Must(enterpriseApi.AddToScheme(scheme)) which points to v4

# without permissions to modify them. It is ideal for monitoring purposes and limited-access viewing.

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

- clustermanagers
- clustermasters
- indexerclusters
- ingestorclusters
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1


request, err := http.NewRequest("POST", endpoint, strings.NewReader(body))
if err != nil {
return err
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log error here, also we need to make sure to add events which shows stages of CR status.

if cr.Spec.PullBus.Type != "" {
err = mgr.handlePullBusOrPipelineConfigChange(ctx, cr, client)
if err != nil {
scopedLog.Error(err, "Failed to update conf file for PullBus/Pipeline config change after pod creation")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add an k8s event here ( or at least one failure) and stages of Ingestor state

var newSplunkClientForPullBusPipeline = splclient.NewSplunkClient

// Checks if only PullBus or Pipeline config changed, and updates the conf file if so
func (mgr *indexerClusterPodManager) handlePullBusOrPipelineConfigChange(ctx context.Context, newCR *enterpriseApi.IndexerCluster, k8s client.Client) error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Not related to this feature , but on longer run we need to find a way to bring these changes to SOK https://github.com/splunk/splunk-operator/pull/1193/files. it just simplifies how we manage Rest calls

return updateErr
}

func getChangedPullBusAndPipelineFieldsIndexer(newCR *enterpriseApi.IndexerCluster) (pullBusChangedFieldsInputs, pullBusChangedFieldsOutputs, pipelineChangedFields [][]string) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add description to the function

case SplunkMonitoringConsole:
role = "splunk_monitor"
case SplunkIngestor:
role = "splunk_standalone" // TODO: change this to a new role when we have one (splunk_ingestor)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought @Igor-splunk added role to ansible

SplunkLicenseMaster: splcommon.LicenseManagerRole,
SplunkLicenseManager: splcommon.LicenseManagerRole,
SplunkMonitoringConsole: "splunk_monitor",
SplunkIngestor: "splunk_standalone", // TODO: change this to a new role when we have one (splunk_ingestor)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here , have we added new role to ansible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants