Class PortForwardManager
Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
Implements
Namespace: Neon.Kube.PortForward
Assembly: Neon.Kube.dll
Syntax
public class PortForwardManager : IPortForwardManager
Constructors
PortForwardManager(IKubernetes, ILoggerFactory)
Constructor.
Declaration
public PortForwardManager(IKubernetes k8s, ILoggerFactory loggerFactory = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IKubernetes | k8s | Specifies the Kubernetes client. |
| ILoggerFactory | loggerFactory | Optionally specifies the a logger factory. |
Methods
StartPodPortForward(string, string, int, int, IPAddress, Dictionary<string, List<string>>, CancellationToken)
Establishes a PortForwardStream connection from the local workstation toa pod running in the cluster.
Declaration
public void StartPodPortForward(string name, string @namespace, int localPort, int remotePort, IPAddress localAddress = null, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | |
| string | namespace | |
| int | localPort | Specifies the local port on the workstation. |
| int | remotePort | Specifies the target port for the remotye pod. |
| IPAddress | localAddress | Specifies the listen port. If not set, Loopback is used. |
| Dictionary<string, List<string>> | customHeaders | Optionally specifies any custom connection headers. |
| CancellationToken | cancellationToken | Optionally specifies a cancellation token. |