Skip to content

Conversation

@vivekr-splunk
Copy link
Collaborator

Adds a step-by-step Federated Search setup guide for SVA-C3 (Search Head Cluster + Indexer Cluster) using the Splunk Operator for Kubernetes, with NGINX Ingress between LOCAL and REMOTE SHCs. The guide is generalized from a path validated with the NCDOC customer. It covers prerequisites, REMOTE preparation, LOCAL configuration via a lightweight app and AppFramework, manual install, validation, troubleshooting, security, performance notes, and maintenance.

Key Changes

  • New guide: docs/federated-search/federated-search-setup.md

  • Optional, if your repo uses a docs index or nav

    • Add a link in docs/README.md
    • Update mkdocs.yml navigation

Testing and Verification

  • Verified Markdown renders in GitHub preview

  • Ran link checks on internal anchors and external references

  • Linted Markdown locally

  • Validated YAML snippets for basic syntax in fenced blocks

  • Smoke tested representative commands on an SVA-C3 dev environment

    • Created role and service account on REMOTE
    • Confirmed management API reachability through NGINX Ingress
    • Verified federated provider and federated index resolution on LOCAL
    • Confirmed example searches return results from federated:r_audit
  • No automated tests added, documentation only

Related Issues

  • Jira, CSPL-4134: SOK-#### Document Federated Search setup for SVA-C3 using SOK with NGINX Ingress
  • Add related GitHub issue IDs if applicable

PR Checklist

  • Code changes adhere to the project's coding standards.
    N/A, documentation only.
  • Relevant unit and integration tests are included.
    N/A, documentation only.
  • Documentation has been updated accordingly.
  • All tests pass locally.
    Markdown lint and link checks pass.
  • The PR description follows the project's guidelines.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a comprehensive guide for configuring Federated Search between LOCAL and REMOTE Splunk Search Head Clusters (SHCs) in a Kubernetes environment using the Splunk Operator and NGINX Ingress. The guide enables users to query data from a remote cluster as if it were local, facilitating cross-cluster search capabilities.

Key Changes:

  • Step-by-step setup instructions for REMOTE cluster preparation (service accounts, roles, NGINX Ingress configuration)
  • LOCAL cluster configuration using AppFramework with federated provider and index definitions
  • Validation procedures, troubleshooting guidance, and maintenance workflows

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +120 to +121
-d "srchIndexesAllowed=_audit" \
-d "srchIndexesAllowed=demo" \
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple -d flags with the same parameter name srchIndexesAllowed may not work as intended. Consider using comma-separated values in a single parameter: -d 'srchIndexesAllowed=_audit,demo' or verify that the Splunk API supports this pattern.

Suggested change
-d "srchIndexesAllowed=_audit" \
-d "srchIndexesAllowed=demo" \
-d "srchIndexesAllowed=_audit,demo" \

Copilot uses AI. Check for mistakes.
Comment on lines +152 to +158
Fix the permission issue by adding the `search` capability:

```bash
kubectl -n $NAMESPACE exec $REMOTE_POD -c splunk -- curl -sk \
-u "admin:$REMOTE_ADMIN" \
-X POST "https://localhost:8089/services/authorization/roles/admin" \
-d "capabilities=search"
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using -d 'capabilities=search' will replace all existing capabilities on the admin role with only 'search', potentially breaking admin functionality. Use add_capabilities or append with += if the API supports it, or document that this overwrites all capabilities.

Suggested change
Fix the permission issue by adding the `search` capability:
```bash
kubectl -n $NAMESPACE exec $REMOTE_POD -c splunk -- curl -sk \
-u "admin:$REMOTE_ADMIN" \
-X POST "https://localhost:8089/services/authorization/roles/admin" \
-d "capabilities=search"
Fix the permission issue by adding the `search` capability (without overwriting existing admin capabilities):
> **Note:** Using `add_capabilities=search` will add the `search` capability to the admin role without removing existing capabilities. Do **not** use `capabilities=search`, as that will overwrite all current capabilities and may break admin functionality.
```bash
kubectl -n $NAMESPACE exec $REMOTE_POD -c splunk -- curl -sk \
-u "admin:$REMOTE_ADMIN" \
-X POST "https://localhost:8089/services/authorization/roles/admin" \
-d "add_capabilities=search"

Copilot uses AI. Check for mistakes.
kubectl -n $NAMESPACE exec $LOCAL_POD -c splunk -- curl -sk \
-u "admin:$LOCAL_ADMIN" \
-X POST "https://localhost:8089/services/authorization/roles/admin" \
-d "capabilities=search"
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using -d 'capabilities=search' will replace all existing capabilities on the admin role with only 'search', potentially breaking admin functionality. Use add_capabilities or append with += if the API supports it, or document that this overwrites all capabilities.

Suggested change
-d "capabilities=search"
-d "add_capabilities=search"

Copilot uses AI. Check for mistakes.
Comment on lines +545 to +550
**Solution:**
```bash
# On BOTH LOCAL and REMOTE clusters
kubectl -n $NAMESPACE exec <pod-name> -c splunk -- curl -sk \
-u "admin:<password>" \
-X POST "https://localhost:8089/services/authorization/roles/admin" \
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using -d 'capabilities=search' will replace all existing capabilities on the admin role with only 'search', potentially breaking admin functionality. Use add_capabilities or append with += if the API supports it, or document that this overwrites all capabilities.

