Skip to content

[Draft]: CSPL-2600: Integrate HashiCorp Vault Support in Splunk Operator #1388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 27 commits into
base: CSPL-2601
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .github/workflows/int-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- develop
- main
- feature**
- CSPL-2600
jobs:
build-operator-image:
runs-on: ubuntu-latest
Expand Down
22 changes: 12 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Default environment is default
ENVIRONMENT=${1:-default}
ENVIRONMENT ?= ${1}
$(ENVIRONMENT):
ENVIRONMENT = default

# VERSION defines the project version for the bundle.
# Update this value when you upgrade the version of your project.
Expand Down Expand Up @@ -185,20 +187,20 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
$(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

deploy: manifests kustomize uninstall ## Deploy controller to the K8s cluster specified in ~/.kube/config.
$(SED) "s/namespace: splunk-operator/namespace: ${NAMESPACE}/g" config/$(ENVIRONMENT)/kustomization.yaml
$(SED) "s/value: WATCH_NAMESPACE_VALUE/value: \"${WATCH_NAMESPACE}\"/g" config/$(ENVIRONMENT)/kustomization.yaml
$(SED) "s|SPLUNK_ENTERPRISE_IMAGE|${SPLUNK_ENTERPRISE_IMAGE}|g" config/$(ENVIRONMENT)/kustomization.yaml
$(SED) "s/namespace: splunk-operator/namespace: ${NAMESPACE}/g" config/${ENVIRONMENT}/kustomization.yaml
$(SED) "s/value: WATCH_NAMESPACE_VALUE/value: \"${WATCH_NAMESPACE}\"/g" config/${ENVIRONMENT}/kustomization.yaml
$(SED) "s|SPLUNK_ENTERPRISE_IMAGE|${SPLUNK_ENTERPRISE_IMAGE}|g" config/${ENVIRONMENT}/kustomization.yaml
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
RELATED_IMAGE_SPLUNK_ENTERPRISE=${SPLUNK_ENTERPRISE_IMAGE} WATCH_NAMESPACE=${WATCH_NAMESPACE} $(KUSTOMIZE) build config/$(ENVIRONMENT) | kubectl apply --server-side --force-conflicts -f -
$(SED) "s/namespace: ${NAMESPACE}/namespace: splunk-operator/g" config/$(ENVIRONMENT)/kustomization.yaml
$(SED) "s/value: \"${WATCH_NAMESPACE}\"/value: WATCH_NAMESPACE_VALUE/g" config/$(ENVIRONMENT)/kustomization.yaml
$(SED) "s|${SPLUNK_ENTERPRISE_IMAGE}|SPLUNK_ENTERPRISE_IMAGE|g" config/$(ENVIRONMENT)/kustomization.yaml
RELATED_IMAGE_SPLUNK_ENTERPRISE=${SPLUNK_ENTERPRISE_IMAGE} WATCH_NAMESPACE=${WATCH_NAMESPACE} $(KUSTOMIZE) build config/${ENVIRONMENT} | kubectl apply --server-side --force-conflicts -f -
$(SED) "s/namespace: ${NAMESPACE}/namespace: splunk-operator/g" config/${ENVIRONMENT}/kustomization.yaml
$(SED) "s/value: \"${WATCH_NAMESPACE}\"/value: WATCH_NAMESPACE_VALUE/g" config/${ENVIRONMENT}/kustomization.yaml
$(SED) "s|${SPLUNK_ENTERPRISE_IMAGE}|SPLUNK_ENTERPRISE_IMAGE|g" config/${ENVIRONMENT}/kustomization.yaml

undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/$(ENVIRONMENT) | kubectl delete -f -
$(KUSTOMIZE) build config/${ENVIRONMENT} | kubectl delete -f -

## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
LOCALBIN ?= "$(shell pwd)/bin"
$(LOCALBIN):
mkdir -p $(LOCALBIN)

Expand Down
22 changes: 22 additions & 0 deletions api/v4/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ 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"`

VaultIntegration VaultIntegration `json:"vaultIntegration,omitempty"`
}

// StorageClassSpec defines storage class configuration
Expand Down Expand Up @@ -569,6 +571,26 @@ type PhaseInfo struct {
FailCount uint32 `json:"failCount,omitempty"`
}

// Vault represents the Vault configuration for enabling secret injection.
// +kubebuilder:object:generate=true
// +kubebuilder:validation:Optional
type VaultIntegration struct {
// Enable vault support
Enable bool `json:"enable,omitempty"`

// Vault Address
Address string `json:"address"`

// Vault Role
Role string `json:"role"`

// Vault secret path
SecretPath string `json:"secretPath"`

// OperatorRole if different from the role
OperatorRole string `json:"operatorRole,omitempty"`
}

const (
// AppPkgDownloadPending indicates pending
AppPkgDownloadPending AppPhaseStatusType = 101
Expand Down
16 changes: 16 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.

Loading
Loading