Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add multi-namespace support#124

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
kacpersaw merged 3 commits intomainfromkacpersaw/feat-watch-multiple-namespaces
Aug 26, 2025

Conversation

kacpersaw
Copy link
Contributor

Description

This PR adds multi-namespace support to coder-logstream-kube, allowing users to monitor pod events across multiple namespaces or all namespaces in a cluster. This replaces the previous single-namespace limitation.

Closes#5

Changes

  • Multi-namespace monitoring: The service can now watch multiple namespaces simultaneously or all namespaces when none are specified
  • Namespace filtering: Users can specify a comma-separated list of namespaces to monitor via the--namespaces flag orCODER_NAMESPACES environment variable

Kubernetes RBAC Updates

  • ClusterRole/ClusterRoleBinding: Upgraded from Role/RoleBinding to ClusterRole/ClusterRoleBinding to support cross-namespace access

Configuration Changes

  • Helm values: Updatedvalues.yaml to usenamespaces array instead of singlenamespace string
  • Environment variables: Changed fromCODER_NAMESPACE toCODER_NAMESPACES (comma-separated)
  • Command line flags: Updated--namespace flag to--namespaces with comma-separated support

Example

# Command line./coder-logstream-kube --namespaces"default,kube-system,my-app"# Environment variableexport CODER_NAMESPACES="default,kube-system,my-app"./coder-logstream-kube# Helmhelm install coder-logstream-kube coder-logstream-kube/coder-logstream-kube \    --set namespaces[0]=default \    --set namespaces[1]=kube-system \    --set namespaces[2]=my-app

Breaking Changes

  • Environment variable:CODER_NAMESPACE is replaced withCODER_NAMESPACES
  • Command line flag:--namespace is replaced with--namespaces
  • Helm values:namespace string is replaced withnamespaces array

@kacpersawkacpersaw marked this pull request as ready for reviewAugust 25, 2025 08:01
@@ -1,5 +1,5 @@
apiVersion:rbac.authorization.k8s.io/v1
kind:Role
kind:ClusterRole
Copy link
Member

Choose a reason for hiding this comment

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

If namespaces are specified, this should probably be a for loop to create the role and role binding in each namespace, rather than granting full cluster permissions

You should probably make the permissions block a reusable template though

kacpersaw reacted with thumbs up emoji
Comment on lines 79 to 80
-name:CODER_NAMESPACES
value:{{if .Values.namespaces }}{{ join "," .Values.namespaces }}{{ else }}{{ end }}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
-name:CODER_NAMESPACES
value:{{ if .Values.namespaces }}{{ join "," .Values.namespaces }}{{ else }}{{ end }}
{{ if .Values.namespaces -}}
-name:CODER_NAMESPACES
value:"{{ join"," .Values.namespaces }}"
{{ end -}}

kacpersaw reacted with thumbs up emoji

// init starts the informer factory and registers event handlers.
func (p*podEventLogger)init()error {
func (p*podEventLogger)initNamespace(namespacestring)error {
Copy link
Member

Choose a reason for hiding this comment

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

Should include a sentence in the method comment explaining thenamespace parameter

kacpersaw reacted with thumbs up emoji
namespace:""
# namespace --List of namespacestosearch for Pods within.
# If unspecified or empty it will watch all namespaces.
namespaces:[]
Copy link
Member

Choose a reason for hiding this comment

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

This is breaking so make sure you inform customers in the release notes.

@kacpersawkacpersaw merged commitbca9af2 intomainAug 26, 2025
1 check passed
@kacpersawkacpersaw deleted the kacpersaw/feat-watch-multiple-namespaces branchAugust 26, 2025 08:53
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@deansheatherdeansheatherdeansheather approved these changes

@ethanndicksonethanndicksonAwaiting requested review from ethanndickson

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Don't limit CODER_NAMESPACE to a single namespace
2 participants
@kacpersaw@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp