This pull request introduces comprehensive support for the Splunk plugin within kubectl, enabling seamless interaction and management of Splunk instances deployed in Kubernetes clusters. The enhancements include:
Plugin Functionality: Allows execution of Splunk CLI commands, REST API interactions, file operations, and interactive shell access directly from kubectl.
Authentication Handling: Implements secure credential storage and automatic retrieval of Splunk admin credentials from pods.
Configuration Management: Supports configuration via files, environment variables, and command-line arguments for flexibility and ease of use.
User Experience Enhancements: Adds verbosity levels, caching mechanisms for pod information, and auto-completion support to improve usability.
Documentation: Updates the README.md to provide detailed usage instructions, examples, and configuration guidelines.
Testing: Includes unit tests to ensure reliability and correctness of the plugin's functionalities.
License Update: Apache License 2.0 to align with project requirements.
Related Issue
Closes CSPL-3156
Type of Change
New Feature
Introduces new functionalities to support Splunk operations within kubectl.
Documentation Update
Enhances the README.md with detailed instructions, examples, and license information.
License Change
Updates the project license to Apache License 2.0.
Testing
Adds unit tests to cover the new features and ensure code reliability.
How Has This Been Tested?
Unit Tests
Implemented using Python's unittest framework with unittest.mock for isolating components. All tests pass successfully, ensuring that new functionalities work as intended.
python -m unittest discover -s tests
Manual Testing
Performed manual verification of all plugin modes (exec, rest, cp, interactive) to ensure they function correctly within a Kubernetes cluster with Splunk deployments.
PyPI Deployment
Uploaded the package to PyPI and verified installation and functionality using pip and pipx.
Checklist
[x] Code follows the project’s style guidelines.
[x] Performed a self-review of my own code.
[x] Commented code, particularly in hard-to-understand areas.
[x] Made corresponding changes to the documentation (README.md).
[x] Added tests that prove my fix is effective or that my feature works.
[x] New and existing unit tests pass locally with my changes.
Description
This pull request introduces comprehensive support for the Splunk plugin within
kubectl
, enabling seamless interaction and management of Splunk instances deployed in Kubernetes clusters. The enhancements include:kubectl
.README.md
to provide detailed usage instructions, examples, and configuration guidelines.Related Issue
Closes CSPL-3156
Type of Change
New Feature
Introduces new functionalities to support Splunk operations within
kubectl
.Documentation Update
Enhances the
README.md
with detailed instructions, examples, and license information.License Change
Updates the project license to Apache License 2.0.
Testing
Adds unit tests to cover the new features and ensure code reliability.
How Has This Been Tested?
Unit Tests
Implemented using Python's
unittest
framework withunittest.mock
for isolating components. All tests pass successfully, ensuring that new functionalities work as intended.Manual Testing
Performed manual verification of all plugin modes (
exec
,rest
,cp
,interactive
) to ensure they function correctly within a Kubernetes cluster with Splunk deployments.PyPI Deployment
Uploaded the package to PyPI and verified installation and functionality using
pip
andpipx
.Checklist
README.md
).LICENSE
file to Apache License 2.0.README.md
reflecting the license change.License
This project is now licensed under the Apache License 2.0. Please see the
LICENSE
file for details.Additional Information
~/.kubectl_splunk_config
~/.kubectl_splunk_credentials
/tmp/kubectl_splunk_cache.json
argcomplete