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 image
)make image
: builds thesplunk/splunk-operator
docker imagemake package
: generates tarball of thesplunk/splunk-operator
docker image and installation YAML filemake local
: builds the splunk-operator-local binary for test and debugging purposesmake clean
: removes the binary build output andsplunk/splunk-operator
container imagemake run
: runs the splunk operator locally, monitoring the Kubernetes cluster configured in your currentkubectl
contextmake fmt
: runsgo fmt
on all*.go
source files in this projectmake lint
: runs thegolint
utility on all*.go
source files in this project
Ensure that you have the SplunkEnterprise
Custom Resource Definition installed
in your cluster:
kubectl apply -f deploy/crds/enterprise_v1alpha1_splunkenterprise_crd.yaml
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
to manage
resources in your current namespace.
Please see the Getting Started Documentation for more information, including instructions on how to install the operator in your cluster.