Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9c31567
Promote Develop to main for Splunk Operator Release 3.0.0 (#1573)
github-actions[bot] Sep 15, 2025
188e7c6
CSPL-4005: Remove CRDs from splunk/splunk-operator helm chart (#1579)
rlieberman-splunk Sep 18, 2025
9162937
Helm package: helm package changes 3.0.0 (#1582)
vivekr-splunk Sep 22, 2025
1b0ee23
Vendor only Splunk Operator 3.0.0 in Splunk Enterprise chart to preve…
vivekr-splunk Sep 22, 2025
c66dbce
CSPL-4372: Update GitHub workflows to use pull_request_target event
kubabuczak Dec 22, 2025
989d68f
Merge pull request #1656 from splunk/CSPL-4372-add-discovery-of-targe…
kubabuczak Dec 22, 2025
17b29fc
Revert "CSPL-4372: Update GitHub workflows to use pull_request_target…
kubabuczak Jan 12, 2026
bc91295
Merge pull request #1659 from splunk/revert-1656-CSPL-4372-add-discov…
kubabuczak Jan 15, 2026
66b44fb
Add a check if contributor has signed Splunk Contributor License Agre…
Igor-splunk Jan 15, 2026
f924f7a
Merge pull request #1671 from splunk/cla-check-workflow
kubabuczak Jan 22, 2026
ea41889
Add Platform SDK core API and internal runtime
vivekr-splunk Feb 13, 2026
03dadf2
Add Platform SDK service implementations
vivekr-splunk Feb 13, 2026
b720ee0
Add TenantConfig and PlatformConfig CRDs for multi-tenancy
vivekr-splunk Feb 13, 2026
06383e4
Add PlatformConfig controller for configuration lifecycle
vivekr-splunk Feb 13, 2026
36f4930
Add SecretAdapter for bridging Platform SDK and legacy code
vivekr-splunk Feb 13, 2026
58450fb
Migrate standalone controller to Platform SDK
vivekr-splunk Feb 13, 2026
f102fe0
Make Platform SDK default, remove UsePlatformSDK field
vivekr-splunk Feb 13, 2026
809cfb2
Update project configuration, RBAC, and dependencies
vivekr-splunk Feb 13, 2026
0275095
Merge develop branch into CSPL-4518
vivekr-splunk Feb 13, 2026
0cfff27
Fix test compilation errors after ApplyStandalone signature change
vivekr-splunk Feb 13, 2026
1b92ad5
Fix unit test failures in Platform SDK integration
vivekr-splunk Feb 14, 2026
50fcd30
Trigger CI rebuild
vivekr-splunk Feb 14, 2026
4db0811
Make Platform SDK initialization optional with graceful fallback
vivekr-splunk Feb 14, 2026
887cf95
Add 30-second timeout to SDK runtime initialization
vivekr-splunk Feb 14, 2026
8175cd6
Use legacy mode for all Standalone deployments (temporary fix)
vivekr-splunk Feb 14, 2026
8475fe0
Fix SDK to support legacy secret naming convention
vivekr-splunk Feb 15, 2026
3670473
Fix smoke test timeouts by ensuring legacy secret exists before SDK r…
vivekr-splunk Feb 16, 2026
332794b
Fix Standalone pod crash by manually mounting secret volume
vivekr-splunk Feb 17, 2026
ded8fc5
Merge main branch into CSPL-4518
vivekr-splunk Feb 23, 2026
4266726
Merge develop branch into CSPL-4518
vivekr-splunk Feb 23, 2026
3273f0c
Fix CI: gofmt formatting and remove biased language artifact
vivekr-splunk Feb 23, 2026
25942dd
Fix duplicate imports from merge causing go vet failures
vivekr-splunk Feb 23, 2026
b9de8c4
Fix go vet failures: duplicate imports and update Makefile from develop
vivekr-splunk Feb 23, 2026
94e58cc
Reset non-SDK files to match develop branch
vivekr-splunk Feb 23, 2026
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ clair-scanner-logs
release-*
deploy/olm-certified
*junit.xml
# Test result XML files
*_unit_test.xml
# Bias Language Linter
.biaslanguage/
bin/
Expand Down
167 changes: 167 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# Splunk Operator for Kubernetes

[![License](https://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/splunk/splunk-operator)](https://pkg.go.dev/github.com/splunk/splunk-operator)
[![Go Report Card](https://goreportcard.com/badge/github.com/splunk/splunk-operator)](https://goreportcard.com/report/github.com/splunk/splunk-operator)
[![Coverage Status](https://coveralls.io/repos/github/splunk/splunk-operator/badge.svg?branch=master)](https://coveralls.io/github/splunk/splunk-operator?branch=master)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fsplunk%2Fsplunk-operator.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fsplunk%2Fsplunk-operator?ref=badge_shield)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/splunk/splunk-operator)

The Splunk Operator for Kubernetes (SOK) makes it easy for Splunk
Administrators to deploy and operate Enterprise deployments in a Kubernetes
infrastructure. Packaged as a container, it uses the
[operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
to manage Splunk-specific [custom resources](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/),
following best practices to manage all the underlying Kubernetes objects for you.

This repository is used to build the Splunk
[Operator](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
for Kubernetes (SOK). If you are just looking for documentation on how to
deploy and use the latest release, please see the
[Getting Started Documentation](docs/README.md).

## Splunk General Terms Acceptance

Starting with operator version 3.0.0, which includes support for Splunk Enterprise version 10.x, an additional Docker-Splunk specific parameter is required to start containers. **This is a breaking change, and user action is required.**

Starting in 10.x image versions of Splunk Enterprise, license acceptance requires an additional `SPLUNK_GENERAL_TERMS=--accept-sgt-current-at-splunk-com` argument. This indicates that users have read and accepted the current/latest version of the Splunk General Terms, available at https://www.splunk.com/en_us/legal/splunk-general-terms.html as may be updated from time to time. Unless you have jointly executed with Splunk a negotiated version of these General Terms that explicitly supersedes this agreement, by accessing or using Splunk software, you are agreeing to the Splunk General Terms posted at the time of your access and use and acknowledging its applicability to the Splunk software. Please read and make sure you agree to the Splunk General Terms before you access or use this software. Only after doing so should you include the `--accept-sgt-current-at-splunk-com` flag to indicate your acceptance of the current/latest Splunk General Terms and launch this software. All examples below have been updated with this change.

If you use the below examples and the ‘--accept-sgt-current-at-splunk-com’ flag, you are indicating that you have read and accepted the current/latest version of the Splunk General Terms, as may be updated from time to time, and acknowledging its applicability to this software - as noted above.

By default, the SPLUNK_GENERAL_TERMS environment variable will be set to an empty string. You must either manually update it to have the required additional value `--accept-sgt-current-at-splunk-com` in the splunk-operator-controller-manager deployment, or you can pass the `SPLUNK_GENERAL_TERMS` parameter with the required additional value to the `make deploy` command.

```
make deploy IMG=docker.io/splunk/splunk-operator:<tag name> WATCH_NAMESPACE="namespace1" RELATED_IMAGE_SPLUNK_ENTERPRISE="splunk/splunk:edge" SPLUNK_GENERAL_TERMS="--accept-sgt-current-at-splunk-com"
```

For more information about this change, see the [Splunk General Terms Migration Documentation](docs/SplunkGeneralTermsMigration.md).

## Prerequisites

You must have [Docker Engine](https://docs.docker.com/install/) installed to
build the Splunk Operator.

This project uses [Go modules](https://blog.golang.org/using-go-modules),
and requires [golang](https://golang.org/doc/install) 1.23.0 or later.
You must `export GO111MODULE=on` if cloning these repositories into your
`$GOPATH` (not recommended).

The [Kubernetes Operator SDK](https://github.com/operator-framework/operator-sdk)
must also be installed to build this project.

```
git clone -b v1.31.0 https://github.com/operator-framework/operator-sdk
cd operator-sdk
make tidy
make install
```

You may need to add `$GOPATH/bin` to your path to run the `operator-sdk`
command line tool:

```
export PATH=${PATH}:${GOPATH}/bin
```

It is also recommended that you install the following golang tools,
which are used by various `make` targets:

```shell
go install golang.org/x/lint/golint
go install golang.org/x/tools/cmd/cover
go install github.com/mattn/goveralls
go get -u github.com/mikefarah/yq/v3
go get -u github.com/go-delve/delve/cmd/dlv
```

## Cloning this repository

```shell
git clone git@github.com:splunk/splunk-operator.git
cd splunk-operator
```

## Repository overview

This repository consists of the following code used to build the splunk-operator binary:

* `main.go`: Provides the main() function, where everything begins
* `apis/`: Source code for the operator's custom resource definition types
* `controllers/`: Used to register controllers that watch for changes to custom resources
* `pkg/splunk/enterprise/`: Source code for controllers that manage Splunk Enterprise resources
* `pkg/splunk/controller/`: Common code shared across Splunk controllers
* `pkg/splunk/common/`: Common code used by most other splunk packages
* `pkg/splunk/client/`: Simple client for Splunk Enterprise REST API
* `pkg/splunk/test/`: Common code used by other packages for unit testing

`main()` uses `controllers` to register all the `enterprise` controllers
that manage custom resources by watching for Kubernetes events.
The `enterprise` controllers are implemented using common code provided
by the `controllers` package. The `enterprise` controllers also use the REST API client
provided in the `pkg/splunk/client` package. The types provided by `apis/` and
common code in the `pkg/splunk/common/` package are used universally. Note that the
source code for `main()` is generated from a template provided by the Operator SDK.

In addition to the source code, this repository includes:

* `tools`: Build scripts, templates, etc. used to build the container image
* `config`: Kubernetes YAML templates used to install the Splunk Operator
* `docs`: Getting Started Guide and other documentation in Markdown format
* `test`: Integration test framework built using Ginko. See [docs](test/README.md) for more info.

## Building the operator

You can build the operator by just running `make`.

Other make targets include (more info below):

* `make all`: builds `manager` executable
* `make test`: Runs unit tests with Coveralls code coverage output to coverage.out
* `make scorecard`: Runs operator-sdk scorecard tests using OLM installation bundle
* `make generate`: runs operator-generate k8s, crds and csv commands, updating installation YAML files and OLM bundle
* `make docker-build`: generates `splunk-operator` container image example `make docker-build IMG=docker.io/splunk/splunk-operator:<tag name>`
* `make docker-buildx`: generates `splunk-operator` container image for multiple platforms, example `make docker-buildx IMG=docker.io/splunk/splunk-operator:<tag name>`
* `make docker-push`: push docker image to given repository example `make docker-push IMG=docker.io/splunk/splunk-operator:<tag name>`
* `make clean`: removes the binary build output and `splunk-operator` container image example `make docker-push IMG=docker.io/splunk/splunk-operator:<tag name>`
* `make run`: runs the Splunk Operator locally, monitoring the Kubernetes cluster configured in your current `kubectl` context
* `make fmt`: runs `go fmt` on all `*.go` source files in this project
* `make bundle-build`: generates `splunk-operator-bundle` bundle container image for OLM example `make bundle-build IMAGE_TAG_BASE=docker.io/splunk/splunk-operator VERSION=<tag name> IMG=docker.io/splunk/splunk-operator:<tag name>`
* `make bundle-push`: push OLM bundle docker image to given repository example `make bundle-push IMAGE_TAG_BASE=docker.io/splunk/splunk-operator VERSION=<tag name> IMG=docker.io/splunk/splunk-operator:<tag name>`
* `make catalog-build`: generates `splunk-operator-catalog` catalog container image example `make catalog-build IMAGE_TAG_BASE=docker.io/splunk/splunk-operator VERSION=<tag name> IMG=docker.io/splunk/splunk-operator:<tag name>`
* `make catalog-push`: push catalog docker image to given repository example`make catalog-push IMAGE_TAG_BASE=docker.io/splunk/splunk-operator VERSION=<tag name> IMG=docker.io/splunk/splunk-operator:<tag name>`

## Deploying the Splunk Operator
`make deploy` command will deploy all the necessary resources to run Splunk Operator like RBAC policies, services, configmaps, deployment. Operator will be installed in `splunk-operator` namespace. If `splunk-operator` namespace does not exist, it will create the namespace. By default `make deploy` will install operator clusterwide. Operator will watch all the namespaces for any splunk enterprise custom resources.

```shell
make deploy IMG=docker.io/splunk/splunk-operator:<tag name>
```

If you want operator for specific namespace then you must pass `WATCH_NAMESPACE` parameter to `make deploy` command

```
make deploy IMG=docker.io/splunk/splunk-operator:<tag name> WATCH_NAMESPACE="namespace1"
```

If you want operator to use specific version of splunk instance, then you must pass `RELATED_IMAGE_SPLUNK_ENTERPRISE` parameter to `make deploy` command

```
make deploy IMG=docker.io/splunk/splunk-operator:<tag name> WATCH_NAMESPACE="namespace1" RELATED_IMAGE_SPLUNK_ENTERPRISE="splunk/splunk:edge"
```

Use this to run the operator as a local foreground process on your machine:

```shell
make run
```

This will use your current Kubernetes context from `~/.kube/config` to manage
resources in your current namespace.

Please see the [Getting Started Documentation](docs/README.md) for more
information, including instructions on how to install the operator in your
cluster.


## License
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fsplunk%2Fsplunk-operator.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fsplunk%2Fsplunk-operator?ref=badge_large)
36 changes: 36 additions & 0 deletions api/platform/v4/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
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 contains API Schema definitions for the platform v4 API group.
// +kubebuilder:object:generate=true
// +groupName=platform.splunk.com
package v4

import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
// GroupVersion is group version used to register these objects.
GroupVersion = schema.GroupVersion{Group: "platform.splunk.com", Version: "v4"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
Loading
Loading