CLAUDE.md - StreamNative Tools Documentation
This file provides guidance to Claude Code (claude.ai/code) when working with StreamNative tools documentation.Purpose
Thetools/ directory contains documentation for command-line tools, operators, and infrastructure-as-code tools that help manage and interact with StreamNative platform.
Directory Structure
- cli/: Command-line interface documentation
snctl- StreamNative CLI for cloud managementpulsarctl- Pulsar administration CLI
- operator/: Kubernetes operator documentation
- terraform/: Terraform provider documentation
Source Code Repository Mappings
CLI Tools
- cloud-cli (
source_code_refs/cloud-cli/): snctl - StreamNative CLI- Go-based CLI for StreamNative Cloud management
- Key directories:
cmd/: Command implementationspkg/: Core functionality and API clientsdocs/: Auto-generated command documentation
- Installation script:
install.sh - Note: Reference docs synced from
sn-doc-referencesrepo
Kubernetes Operators
-
sn-operator (
source_code_refs/sn-operator/): StreamNative Operator- Main operator for StreamNative platform on Kubernetes
- Controllers for various components:
- PulsarCoordinator: Orchestrates Pulsar clusters
- KafkaConnect: Manages Kafka Connect clusters
- OxiaCluster: Manages Oxia metadata stores
- PfSQLCluster: Manages PfSQL compute clusters
- CRD definitions in
config/crd/
-
pulsar-resources-operator (
source_code_refs/pulsar-resources-operator/): Resource management- Manages Pulsar resources declaratively
- Resources: tenants, namespaces, topics, permissions
- Service accounts and bindings
- Connection management
Infrastructure as Code
-
terraform-provider-pulsar (
source_code_refs/terraform-provider-pulsar/): Pulsar provider- Manages Pulsar resources via Terraform
- Resources: clusters, tenants, namespaces, topics, functions
- Works with both cloud and self-hosted Pulsar
- Examples in
examples/directory
-
terraform-provider-streamnative (
source_code_refs/terraform-provider-streamnative/): StreamNative provider- Manages StreamNative Cloud resources
- Resources: instances, clusters, service accounts, API keys
- Cloud-specific features: cloud connections, environments
- Data sources for querying existing resources
-
terraform-managed-cloud (
source_code_refs/terraform-managed-cloud/): Terraform modules- Pre-built modules for common scenarios
- Vendor access configurations
- Best practice examples
Documentation Patterns
CLI Documentation
- Overview: Purpose and capabilities
- Installation: Multiple installation methods
- Authentication: Login and credential management
- Command Reference: Auto-generated from source
- Examples: Common workflows and use cases
- Configuration: Config file and environment variables
Operator Documentation
- Architecture: How operators work
- Installation: Helm charts, manifests, OLM
- CRD Reference: Resource specifications
- Configuration: Operator and resource configuration
- Operations: Upgrades, monitoring, troubleshooting
- Examples: Sample deployments
Terraform Documentation
- Provider Setup: Authentication and configuration
- Resource Reference: All managed resources
- Data Sources: Querying existing resources
- Examples: Complete configurations
- Migration: From manual to IaC
- Best Practices: State management, modules
SNIP References
Checksource_code_refs/snip/proposals/ for design documents related to:
- Operator improvements (SNIP-104, SNIP-118, SNIP-125)
- CLI enhancements (related to cloud features)
- Resource management (SNIP-108 for RBAC)
- Private cloud tooling (SNIP-124)
Common Tasks
Adding CLI Commands
- Check
cloud-cli/cmd/for command structure - Document command syntax and flags
- Include practical examples
- Show output formats (JSON, table, etc.)
- Cover error cases and troubleshooting
Documenting Operators
-
CRD Documentation:
- Extract schema from operator source
- Document each field with examples
- Show field relationships and dependencies
- Include validation rules
-
Operational Guides:
- Installation procedures
- Upgrade strategies
- Backup and recovery
- Performance tuning
- Multi-cluster scenarios
Terraform Provider Updates
- Document new resources or data sources
- Show complete configuration examples
- Explain state management implications
- Include import procedures for existing resources
- Document breaking changes and migrations
Important Workflows
Cloud Management (snctl)
- Organization and user management
- Instance and cluster lifecycle
- Service account and API key management
- Monitoring and troubleshooting
- Cost management and billing
Pulsar Administration (pulsarctl)
- Cluster health checks
- Topic and namespace management
- Security configuration
- Performance tuning
- Data migration
GitOps with Operators
- Declarative resource management
- CI/CD integration
- Multi-environment deployments
- Configuration drift detection
- Disaster recovery
Infrastructure as Code
- Environment provisioning
- Configuration management
- Compliance and governance
- Cost optimization
- Multi-cloud deployments
Cross-References
- Cloud docs for snctl cloud features
- Private Cloud docs for operator deployment
- Connect docs for connector management via CLI
- API docs for understanding CLI operations
Tool Integration Points
- snctl + Terraform: Provisioning and configuration
- Operators + GitOps: Declarative deployments
- pulsarctl + Monitoring: Operational visibility
- All tools + CI/CD: Automation workflows
Best Practices Documentation
- Security: Credential management, RBAC, secrets
- Automation: Scripts, pipelines, GitOps
- Monitoring: Metrics, logs, alerts
- Disaster Recovery: Backups, failover, restoration
- Performance: Optimization, scaling, tuning