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 to manage Splunk-specific custom resources, following best practices to manage all the underlying Kubernetes objects for you.
This repository is used to build the Splunk 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.
You must have Docker Engine installed to build the Splunk Operator.
This project now uses Go modules,
which requires golang 1.12 or later.
You must export GO111MODULE=on
if cloning these repositories into your
$GOPATH
(not recommended).
The Kubernetes Operator SDK must also be installed to build this project.
git clone -b v0.10.0 https://github.com/operator-framework/operator-sdk
cd operator-sdk
make install
You may need to add $GOPATH/bin
to you path to run the operator-sdk
command line tool:
export PATH=${PATH}:${GOPATH}/bin
git clone git@github.com:splunk/splunk-operator.git
cd splunk-operator
You can build the operator by just running make
.
Other make targets include (more info below):
make all
: builds thesplunk/splunk-operator
docker image (same asmake splunk-operator
)make splunk-operator
: builds thesplunk/splunk-operator
docker imagemake package
: generates tarball of thesplunk/splunk-operator
docker image and installation YAML filemake run
: runs the splunk operator locally, monitoring the Kubernetes cluster configured in your currentkubectl
context
If you are using a local, single-node Kubernetes cluster like
minikube or Docker Desktop,
you only need to build the splunk/splunk-operator
image.
You can skip the rest of this section.
If possible, we recommend re-tagging your custom-built images and pushing them to a remote registry that your Kubernetes workers are able to pull from. Please see the Required Images Documentation for more information.
Use this to run the operator as a local foreground process on your machine:
make run
This will use your current Kubernetes context from ~/.kube/config
.
You can install and start the operator by running
kubectl apply -f deploy/all-in-one.yaml
Note that deploy/all-in-one.yaml
uses the image name splunk/splunk-operator
.
If you pushed this image to a remote registry, you need to change the image
parameter in this file to refer to the correct location.
You can stop and remove the operator by running
kubectl delete -f deploy/all-in-one.yaml
Please see the Getting Started Documentation for more information.