Skip to content

fix(k8s): prevent deploy-stack and port-forward from unconditionally overwriting config with localhost #637

Closed

Description

@dan-petty

Problem Description

Running devops k8s deploy-stack unconditionally initiates background port-forwarding daemons for all deployed Kubernetes services and overwrites user config.yaml with http://localhost:... endpoints:

  • In stack_lifecycle.py, step 6 of deploy_stack unconditionally calls net.port_forward(...) without any CLI option or user opt-in.
  • In networking.py, port_forward unconditionally launches background kubectl port-forward processes and triggers configure_urls(...).
  • In _resolve_accessible_url, preferred localhost ports are checked before testing detected_url, causing localhost forward endpoints to take precedence over actual cluster-accessible endpoints.
  • In _configure_llm_stack_urls, settings.ai.ollama_urls = [ollama_url] wipes out custom or multi-endpoint Ollama configurations.

Proposed Changes

  1. Stack Lifecycle:
    • Add --port-forward / --no-port-forward (default: False) to deploy_stack.
    • Add --configure-urls / --no-configure-urls (default: False) to deploy_stack.
    • Only execute net.port_forward when --port-forward is explicitly requested.
  2. Networking:
    • Add --update-config / --no-update-config (default: False) to port_forward so port forwarding does not automatically rewrite persistent config.yaml.
    • Fix priority order in _resolve_accessible_url: check detected_url reachability first; only fallback to localhost ports if detected_url is unreachable or not detected.
    • In _configure_llm_stack_urls: preserve existing settings.ai.ollama_urls rather than overwriting with a single localhost entry.
  3. Test Coverage:
    • Add unit tests verifying deploy-stack and port-forward default behaviors do not mutate configuration.
    • Verify _resolve_accessible_url endpoint preference for reachable cluster URLs.

Activity

  1. added this to the v0.2.23 milestone on Sep 27, 2026
  2. added
    type/bug
    scope/k8s
    priority/p1-high
    on Sep 27, 2026
  3. dan-petty commented on Sep 27, 2026

    @dan-petty
    OwnerAuthor

    Closed by #638, merged into release/v0.2.23.

    GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by devops gh issues close-merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/k8stype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions