Skip to content

Add support for multiple namespaces #107

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 2 commits into
base: main
Choose a base branch
from
Open

Conversation

blink-so[bot]
Copy link

@blink-so blink-so bot commented Jun 3, 2025

This PR addresses issue #5 by adding support for watching pods across multiple namespaces.

Changes

Core Functionality

  • Multi-namespace support: CODER_NAMESPACE now accepts comma-separated list of namespaces
  • All-namespace support: Empty CODER_NAMESPACE watches all namespaces cluster-wide
  • Backward compatibility: Single namespace deployments continue to work unchanged

RBAC Improvements

  • Smart RBAC: Automatically uses ClusterRole/ClusterRoleBinding for multi-namespace scenarios
  • Namespace-scoped: Uses Role/RoleBinding for single namespace deployments
  • Configurable: rbac.clusterWide option for manual override

Helm Chart Updates

  • New values: namespaces parameter replaces namespace (backward compatible)
  • Automatic detection: Chart determines RBAC scope based on namespace configuration
  • Documentation: Comprehensive examples for all use cases

Documentation

  • Updated README: Clear examples for single, multiple, and all-namespace deployments
  • RBAC guide: Explains permission requirements for different scenarios
  • Migration guide: Smooth transition from single to multi-namespace setups

Usage Examples

Single namespace (existing behavior):

helm install coder-logstream-kube coder-logstream-kube/coder-logstream-kube \
    --set url=https://coder.example.com \
    --set namespaces="coder-workspaces"

Multiple namespaces:

helm install coder-logstream-kube coder-logstream-kube/coder-logstream-kube \
    --set url=https://coder.example.com \
    --set namespaces="user1,user2,user3"

All namespaces:

helm install coder-logstream-kube coder-logstream-kube/coder-logstream-kube \
    --set url=https://coder.example.com \
    --set namespaces=""

Testing

  • Code compiles successfully
  • Maintains backward compatibility
  • Added unit tests for namespace parsing logic

Fixes #5

blink-so bot added 2 commits June 3, 2025 14:31
- Allow CODER_NAMESPACE to accept comma-separated list of namespaces
- Support watching all namespaces when CODER_NAMESPACE is empty
- Automatically use ClusterRole/ClusterRoleBinding for multi-namespace or all-namespace scenarios
- Update Helm chart to support both namespace-scoped and cluster-wide RBAC
- Add comprehensive documentation for multi-namespace usage
- Maintain backward compatibility with single namespace deployments

Fixes #5
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.

Don't limit CODER_NAMESPACE to a single namespace
0 participants