splunk

package module
v0.0.0-...-6d46272 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 16 Imported by: 1

README

How we added/built stand-alone tests for Splunk

  • git clone
  • mkdir/splunk
  • cd splunk/
  • go mod init github.com/aws/aws-k8s-tester/k8s-tester/splunk
  • Create a file to implement the Tester Interface. touch tester.go
  • copy a vend file from another package cp ../vend.sh .
  • Write tests
  • run ./vend.sh
  • run go mod tidy -v

Test/Run singe test stand-alone

go run cmd/k8s-tester-splunk/main.go apply \
    --kubectl-path="/usr/local/bin/kubectl" \
    --kubeconfig-path="/Path/to/kubeconfig" \
    --access-key="1234567890" \
    --splunk-realm="us1" \
    --log-outputs="splunk.log"

## Delete
go run cmd/k8s-tester-splunk/main.go delete \
    --kubectl-path="/usr/local/bin/kubectl" \
    --kubeconfig-path="/Path/to/kubeconfig" \
    --access-key="1234567890" \
    --collector-endpoint="us2.app.splunk.com" \
    --log-outputs="splunk.log"

This test is equivilant to running this set of commands

helm repo add splunk-otel-collector-chart https://signalfx.github.io/splunk-otel-collector-chart && helm repo update


helm install --set provider='aws' --set distro='eks' --set splunkAccessToken='1234567890' --set clusterName='eks-anywhere-cluster' --set splunkRealm='us1' --set otelCollector.enabled='false'
--generate-name splunk-otel-collector-chart/splunk-otel-collector


Documentation

Overview

package splunk installs splunk Otel Collector. ref. https://github.com/signalfx/splunk-otel-collector-chart

Index

Constants

View Source
const (
	DefaultMinimumNodes     int = 1
	DefaultHelmChartRepoURL     = "" /* 135-byte string literal not displayed */
)

Variables

This section is empty.

Functions

func Env

func Env() string

func New

func New(cfg *Config) k8s_tester.Tester

Types

type Config

type Config struct {
	Enable bool `json:"enable"`
	Prompt bool `json:"-"`

	Stopc     chan struct{} `json:"-"`
	Logger    *zap.Logger   `json:"-"`
	LogWriter io.Writer     `json:"-"`
	Client    client.Client `json:"-"`

	// MinimumNodes is the minimum number of Kubernetes nodes required for installing this addon.
	MinimumNodes int `json:"minimum_nodes"`
	// HelmChartRepoURL is the helm chart repo URL.
	HelmChartRepoURL string `json:"helm_chart_repo_url"`
	// Namespace to create test resources.
	Namespace string `json:"namespace"`
	// Splunk access key for the Splunk agent
	AccessKey string `json:"access_key"`
	// SplunkRealm is the region for the splunk endpoint
	SplunkRealm string `json:"splunk_realm"`
}

func NewDefault

func NewDefault() *Config

func (*Config) ValidateAndSetDefaults

func (cfg *Config) ValidateAndSetDefaults() error

Directories

Path Synopsis
cmd
k8s-tester-splunk
k8s-tester-splunk installs Splunk agent using helm, and tests that it's able to function correctly.
k8s-tester-splunk installs Splunk agent using helm, and tests that it's able to function correctly.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL