-
Notifications
You must be signed in to change notification settings - Fork 126
[DO NOT MERGE BEFORE #1606 and #1610] CSPL-3549 Splunk Operator Enhancement – Ingestion and Indexing Separation #1550
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
Open
kasiakoziol
wants to merge
61
commits into
develop
Choose a base branch
from
CSPL-3551-ingestion-cr
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 21 commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
0e36568
CSPL-3551 Init IngestorCluster CR implementation
kasiakoziol 2cca0d7
CSPL-3551 Enhancing Ingestor inputs
kasiakoziol f747ab4
Merge branch 'develop' into CSPL-3551-ingestion-cr
kasiakoziol 9a7503c
fix
kasiakoziol 7134350
fix
kasiakoziol 44349fa
CSPL-3551 Adding tests
kasiakoziol e71ea9c
CSPL-3551 Mound defaults and update them with no Splunk restart
kasiakoziol 14ccef4
Merge branch 'develop' into CSPL-3551-ingestion-cr
kasiakoziol 8876d0e
CSPL-3551 Fixing code after tests
kasiakoziol 5c31cab
CSPL-3895-indexercluster (#1562)
Igor-splunk 0c9e908
CSPL-3551 Applying fixes do Indexer integration
kasiakoziol 89f9eb4
Merge branch 'develop' into CSPL-3551-ingestion-cr
kasiakoziol d885a73
CSPL-3551 Fixes
kasiakoziol 56aa780
Merge branch 'develop' into CSPL-3551-ingestion-cr
kasiakoziol 1c77634
CSPL-3551 Fixes
kasiakoziol fb4e87f
CSPL-3560 Initial docs for I&I separation
kasiakoziol 3e376d8
Merge branch 'develop' into CSPL-3551-ingestion-cr
kasiakoziol e62f381
CSPL-3551 Update documentation to reflect on Grafana
kasiakoziol 84d8491
CSPL-3556 Unit tests
kasiakoziol c3b3aa6
CSPL-3972 Addressing TODOs
kasiakoziol 2af9061
CSPL-3972 Addressing TODOs
kasiakoziol 053352d
CSPL-3551 Moving default from types to controller code
kasiakoziol e844286
CSPL-3551 Applying previous changes to IndexerCluster
kasiakoziol 500cdfa
CSPL-3551 Moving validations to separate function and adding validati…
kasiakoziol 4b064a6
CSPL-3551 Making sure all inputs are put into status
kasiakoziol 9c6cd69
CSPL-3551 Update of conf files when queue name or type change
kasiakoziol 759b09b
CSPL-3551 Unit tests
kasiakoziol 20d9d6c
CSPL-4003 Helm charts support for bus and pipeline configs
kasiakoziol f9fb45a
CSPL-4003 Docs update
kasiakoziol c5e4c2b
CSPL-4003 Addressing comments
kasiakoziol 2de618a
CSPL-3558 Integ tests init
kasiakoziol 0393139
CSPL-3558 Adding extra validation for integraion test
kasiakoziol 4d3865c
CSPL-3558 Refactoring
kasiakoziol c354062
CSPL-3558 Adding scenario for update and delete
kasiakoziol c204d52
CSPL-3558 Adding helm test
kasiakoziol 027c039
CSPL-3558 Update of k8s version
kasiakoziol c5a97dc
CSPL-3558 Fix metrics-server installation issues after k8s version up…
kasiakoziol fc28db0
CSPL-3558 Adding additional tests
kasiakoziol a7ae40f
CSPL-3558 Fixing helm tests
kasiakoziol d3b2ad6
Merge branch 'develop' into CSPL-3551-ingestion-cr
kasiakoziol 3325113
Merge branch 'CSPL-3551-ingestion-cr' into feature/CSPL-3551-ingestio…
kasiakoziol 13b8f4f
Merge branch 'feature/CSPL-3551-ingestion-cr-todos' into feature/CSPL…
kasiakoziol 4622102
CSPL-3558 Fix tests after merge
kasiakoziol 9fbcb4a
CSPL-3558 Fix helm tests
kasiakoziol 7480ed8
CSPL-4022 Remove pipeline config from inputs
kasiakoziol d21a9a3
CSPL-4022 Remove bus inputs
kasiakoziol 7edb81b
CSPL-4022 Introduce BusConfiguration CR
kasiakoziol a5b2db3
CSPL-4022 Update docs and tests
kasiakoziol 9f57abc
CSPL-4022 Update ns reference for BusConfiguration
kasiakoziol 10a4fc0
CSPL-4022 Fixing tests and adding bus config to ingestor controller
kasiakoziol db02bfd
CSPL-4022 Fix update behaviour
kasiakoziol ceb2c71
CSPL-4022 Docs update
kasiakoziol 6618a3f
Merge pull request #1600 from splunk/feature/CSPL-4022-move-inputs-to-cr
kasiakoziol d7f367b
CSPL-4022 Fix failing tests
kasiakoziol 25b76a3
Merge pull request #1593 from splunk/feature/CSPL-3558-integ-tests
kasiakoziol c6cea58
Merge pull request #1576 from splunk/feature/CSPL-3551-ingestion-cr-t…
kasiakoziol 192d3bf
CSPL-4022 Fix tests
kasiakoziol c6972f7
Merge branch 'develop' into CSPL-3551-ingestion-cr
kasiakoziol cfd3cd7
CSPL-4022 Addressing PR comments
kasiakoziol 5843632
CSPL-4022 Address comments
kasiakoziol 4e37060
CSPL-4022 Fix helm tests
kasiakoziol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,216 @@ | ||
| /* | ||
| Copyright 2025. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| 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 v4 | ||
|
|
||
| import ( | ||
| corev1 "k8s.io/api/core/v1" | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| "k8s.io/apimachinery/pkg/runtime" | ||
| ) | ||
|
|
||
| // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | ||
| // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
|
||
| const ( | ||
| // IngestorClusterPausedAnnotation is the annotation that pauses the reconciliation (triggers | ||
| // an immediate requeue) | ||
| IngestorClusterPausedAnnotation = "ingestorcluster.enterprise.splunk.com/paused" | ||
| ) | ||
|
|
||
| // IngestorClusterSpec defines the spec of Ingestor Cluster | ||
| type IngestorClusterSpec struct { | ||
| // Common Splunk spec | ||
| CommonSplunkSpec `json:",inline"` | ||
|
|
||
| // Number of ingestor pods | ||
| Replicas int32 `json:"replicas"` | ||
|
|
||
| // Splunk Enterprise app repository that specifies remote app location and scope for Splunk app management | ||
| AppFrameworkConfig AppFrameworkSpec `json:"appRepo,omitempty"` | ||
kasiakoziol marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // Push Bus spec | ||
| PushBus PushBusSpec `json:"pushBus"` | ||
|
|
||
| // Pipeline configuration | ||
| PipelineConfig PipelineConfigSpec `json:"pipelineConfig"` | ||
| } | ||
|
|
||
| // Helper types | ||
| // Only SQS as of now | ||
| type PushBusSpec struct { | ||
| // +kubebuilder:validation:Enum=sqs_smartbus | ||
| // +kubebuilder:default=sqs_smartbus | ||
| Type string `json:"type"` | ||
|
|
||
| SQS SQSSpec `json:"sqs"` | ||
| } | ||
|
|
||
| type SQSSpec struct { | ||
| QueueName string `json:"queueName"` | ||
|
|
||
| AuthRegion string `json:"authRegion"` | ||
|
|
||
| // +kubebuilder:validation:Pattern=`^https://` | ||
| Endpoint string `json:"endpoint"` | ||
|
|
||
| // +kubebuilder:validation:Pattern=`^https://` | ||
| LargeMessageStoreEndpoint string `json:"largeMessageStoreEndpoint"` | ||
|
|
||
| // +kubebuilder:validation:Pattern=`^s3://` | ||
| LargeMessageStorePath string `json:"largeMessageStorePath"` | ||
|
|
||
| DeadLetterQueueName string `json:"deadLetterQueueName"` | ||
|
|
||
| // +kubebuilder:validation:Minimum=0 | ||
| // +kubebuilder:default=3 | ||
| MaxRetriesPerPart int `json:"maxRetriesPerPart"` | ||
|
|
||
| // +kubebuilder:validation:Enum=max_count | ||
| // +kubebuilder:default=max_count | ||
| RetryPolicy string `json:"retryPolicy"` | ||
|
|
||
| // +kubebuilder:validation:Pattern=`^[0-9]+s$` | ||
| // +kubebuilder:default="5s" | ||
| SendInterval string `json:"sendInterval"` | ||
| } | ||
|
|
||
| type PipelineConfigSpec struct { | ||
| // +kubebuilder:default=false | ||
| RemoteQueueRuleset bool `json:"remoteQueueRuleset"` | ||
|
|
||
| // +kubebuilder:default=true | ||
| RuleSet bool `json:"ruleSet"` | ||
|
|
||
| // +kubebuilder:default=false | ||
| RemoteQueueTyping bool `json:"remoteQueueTyping"` | ||
|
|
||
| // +kubebuilder:default=false | ||
| RemoteQueueOutput bool `json:"remoteQueueOutput"` | ||
|
|
||
| // +kubebuilder:default=true | ||
| Typing bool `json:"typing"` | ||
|
|
||
| // +kubebuilder:default=true | ||
| IndexerPipe bool `json:"indexerPipe,omitempty"` | ||
| } | ||
|
|
||
| // IngestorClusterStatus defines the observed state of Ingestor Cluster | ||
| type IngestorClusterStatus struct { | ||
| // Phase of the ingestor pods | ||
| Phase Phase `json:"phase"` | ||
|
|
||
| // Number of desired ingestor pods | ||
| Replicas int32 `json:"replicas"` | ||
|
|
||
| // Number of ready ingestor pods | ||
| ReadyReplicas int32 `json:"readyReplicas"` | ||
|
|
||
| // Selector for pods used by HorizontalPodAutoscaler | ||
| Selector string `json:"selector"` | ||
|
|
||
| // Resource revision tracker | ||
| ResourceRevMap map[string]string `json:"resourceRevMap"` | ||
|
|
||
| // App Framework context | ||
| AppContext AppDeploymentContext `json:"appContext"` | ||
|
|
||
| // Telemetry App installation flag | ||
| TelAppInstalled bool `json:"telAppInstalled"` | ||
|
|
||
| // Auxillary message describing CR status | ||
| Message string `json:"message"` | ||
|
|
||
| // Pipeline configuration status | ||
| PipelineConfig PipelineConfigSpec `json:"pipelineConfig"` | ||
|
|
||
| // Push Bus status | ||
| PushBus PushBusSpec `json:"pushBus"` | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
| // +kubebuilder:subresource:status | ||
|
|
||
| // IngestorCluster is the Schema for a Splunk Enterprise ingestor cluster pods | ||
| // +k8s:openapi-gen=true | ||
| // +kubebuilder:subresource:status | ||
| // +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector | ||
| // +kubebuilder:resource:path=ingestorclusters,scope=Namespaced,shortName=ing | ||
| // +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Status of ingestor cluster pods" | ||
| // +kubebuilder:printcolumn:name="Desired",type="integer",JSONPath=".status.replicas",description="Number of desired ingestor cluster pods" | ||
| // +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="Current number of ready ingestor cluster pods" | ||
| // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Age of ingestor cluster resource" | ||
| // +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.message",description="Auxillary message describing CR status" | ||
| // +kubebuilder:storageversion | ||
|
|
||
| // IngestorCluster is the Schema for the ingestorclusters API | ||
| type IngestorCluster struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty,omitzero"` | ||
|
|
||
| Spec IngestorClusterSpec `json:"spec"` | ||
| Status IngestorClusterStatus `json:"status,omitempty,omitzero"` | ||
| } | ||
|
|
||
| // DeepCopyObject implements runtime.Object | ||
| func (in *IngestorCluster) DeepCopyObject() runtime.Object { | ||
| if c := in.DeepCopy(); c != nil { | ||
| return c | ||
| } | ||
| return nil | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
|
|
||
| // IngestorClusterList contains a list of IngestorCluster | ||
| type IngestorClusterList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ListMeta `json:"metadata,omitempty"` | ||
| Items []IngestorCluster `json:"items"` | ||
| } | ||
|
|
||
| func init() { | ||
| SchemeBuilder.Register(&IngestorCluster{}, &IngestorClusterList{}) | ||
| } | ||
|
|
||
| // NewEvent creates a new event associated with the object and ready | ||
| // to be published to Kubernetes API | ||
| func (ic *IngestorCluster) NewEvent(eventType, reason, message string) corev1.Event { | ||
| t := metav1.Now() | ||
| return corev1.Event{ | ||
| ObjectMeta: metav1.ObjectMeta{ | ||
| GenerateName: reason + "-", | ||
| Namespace: ic.ObjectMeta.Namespace, | ||
| }, | ||
| InvolvedObject: corev1.ObjectReference{ | ||
| Kind: "IngestorCluster", | ||
| Namespace: ic.Namespace, | ||
| Name: ic.Name, | ||
| UID: ic.UID, | ||
| APIVersion: GroupVersion.String(), | ||
| }, | ||
| Reason: reason, | ||
| Message: message, | ||
| Source: corev1.EventSource{ | ||
| Component: "splunk-ingestorcluster-controller", | ||
| }, | ||
| FirstTimestamp: t, | ||
| LastTimestamp: t, | ||
| Count: 1, | ||
| Type: eventType, | ||
| ReportingController: "enterprise.splunk.com/ingestorcluster-controller", | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.