Skip to content
Closed
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
13 changes: 13 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: splunk.com
layout:
- go.kubebuilder.io/v4
Expand Down Expand Up @@ -109,4 +113,13 @@ resources:
kind: LicenseManager
path: github.com/splunk/splunk-operator/api/v4
version: v4
- api:
crdVersion: v1
namespaced: true
controller: true
domain: splunk.com
group: enterprise
kind: KVService
path: github.com/splunk/splunk-operator/api/v4
version: v4
version: "3"
3 changes: 3 additions & 0 deletions api/v4/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ type CommonSplunkSpec struct {
// Sets imagePullSecrets if image is being pulled from a private registry.
// See https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

// DefaultKVStoreType specifies the default KV store type for this Splunk instance
DefaultKVStoreType string `json:"defaultKVStoreType"`
}

// StorageClassSpec defines storage class configuration
Expand Down
70 changes: 70 additions & 0 deletions api/v4/kvservice_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
Copyright 2021.

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 (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// 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 (
// KVServicePausedAnnotation is the annotation that pauses the reconciliation (triggers
// an immediate requeue)
KVServicePausedAnnotation = "kvservice.enterprise.splunk.com/paused"
)

// KVServiceSpec defines the desired state of KVService
type KVServiceSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// Foo is an example field of KVService. Edit kvservice_types.go to remove/update
Foo string `json:"foo,omitempty"`
}

// KVServiceStatus defines the observed state of KVService
type KVServiceStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status

// KVService is the Schema for the kvservices API
type KVService struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec KVServiceSpec `json:"spec,omitempty"`
Status KVServiceStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// KVServiceList contains a list of KVService
type KVServiceList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []KVService `json:"items"`
}

func init() {
SchemeBuilder.Register(&KVService{}, &KVServiceList{})
}
89 changes: 89 additions & 0 deletions api/v4/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ import (
"os"
"time"

"sigs.k8s.io/controller-runtime/pkg/metrics/filters"

intController "github.com/splunk/splunk-operator/internal/controller"
"github.com/splunk/splunk-operator/internal/controller/debug"
"github.com/splunk/splunk-operator/pkg/config"
"sigs.k8s.io/controller-runtime/pkg/metrics/filters"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
Expand All @@ -47,6 +48,8 @@ import (

enterpriseApiV3 "github.com/splunk/splunk-operator/api/v3"
enterpriseApi "github.com/splunk/splunk-operator/api/v4"
enterprisev4 "github.com/splunk/splunk-operator/api/v4"
"github.com/splunk/splunk-operator/internal/controller"
//+kubebuilder:scaffold:imports
//extapi "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)
Expand All @@ -60,6 +63,7 @@ func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(enterpriseApi.AddToScheme(scheme))
utilruntime.Must(enterpriseApiV3.AddToScheme(scheme))
utilruntime.Must(enterprisev4.AddToScheme(scheme))
//+kubebuilder:scaffold:scheme
//utilruntime.Must(extapi.AddToScheme(scheme))
}
Expand Down Expand Up @@ -221,6 +225,13 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "Standalone")
os.Exit(1)
}
if err = (&controller.KVServiceReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "KVService")
os.Exit(1)
}
//+kubebuilder:scaffold:builder

if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/enterprise.splunk.com_clustermanagers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,10 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
defaultKVStoreType:
description: DefaultKVStoreType specifies the default KV store type
for this Splunk instance
type: string
defaults:
description: Inline map of default.yml overrides used to initialize
the environment
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/enterprise.splunk.com_clustermasters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,10 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
defaultKVStoreType:
description: DefaultKVStoreType specifies the default KV store type
for this Splunk instance
type: string
defaults:
description: Inline map of default.yml overrides used to initialize
the environment
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/enterprise.splunk.com_indexerclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,10 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
defaultKVStoreType:
description: DefaultKVStoreType specifies the default KV store type
for this Splunk instance
type: string
defaults:
description: Inline map of default.yml overrides used to initialize
the environment
Expand Down Expand Up @@ -5253,6 +5257,10 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
defaultKVStoreType:
description: DefaultKVStoreType specifies the default KV store type
for this Splunk instance
type: string
defaults:
description: Inline map of default.yml overrides used to initialize
the environment
Expand Down
54 changes: 54 additions & 0 deletions config/crd/bases/enterprise.splunk.com_kvservices.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.18.0
name: kvservices.enterprise.splunk.com
spec:
group: enterprise.splunk.com
names:
kind: KVService
listKind: KVServiceList
plural: kvservices
singular: kvservice
scope: Namespaced
versions:
- name: v4
schema:
openAPIV3Schema:
description: KVService is the Schema for the kvservices API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: KVServiceSpec defines the desired state of KVService
properties:
foo:
description: Foo is an example field of KVService. Edit kvservice_types.go
to remove/update
type: string
type: object
status:
description: KVServiceStatus defines the observed state of KVService
type: object
type: object
served: true
storage: true
subresources:
status: {}
4 changes: 4 additions & 0 deletions config/crd/bases/enterprise.splunk.com_licensemanagers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,10 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
defaultKVStoreType:
description: DefaultKVStoreType specifies the default KV store type
for this Splunk instance
type: string
defaults:
description: Inline map of default.yml overrides used to initialize
the environment
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/enterprise.splunk.com_licensemasters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,10 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
defaultKVStoreType:
description: DefaultKVStoreType specifies the default KV store type
for this Splunk instance
type: string
defaults:
description: Inline map of default.yml overrides used to initialize
the environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,10 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
defaultKVStoreType:
description: DefaultKVStoreType specifies the default KV store type
for this Splunk instance
type: string
defaults:
description: Inline map of default.yml overrides used to initialize
the environment
Expand Down Expand Up @@ -5742,6 +5746,10 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
defaultKVStoreType:
description: DefaultKVStoreType specifies the default KV store type
for this Splunk instance
type: string
defaults:
description: Inline map of default.yml overrides used to initialize
the environment
Expand Down
Loading
Loading