Suggested change
**Solution:**
```bash
# On BOTH LOCAL and REMOTE clusters
kubectl -n $NAMESPACE exec <pod-name> -c splunk -- curl -sk \
-u "admin:<password>" \
-X POST "https://localhost:8089/services/authorization/roles/admin" \
**Solution:**
> **Note:** Using `-d "capabilities=search"` will overwrite all existing capabilities for the admin role, which may break admin functionality.
> If your Splunk API supports appending capabilities, use `add_capabilities=search` instead to safely add the `search` capability without removing others:
```bash
# On BOTH LOCAL and REMOTE clusters
kubectl -n $NAMESPACE exec <pod-name> -c splunk -- curl -sk \
-u "admin:<password>" \
-X POST "https://localhost:8089/services/authorization/roles/admin" \
-d "add_capabilities=search"

If add_capabilities is not supported, back up your current admin capabilities first and be aware that the following will replace all capabilities with only search:

# On BOTH LOCAL and REMOTE clusters
kubectl -n $NAMESPACE exec <pod-name> -c splunk -- curl -sk \
  -u "admin:<password>" \
  -X POST "https://localhost:8089/services/authorization/roles/admin" \

Copilot uses AI. Check for mistakes.
Comment on lines +763 to +766
kubectl -n $NAMESPACE exec $REMOTE_POD -c splunk -- curl -sk \
-u "admin:<password>" \
"https://localhost:8089/services/authorization/roles/fsh_user" \
-d "srchIndexesAllowed=new_index"
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command will replace all existing srchIndexesAllowed values with only 'new_index', removing access to previously configured indexes like '_audit' and 'demo'. Use an HTTP GET to retrieve current values first, or document that users must include all desired indexes in the command.

Copilot uses AI. Check for mistakes.
@coveralls
Copy link
Collaborator

coveralls commented Oct 22, 2025

Pull Request Test Coverage Report for Build 18706609002

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.008%) to 86.544%

Files with Coverage Reduction New Missed Lines %
pkg/splunk/enterprise/afwscheduler.go 1 92.9%
Totals Coverage Status
Change from base Build 18653942794: -0.008%
Covered Lines: 10709
Relevant Lines: 12374

💛 - Coveralls

- Kubernetes cluster with Splunk Operator deployed
- Two separate SearchHeadClusters (LOCAL and REMOTE)
- IndexerClusters connected to both SHCs
- Azure Storage Account (for AppFramework)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this document apply only to Azure? If so, would be good to mention it above at the beginning of the doc.

- Azure Managed Identity with Storage Blob Data Contributor role

### Network Requirements
- NGINX Ingress Controller installed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question about nginx


## Additional Resources

- [Splunk Federated Search Documentation](https://docs.splunk.com/Documentation/Splunk/latest/DistSearch/Setupfederatedsearch)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It returns 404


```bash
# Connect to REMOTE SHC pod
REMOTE_POD="splunk-remote-shc-search-head-0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this guaranteed to be search-head-0, or should we update the documentation to find the captain search head?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants