adding service watcher #2288
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!2288
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2288/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub pull request.
Original GitHub pull request: #1717
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1717
Original created: 2025-10-06T00:42:14Z
Original updated: 2025-10-06T00:43:34Z
Original head: carverauto/serviceradar:k8s/auth_kong_jwks_issue
Original base: main
Original merged: 2025-10-06T00:42:56Z by @mfreeman451
PR Type
Enhancement
Description
Add Kong configuration watcher sidecar container
Implement dynamic Kong config updates via serviceradar-cli
Configure JWKS authentication and service routing
Add resource limits and health checks
Diagram Walkthrough
File Walkthrough
serviceradar-kong.yaml
Add Kong configuration watcher sidecark8s/demo/base/serviceradar-kong.yaml
kong-config-watchersidecar container to Kong deploymentauthentication
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1717#issuecomment-3369582335
Original created: 2025-10-06T00:42:32Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
Insecure admin API access
Description: The sidecar executes a shell loop with 'curl' to Kong Admin API on 127.0.0.1:8001 without
TLS or authentication, exposing the admin interface to unauthenticated local access if the
admin API is not otherwise restricted and risking config tampering if the container is
compromised.
serviceradar-kong.yaml [97-126]
Referred Code
🎫 No ticket provided
Codebase context is not defined
Follow the guide to enable codebase context checks.
No custom compliance provided
Follow the guide to enable custom compliance check.
Compliance status legend
🟢 - Fully Compliant🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1717#issuecomment-3369583567
Original created: 2025-10-06T00:43:34Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Consider using a Kubernetes Operator
It is suggested to replace the current polling-based sidecar script with a
dedicated Kubernetes Operator. This change would create a more robust,
event-driven, and idiomatic solution for managing Kong's configuration.
Examples:
k8s/demo/base/serviceradar-kong.yaml [90-136]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 8
__
Why: This is a significant architectural suggestion that correctly identifies the current polling sidecar's limitations and proposes a more robust, scalable, and idiomatic Kubernetes-native solution.
Ensure atomic configuration updates
To ensure configuration consistency, first apply the new configuration from the
temporary file to Kong, and only move it to
/opt/kong/kong.ymlif theapplication is successful.
k8s/demo/base/serviceradar-kong.yaml [114-124]
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies a logic flaw where the on-disk configuration file is updated before a successful application to Kong, potentially leaving the system in an inconsistent state. The proposed change makes the update process more atomic and robust.
Ensure temporary file cleanup on exit
Add a
trapcommand to ensure the temporary file created bymktempis cleaned upwhen the script exits unexpectedly.
k8s/demo/base/serviceradar-kong.yaml [113-124]
Suggestion importance[1-10]: 5
__
Why: The suggestion correctly points out a missing cleanup mechanism for temporary files upon script termination, which is a good shell scripting practice. While this improves robustness, the impact is minor as the container's temporary filesystem is ephemeral.