Kubernetes Port Forward – Extension
A Visual Studio Code extension that simplifies port forwarding for Kubernetes services with an interactive UI.
Features
- List all available services across namespaces or in a specific namespace
- Select one or multiple services simultaneously for single or batch port forwarding
- Select services and environments (dev, qa, stg, prod, default) through an intuitive UI
- Automatic port detection for Kubernetes services
- Custom local and remote port configuration
- Real-time status updates with spinner animations
- Dedicated output channel for each port-forwarding session
- Option to view real-time logs for the selected service
Requirements
- Kubernetes CLI (
kubectl) installed and configured
- Access to a Kubernetes cluster
- Kubernetes pods following the naming convention described below
Service Naming Convention
This extension expects Kubernetes pods to follow a specific naming pattern:
<service-name>-<deployment-id>
Where:
<service-name>: The actual service name
<deployment-id>: The deployment identifier (typically auto-generated by Kubernetes)
Example:
dev-identity-services-auth-claim-store-66ff887974-hg8td
In this example:
- Service name:
dev-identity-services-auth-claim-store
- Deployment ID:
66ff887974-hg8td
The extension will extract the service name from this pattern and group services by name across environments.
Usage
- Open the Command Palette (
Ctrl+Shift+P / Cmd+Shift+P)
- Type "Kubernetes: Port Forward" and select the command
- Select a namespace from the list (or choose
--all-namespaces to search across all)
- Select one or multiple services from the list using the multi-select picker
- For each selected service:
- Choose an environment (dev, qa, stg, prod, default)
- Enter a local port (default: 3000)
- Confirm or modify the detected destination port
- The extension will start port forwarding in a dedicated terminal
- Choose whether to view real-time logs for the service (Yes/No)
- If you select "Yes", logs will appear in a separate terminal window
- The extension processes each service sequentially, allowing you to configure each one individually
- Each service gets its own terminal session with a unique name format:
k8s — <env~><service-name>:<local-port>
Extension Settings
This extension does not contribute any settings yet.
Known Issues
Please report issues on the GitHub repository.
Release Notes
0.0.17
- Multi-select support for services
- Port forwarding functionality
- Service discovery across namespaces
- Environment selection (dev, qa, stg, prod, default)
- Real-time logs for the selected service
0.0.1
License
This extension is licensed under the MIT License.
| |