public class Tiller extends Object implements ConfigAware<Config>, Closeable
ReleaseServiceGrpc
Modifier and Type | Field and Description |
---|---|
static Map<String,String> |
DEFAULT_LABELS
The Kubernetes labels with which most Tiller instances are
annotated.
|
static String |
DEFAULT_NAMESPACE
The Kubernetes namespace into which Tiller server instances are
most commonly installed.
|
static int |
DEFAULT_PORT
The port on which Tiller server instances most commonly listen.
|
static int |
MAX_MESSAGE_SIZE
The maximum size, in bytes, that messages destined for Tiller may
be.
|
static String |
VERSION
The version of Tiller
Tiller instances expect. |
Constructor and Description |
---|
Tiller(LocalPortForward portForward)
Creates a new
Tiller that will use information from the
supplied LocalPortForward to establish a communications
channel with the Tiller server. |
Tiller(ManagedChannel channel)
Creates a new
Tiller that will use the supplied ManagedChannel for communication. |
Tiller(T client)
Creates a new
Tiller that will forward a local port to
port 44134 on a Pod housing Tiller in the kube-system namespace running in the Kubernetes cluster with
which the supplied KubernetesClient is capable of
communicating. |
Tiller(T client,
String namespaceHousingTiller)
Creates a new
Tiller that will forward a local port to
port 44134 on a Pod housing Tiller in the supplied
namespace running in the Kubernetes cluster with which the
supplied KubernetesClient is capable of communicating. |
Tiller(T client,
String namespaceHousingTiller,
int tillerPort,
Map<String,String> tillerLabels)
Creates a new
Tiller that will forward a local port to
the supplied (remote) port on a Pod housing Tiller in the supplied
namespace running in the Kubernetes cluster with which the
supplied KubernetesClient is capable of communicating. |
public static final String VERSION
Tiller
instances expect.
This field is never null
.
public static final String DEFAULT_NAMESPACE
This field is never null
.
public static final int DEFAULT_PORT
public static final Map<String,String> DEFAULT_LABELS
This field is never null
.
public static final int MAX_MESSAGE_SIZE
public Tiller(ManagedChannel channel)
Tiller
that will use the supplied ManagedChannel
for communication.channel
- the ManagedChannel
over which
communications will be conducted; must not be null
NullPointerException
- if channel
is null
public Tiller(LocalPortForward portForward)
Tiller
that will use information from the
supplied LocalPortForward
to establish a communications
channel with the Tiller server.portForward
- the LocalPortForward
to use; must not
be null
NullPointerException
- if portForward
is null
public Tiller(T client) throws MalformedURLException
Tiller
that will forward a local port to
port 44134
on a Pod housing Tiller in the kube-system
namespace running in the Kubernetes cluster with
which the supplied KubernetesClient
is capable of
communicating.
The first ready
Pod with a name
label whose value is tiller
and
with an app
label whose value is helm
is deemed
to be the pod housing the Tiller instance to connect to. (This
duplicates the default logic of the helm
command line
executable.)
T
- a KubernetesClient
implementation that is also
an HttpClientAware
implementation, such as DefaultKubernetesClient
client
- the KubernetesClient
-and-HttpClientAware
implementation that can communicate with a
Kubernetes cluster; must not be null
MalformedURLException
- if there was a problem
identifying a Pod within the cluster that houses a Tiller instanceNullPointerException
- if client
is null
public Tiller(T client, String namespaceHousingTiller) throws MalformedURLException
Tiller
that will forward a local port to
port 44134
on a Pod housing Tiller in the supplied
namespace running in the Kubernetes cluster with which the
supplied KubernetesClient
is capable of communicating.
The first ready
Pod with a name
label whose value is tiller
and
with an app
label whose value is helm
is deemed
to be the pod housing the Tiller instance to connect to. (This
duplicates the default logic of the helm
command line
executable.)
T
- a KubernetesClient
implementation that is also
an HttpClientAware
implementation, such as DefaultKubernetesClient
client
- the KubernetesClient
-and-HttpClientAware
implementation that can communicate with a
Kubernetes cluster; must not be null
; no reference to
this object is retained by this Tiller
instancenamespaceHousingTiller
- the namespace within which a Tiller
instance is hopefully running; if null
, then the value of
DEFAULT_NAMESPACE
will be used insteadMalformedURLException
- if there was a problem
identifying a Pod within the cluster that houses a Tiller instanceNullPointerException
- if client
is null
KubernetesClientException
- if there was a problem
connecting to KubernetesTillerException
- if a ready Tiller pod could not be
found and consequently a connection could not be establishedpublic Tiller(T client, String namespaceHousingTiller, int tillerPort, Map<String,String> tillerLabels) throws MalformedURLException
Tiller
that will forward a local port to
the supplied (remote) port on a Pod housing Tiller in the supplied
namespace running in the Kubernetes cluster with which the
supplied KubernetesClient
is capable of communicating.
The first ready
Pod with labels matching the supplied tillerLabels
is
deemed to be the pod housing the Tiller instance to connect
to.
T
- a KubernetesClient
implementation that is also
an HttpClientAware
implementation, such as DefaultKubernetesClient
client
- the KubernetesClient
-and-HttpClientAware
implementation that can communicate with a
Kubernetes cluster; must not be null
; no reference to
this object is retained by this Tiller
instancenamespaceHousingTiller
- the namespace within which a Tiller
instance is hopefully running; if null
, then the value of
DEFAULT_NAMESPACE
will be used insteadtillerPort
- the remote port to attempt to forward a local
port to; normally 44134
tillerLabels
- a Map
representing the Kubernetes
labels (and their values) identifying a Pod housing a Tiller
instance; if null
then the value of DEFAULT_LABELS
will be used insteadMalformedURLException
- if there was a problem
identifying a Pod within the cluster that houses a Tiller instanceNullPointerException
- if client
is null
KubernetesClientException
- if there was a problem
connecting to KubernetesTillerException
- if a ready Tiller pod could not be
found and consequently a connection could not be establishedpublic Config getConfiguration()
Config
available at construction time.
This method may return null
.
getConfiguration
in interface ConfigAware<Config>
Config
, or null
@Issue(id="42", uri="https://github.com/microbean/microbean-helm/issues/42") protected @Issue(id="42",uri="https://github.com/microbean/microbean-helm/issues/42") ManagedChannel buildChannel(LocalPortForward portForward)
ManagedChannel
for communication with Tiller
from the information contained in the supplied LocalPortForward
.
Note: This method is (deliberately) called from constructors so must have stateless semantics.
This method never returns null
.
Overrides of this method must not return null
.
portForward
- a LocalPortForward
; must not be null
null
ManagedChannel
NullPointerException
- if portForward
is null
IllegalArgumentException
- if portForward
's
LocalPortForward.getLocalAddress()
method returns null
public void close() throws IOException
Tiller
after use; any LocalPortForward
or ManagedChannel
used or
created by or for this Tiller
instance will be
closed or shut down
appropriately.close
in interface Closeable
close
in interface AutoCloseable
IOException
- if there was a problem closing the
underlying connection to a Tiller instanceCloseable.close()
,
ManagedChannel.shutdown()
public ReleaseServiceGrpc.ReleaseServiceBlockingStub getReleaseServiceBlockingStub()
ReleaseServiceGrpc.ReleaseServiceBlockingStub
object that represents the capabilities of the Tiller server.
This method will never return null
.
Overrides of this method must never return null
.
null
ReleaseServiceGrpc.ReleaseServiceBlockingStub
ReleaseServiceGrpc.ReleaseServiceBlockingStub
public ReleaseServiceGrpc.ReleaseServiceFutureStub getReleaseServiceFutureStub()
ReleaseServiceGrpc.ReleaseServiceFutureStub
object that represents the capabilities of the Tiller server.
This method will never return null
.
Overrides of this method must never return null
.
null
ReleaseServiceGrpc.ReleaseServiceFutureStub
ReleaseServiceGrpc.ReleaseServiceFutureStub
public ReleaseServiceGrpc.ReleaseServiceStub getReleaseServiceStub()
ReleaseServiceGrpc.ReleaseServiceStub
object that represents the capabilities of the Tiller server.
This method will never return null
.
Overrides of this method must never return null
.
null
ReleaseServiceGrpc.ReleaseServiceStub
ReleaseServiceGrpc.ReleaseServiceStub
public io.grpc.health.v1.HealthGrpc.HealthBlockingStub getHealthBlockingStub()
public io.grpc.health.v1.HealthGrpc.HealthFutureStub getHealthFutureStub()
public io.grpc.health.v1.HealthGrpc.HealthStub getHealthStub()
public VersionOuterClass.VersionOrBuilder getVersion() throws IOException
IOException
Copyright © 2017–2018, microBean. All rights reserved.