src/portforward
PortForward
class PortForward portForward
public async portForward(
namespace: string, podName: string, targetPorts: number[], output: stream.Writable, err: stream.Writable | null, input: stream.Readable, retryCount: number = 0, ): Promise<WebSocket.WebSocket | (() => WebSocket.WebSocket | null)> portForwardService
Port forward to a service by resolving to the first ready pod selected by the service's selector.Parameters
namespace - The namespace of the service
serviceName - The name of the service
targetPorts - The target ports to forward to
output - The writable stream for output
err - The writable stream for error output (can be null)
input - The readable stream for input
retryCount - The number of times to retry the connection
throwsWill throw an error if the service is not found or has no ready pods
public async portForwardService(
namespace: string, serviceName: string, targetPorts: number[], output: stream.Writable, err: stream.Writable | null, input: stream.Readable, retryCount: number = 0, ): Promise<WebSocket.WebSocket | (() => WebSocket.WebSocket | null)> portForwardDeployment
Port forward to a deployment by resolving to the first ready pod selected by the deployment's selector.Parameters
namespace - The namespace of the deployment
deploymentName - The name of the deployment
targetPorts - The target ports to forward to
output - The writable stream for output
err - The writable stream for error output (can be null)
input - The readable stream for input
retryCount - The number of times to retry the connection
throwsWill throw an error if the deployment is not found or has no ready pods
public async portForwardDeployment(
namespace: string, deploymentName: string, targetPorts: number[], output: stream.Writable, err: stream.Writable | null, input: stream.Readable, retryCount: number = 0, ): Promise<WebSocket.WebSocket | (() => WebSocket.WebSocket | null)>