public class PortForward
extends java.lang.Object
The protocol is undocumented as far as I can tell, but the PR that added it is here: https://github.com/kubernetes/kubernetes/pull/33684
And the protocol is:
ws://server/api/v1/namespaces/ I/O for first port (80) is on Channel 0 Err for first port (80) is on Channel 1 I/O for second
port (8080) is on Channel 2 Err for second port (8080) is on Channel 3 The first two bytes of each output stream is the port that is being forwarded in little-endian
format.
Modifier and Type | Class and Description |
---|---|
static class |
PortForward.PortForwardResult
PortForwardResult contains the result of an Attach call, it includes streams for stdout stderr
and stdin.
|
Constructor and Description |
---|
PortForward()
Simple PortForward API constructor, uses default configuration
|
PortForward(io.kubernetes.client.openapi.ApiClient apiClient)
PortForward API Constructor
|
Modifier and Type | Method and Description |
---|---|
PortForward.PortForwardResult |
forward(java.lang.String namespace,
java.lang.String name,
java.util.List<java.lang.Integer> ports)
PortForward to a container.
|
PortForward.PortForwardResult |
forward(io.kubernetes.client.openapi.models.V1Pod pod,
java.util.List<java.lang.Integer> ports)
PortForward to a container
|
io.kubernetes.client.openapi.ApiClient |
getApiClient()
Get the API client for these PortForward operations.
|
void |
setApiClient(io.kubernetes.client.openapi.ApiClient apiClient)
Set the API client for subsequent PortForward operations.
|
public PortForward()
public PortForward(io.kubernetes.client.openapi.ApiClient apiClient)
apiClient
- The api client to use.public io.kubernetes.client.openapi.ApiClient getApiClient()
public void setApiClient(io.kubernetes.client.openapi.ApiClient apiClient)
apiClient
- The new API client to use.public PortForward.PortForwardResult forward(io.kubernetes.client.openapi.models.V1Pod pod, java.util.List<java.lang.Integer> ports) throws io.kubernetes.client.openapi.ApiException, java.io.IOException
pod
- The pod where the port forward is run.ports
- The ports to forwardio.kubernetes.client.openapi.ApiException
java.io.IOException
public PortForward.PortForwardResult forward(java.lang.String namespace, java.lang.String name, java.util.List<java.lang.Integer> ports) throws io.kubernetes.client.openapi.ApiException, java.io.IOException
namespace
- The namespace of the Podname
- The name of the Podports
- The ports to forwardio.kubernetes.client.openapi.ApiException
java.io.IOException
Copyright © 2019. All rights reserved.