Skip to content

Commit 6618a3f

Browse files
authored
Merge pull request #1600 from splunk/feature/CSPL-4022-move-inputs-to-cr
CSPL-4022 Remove pipeline config from inputs
2 parents 9fbcb4a + ceb2c71 commit 6618a3f

File tree

51 files changed

+2300
-1744
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2300
-1744
lines changed

PROJECT

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,13 @@ resources:
122122
kind: IngestorCluster
123123
path: github.com/splunk/splunk-operator/api/v4
124124
version: v4
125+
- api:
126+
crdVersion: v1
127+
namespaced: true
128+
controller: true
129+
domain: splunk.com
130+
group: enterprise
131+
kind: BusConfiguration
132+
path: github.com/splunk/splunk-operator/api/v4
133+
version: v4
125134
version: "3"

api/v4/busconfiguration_types.go

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
/*
2+
Copyright 2025.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v4
18+
19+
import (
20+
corev1 "k8s.io/api/core/v1"
21+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
"k8s.io/apimachinery/pkg/runtime"
23+
)
24+
25+
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
26+
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
27+
28+
const (
29+
// BusConfigurationPausedAnnotation is the annotation that pauses the reconciliation (triggers
30+
// an immediate requeue)
31+
BusConfigurationPausedAnnotation = "busconfiguration.enterprise.splunk.com/paused"
32+
)
33+
34+
// BusConfigurationSpec defines the desired state of BusConfiguration
35+
type BusConfigurationSpec struct {
36+
Type string `json:"type"`
37+
38+
SQS SQSSpec `json:"sqs"`
39+
}
40+
41+
type SQSSpec struct {
42+
QueueName string `json:"queueName"`
43+
44+
AuthRegion string `json:"authRegion"`
45+
46+
Endpoint string `json:"endpoint"`
47+
48+
LargeMessageStoreEndpoint string `json:"largeMessageStoreEndpoint"`
49+
50+
LargeMessageStorePath string `json:"largeMessageStorePath"`
51+
52+
DeadLetterQueueName string `json:"deadLetterQueueName"`
53+
}
54+
55+
// BusConfigurationStatus defines the observed state of BusConfiguration.
56+
type BusConfigurationStatus struct {
57+
// Phase of the bus configuration
58+
Phase Phase `json:"phase"`
59+
60+
// Resource revision tracker
61+
ResourceRevMap map[string]string `json:"resourceRevMap"`
62+
63+
// Auxillary message describing CR status
64+
Message string `json:"message"`
65+
}
66+
67+
// +kubebuilder:object:root=true
68+
// +kubebuilder:subresource:status
69+
70+
// BusConfiguration is the Schema for a Splunk Enterprise bus configuration
71+
// +k8s:openapi-gen=true
72+
// +kubebuilder:subresource:status
73+
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector
74+
// +kubebuilder:resource:path=busconfigurations,scope=Namespaced,shortName=bus
75+
// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Status of bus configuration"
76+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Age of bus configuration resource"
77+
// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.message",description="Auxillary message describing CR status"
78+
// +kubebuilder:storageversion
79+
80+
// BusConfiguration is the Schema for the busconfigurations API
81+
type BusConfiguration struct {
82+
metav1.TypeMeta `json:",inline"`
83+
metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`
84+
85+
Spec BusConfigurationSpec `json:"spec"`
86+
Status BusConfigurationStatus `json:"status,omitempty,omitzero"`
87+
}
88+
89+
// DeepCopyObject implements runtime.Object
90+
func (in *BusConfiguration) DeepCopyObject() runtime.Object {
91+
if c := in.DeepCopy(); c != nil {
92+
return c
93+
}
94+
return nil
95+
}
96+
97+
// +kubebuilder:object:root=true
98+
99+
// BusConfigurationList contains a list of BusConfiguration
100+
type BusConfigurationList struct {
101+
metav1.TypeMeta `json:",inline"`
102+
metav1.ListMeta `json:"metadata,omitempty"`
103+
Items []BusConfiguration `json:"items"`
104+
}
105+
106+
func init() {
107+
SchemeBuilder.Register(&BusConfiguration{}, &BusConfigurationList{})
108+
}
109+
110+
// NewEvent creates a new event associated with the object and ready
111+
// to be published to Kubernetes API
112+
func (bc *BusConfiguration) NewEvent(eventType, reason, message string) corev1.Event {
113+
t := metav1.Now()
114+
return corev1.Event{
115+
ObjectMeta: metav1.ObjectMeta{
116+
GenerateName: reason + "-",
117+
Namespace: bc.ObjectMeta.Namespace,
118+
},
119+
InvolvedObject: corev1.ObjectReference{
120+
Kind: "BusConfiguration",
121+
Namespace: bc.Namespace,
122+
Name: bc.Name,
123+
UID: bc.UID,
124+
APIVersion: GroupVersion.String(),
125+
},
126+
Reason: reason,
127+
Message: message,
128+
Source: corev1.EventSource{
129+
Component: "splunk-busconfiguration-controller",
130+
},
131+
FirstTimestamp: t,
132+
LastTimestamp: t,
133+
Count: 1,
134+
Type: eventType,
135+
ReportingController: "enterprise.splunk.com/busconfiguration-controller",
136+
}
137+
}

api/v4/indexercluster_types.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ const (
3838
type IndexerClusterSpec struct {
3939
CommonSplunkSpec `json:",inline"`
4040

41-
PipelineConfig PipelineConfigSpec `json:"pipelineConfig,omitempty"`
42-
43-
PullBus PushBusSpec `json:"pullBus,omitempty"`
41+
// Bus configuration reference
42+
BusConfigurationRef corev1.ObjectReference `json:"busConfigurationRef,omitempty"`
4443

4544
// Number of search head pods; a search head cluster will be created if > 1
4645
Replicas int32 `json:"replicas"`
@@ -113,14 +112,11 @@ type IndexerClusterStatus struct {
113112
// status of each indexer cluster peer
114113
Peers []IndexerClusterMemberStatus `json:"peers"`
115114

116-
// Pipeline configuration status
117-
PipelineConfig PipelineConfigSpec `json:"pipelineConfig,omitempty"`
118-
119-
// Pull Bus status
120-
PullBus PushBusSpec `json:"pullBus,omitempty"`
121-
122115
// Auxillary message describing CR status
123116
Message string `json:"message"`
117+
118+
// Bus configuration
119+
BusConfiguration BusConfigurationSpec `json:"busConfiguration,omitempty"`
124120
}
125121

126122
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

api/v4/ingestorcluster_types.go

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -42,55 +42,8 @@ type IngestorClusterSpec struct {
4242
// Splunk Enterprise app repository that specifies remote app location and scope for Splunk app management
4343
AppFrameworkConfig AppFrameworkSpec `json:"appRepo,omitempty"`
4444

45-
// Push Bus spec
46-
PushBus PushBusSpec `json:"pushBus"`
47-
48-
// Pipeline configuration
49-
PipelineConfig PipelineConfigSpec `json:"pipelineConfig"`
50-
}
51-
52-
// Helper types
53-
// Only SQS as of now
54-
type PushBusSpec struct {
55-
Type string `json:"type"`
56-
57-
SQS SQSSpec `json:"sqs"`
58-
}
59-
60-
type SQSSpec struct {
61-
QueueName string `json:"queueName"`
62-
63-
AuthRegion string `json:"authRegion"`
64-
65-
Endpoint string `json:"endpoint"`
66-
67-
LargeMessageStoreEndpoint string `json:"largeMessageStoreEndpoint"`
68-
69-
LargeMessageStorePath string `json:"largeMessageStorePath"`
70-
71-
DeadLetterQueueName string `json:"deadLetterQueueName"`
72-
73-
MaxRetriesPerPart int `json:"maxRetriesPerPart"`
74-
75-
RetryPolicy string `json:"retryPolicy"`
76-
77-
SendInterval string `json:"sendInterval"`
78-
79-
EncodingFormat string `json:"encodingFormat"`
80-
}
81-
82-
type PipelineConfigSpec struct {
83-
RemoteQueueRuleset bool `json:"remoteQueueRuleset"`
84-
85-
RuleSet bool `json:"ruleSet"`
86-
87-
RemoteQueueTyping bool `json:"remoteQueueTyping"`
88-
89-
RemoteQueueOutput bool `json:"remoteQueueOutput"`
90-
91-
Typing bool `json:"typing"`
92-
93-
IndexerPipe bool `json:"indexerPipe"`
45+
// Bus configuration reference
46+
BusConfigurationRef corev1.ObjectReference `json:"busConfigurationRef"`
9447
}
9548

9649
// IngestorClusterStatus defines the observed state of Ingestor Cluster
@@ -119,11 +72,8 @@ type IngestorClusterStatus struct {
11972
// Auxillary message describing CR status
12073
Message string `json:"message"`
12174

122-
// Pipeline configuration status
123-
PipelineConfig PipelineConfigSpec `json:"pipelineConfig"`
124-
125-
// Push Bus status
126-
PushBus PushBusSpec `json:"pushBus"`
75+
// Bus configuration
76+
BusConfiguration BusConfigurationSpec `json:"busConfiguration,omitempty"`
12777
}
12878

12979
// +kubebuilder:object:root=true

0 commit comments

Comments
 (0)