@Experimental public class TillerInstaller extends Object
helm init command.
In general, this class follows the logic as expressed in the
install.go source code from the Helm project, problematic or not.
The intent is to have an installer, usable as an idiomatic Java library, that
behaves just like helm
init.
Note: This class is experimental and its API is subject to change without notice.
| 限定符和类型 | 类和说明 |
|---|---|
static class |
TillerInstaller.ImagePullPolicy
An
enum representing valid values for a Kubernetes imagePullPolicy field. |
| 构造器和说明 |
|---|
TillerInstaller()
Creates a new
TillerInstaller, using a new
DefaultKubernetesClient. |
TillerInstaller(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient)
Creates a new
TillerInstaller. |
TillerInstaller(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient,
String tillerNamespace)
Creates a new
TillerInstaller. |
| 限定符和类型 | 方法和说明 |
|---|---|
protected io.fabric8.kubernetes.api.model.Container |
createContainer(String imageName,
TillerInstaller.ImagePullPolicy imagePullPolicy,
int maxHistory,
String namespace,
boolean tls,
boolean verifyTls) |
protected io.fabric8.kubernetes.api.model.Container |
createContainer(String imageName,
TillerInstaller.ImagePullPolicy imagePullPolicy,
String namespace,
boolean tls,
boolean verifyTls) |
protected io.fabric8.kubernetes.api.model.apps.Deployment |
createDeployment(String namespace,
String deploymentName,
Map<String,String> labels,
Map<String,String> nodeSelector,
String serviceAccountName,
String imageName,
TillerInstaller.ImagePullPolicy imagePullPolicy,
int maxHistory,
boolean hostNetwork,
boolean tls,
boolean verifyTls) |
protected io.fabric8.kubernetes.api.model.apps.Deployment |
createDeployment(String namespace,
String deploymentName,
Map<String,String> labels,
String serviceAccountName,
String imageName,
TillerInstaller.ImagePullPolicy imagePullPolicy,
boolean hostNetwork,
boolean tls,
boolean verifyTls) |
protected io.fabric8.kubernetes.api.model.apps.DeploymentSpec |
createDeploymentSpec(Map<String,String> labels,
Map<String,String> nodeSelector,
String serviceAccountName,
String imageName,
TillerInstaller.ImagePullPolicy imagePullPolicy,
int maxHistory,
String namespace,
boolean hostNetwork,
boolean tls,
boolean verifyTls) |
protected io.fabric8.kubernetes.api.model.apps.DeploymentSpec |
createDeploymentSpec(Map<String,String> labels,
String serviceAccountName,
String imageName,
TillerInstaller.ImagePullPolicy imagePullPolicy,
String namespace,
boolean hostNetwork,
boolean tls,
boolean verifyTls) |
protected io.fabric8.kubernetes.api.model.Secret |
createSecret(String namespace,
URI tlsKeyUri,
URI tlsCertUri,
URI tlsCaCertUri,
Map<String,String> labels) |
protected io.fabric8.kubernetes.api.model.Service |
createService(String namespace,
String serviceName,
Map<String,String> labels) |
protected io.fabric8.kubernetes.api.model.ServiceSpec |
createServiceSpec(Map<String,String> labels) |
void |
init() |
void |
init(boolean upgrade) |
void |
init(boolean upgrade,
long tillerConnectionTimeout) |
void |
init(boolean upgrade,
String namespace,
String deploymentName,
String serviceName,
Map<String,String> labels,
Map<String,String> nodeSelector,
String serviceAccountName,
String imageName,
TillerInstaller.ImagePullPolicy imagePullPolicy,
int maxHistory,
boolean hostNetwork,
boolean tls,
boolean verifyTls,
URI tlsKeyUri,
URI tlsCertUri,
URI tlsCaCertUri,
long tillerConnectionTimeout)
|
void |
init(boolean upgrade,
String namespace,
String deploymentName,
String serviceName,
Map<String,String> labels,
String serviceAccountName,
String imageName,
TillerInstaller.ImagePullPolicy imagePullPolicy,
boolean hostNetwork,
boolean tls,
boolean verifyTls,
URI tlsKeyUri,
URI tlsCertUri,
URI tlsCaCertUri)
已过时。
|
void |
install() |
void |
install(String namespace,
String deploymentName,
String serviceName,
Map<String,String> labels,
Map<String,String> nodeSelector,
String serviceAccountName,
String imageName,
TillerInstaller.ImagePullPolicy imagePullPolicy,
int maxHistory,
boolean hostNetwork,
boolean tls,
boolean verifyTls,
URI tlsKeyUri,
URI tlsCertUri,
URI tlsCaCertUri) |
void |
install(String namespace,
String deploymentName,
String serviceName,
Map<String,String> labels,
String serviceAccountName,
String imageName,
TillerInstaller.ImagePullPolicy imagePullPolicy,
boolean hostNetwork,
boolean tls,
boolean verifyTls,
URI tlsKeyUri,
URI tlsCertUri,
URI tlsCaCertUri) |
protected boolean |
isTillerPodReady(String namespace,
Map<String,String> labels,
long timeoutInMilliseconds)
Returns
true if there is a running Tiller pod that is Ready,
waiting for a particular amount of time for this result. |
protected static String |
normalizeDeploymentName(String deploymentName) |
protected static String |
normalizeImageName(String imageName) |
protected static Map<String,String> |
normalizeLabels(Map<String,String> labels) |
protected String |
normalizeNamespace(String namespace) |
protected static String |
normalizeServiceAccountName(String serviceAccountName) |
protected static String |
normalizeServiceName(String serviceName) |
protected <T extends io.fabric8.kubernetes.client.HttpClientAware & io.fabric8.kubernetes.client.KubernetesClient> |
ping(String namespace,
Map<String,String> labels,
long timeoutInMilliseconds)
If the supplied
timeoutInMilliseconds is zero or greater, waits for
there to be a Ready Tiller pod and then contacts its health endpoint. |
void |
upgrade() |
void |
upgrade(String namespace,
String deploymentName,
String serviceName,
String serviceAccountName,
String imageName,
TillerInstaller.ImagePullPolicy imagePullPolicy,
Map<String,String> labels) |
void |
upgrade(String namespace,
String deploymentName,
String serviceName,
String serviceAccountName,
String imageName,
TillerInstaller.ImagePullPolicy imagePullPolicy,
Map<String,String> labels,
boolean force) |
public TillerInstaller()
TillerInstaller, using a new
DefaultKubernetesClient.public TillerInstaller(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient)
TillerInstaller.kubernetesClient - the KubernetesClient to use to communicate
with Kubernetes; must not be nullTillerInstaller(KubernetesClient, String)public TillerInstaller(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient,
String tillerNamespace)
TillerInstaller.kubernetesClient - the KubernetesClient to use to communicate
with Kubernetes; must not be nulltillerNamespace - the namespace into which to install Tiller; may be
null in which case the value of the
TILLER_NAMESPACE environment variable will be
used—if that is null then
kube-system will be used insteadpublic void init()
public void init(boolean upgrade)
public void init(boolean upgrade,
long tillerConnectionTimeout)
@Deprecated public void init(boolean upgrade, String namespace, String deploymentName, String serviceName, Map<String,String> labels, String serviceAccountName, String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, boolean hostNetwork, boolean tls, boolean verifyTls, URI tlsKeyUri, URI tlsCertUri, URI tlsCaCertUri) throws IOException
init(boolean, String, String, String, Map, Map, String, String, ImagePullPolicy, int, boolean, boolean, boolean, URI, URI, URI, long)
method instead.upgrade is false, or
upgrading the Tiller installation if upgrade is true and a
newer version of Tiller is available.upgrade - whether or not to attempt an upgrade if Tiller is
already installednamespace - the Kubernetes namespace into which Tiller will be
installed, if it is not already installed; may be
null in which case a default will be useddeploymentName - the name that the Kubernetes Deployment
representing Tiller will have; may be null;
tiller-deploy by defaultserviceName - the name that the Kubernetes Service representing
Tiller will have; may be null; tiller-deploy (yes, tiller-deploy) by defaultlabels - the Kubernetes Labels that will be applied to
various Kubernetes resources representing Tiller;
may be null in which case a Map consisting of a label
of app with a value of helm and a label of
name with a value of tiller will be
used insteadserviceAccountName - the name of the Kubernetes Service Account that
Tiller should use; may be null in which
case the default Service Account will be used
insteadimageName - the name of the Docker image that contains the
Tiller code; may be null in which case the
Java String
"gcr.io/kubernetes-helm/tiller:v" + "2.8.2" will be used insteadimagePullPolicy - an TillerInstaller.ImagePullPolicy specifying how the
Tiller image should be pulled; may be null
in which case
TillerInstaller.ImagePullPolicy.IF_NOT_PRESENT will be used
insteadhostNetwork - the value to be used for the
hostNetwork property of the Tiller
Pod's PodSpectls - whether Tiller's conversations with Kubernetes will
be encrypted using TLSverifyTls - whether, if and only if tls is true , additional TLS-related verification will be
performedtlsKeyUri - a URI to the public key used during TLS
communication with Kubernetes; may be null
if tls is falsetlsCertUri - a URI to the certificate used during TLS
communication with Kubernetes; may be null
if tls is falsetlsCaCertUri - a URI to the certificate authority used
during TLS communication with Kubernetes; may be
null if tls is falseIOException - if a communication error occursinit(boolean, String, String, String, Map, Map, String, String,
ImagePullPolicy, int, boolean, boolean, boolean, URI, URI, URI, long),
install(String, String, String, Map, Map, String, String,
ImagePullPolicy, int, boolean, boolean, boolean, URI, URI, URI),
upgrade(String, String, String, String, String, ImagePullPolicy, Map)public void init(boolean upgrade,
String namespace,
String deploymentName,
String serviceName,
Map<String,String> labels,
Map<String,String> nodeSelector,
String serviceAccountName,
String imageName,
TillerInstaller.ImagePullPolicy imagePullPolicy,
int maxHistory,
boolean hostNetwork,
boolean tls,
boolean verifyTls,
URI tlsKeyUri,
URI tlsCertUri,
URI tlsCaCertUri,
long tillerConnectionTimeout)
throws IOException
upgrade is false, or
upgrading the Tiller installation if upgrade is true and a
newer version of Tiller is available.upgrade - whether or not to attempt an upgrade if Tiller
is already installednamespace - the Kubernetes namespace into which Tiller
will be installed, if it is not already
installed; may be null in which case a
default will be useddeploymentName - the name that the Kubernetes Deployment
representing Tiller will have; may be
null; tiller-deploy by defaultserviceName - the name that the Kubernetes Service
representing Tiller will have; may be
null; tiller-deploy (yes, tiller-deploy) by defaultlabels - the Kubernetes Labels that will be applied to
various Kubernetes resources representing
Tiller; may be null in which case a Map consisting of a
label of app with a value of helm and a label of
name with a value of tiller
will be used insteadnodeSelector - a Map representing labels that will be
written as a node selector; may be
nullserviceAccountName - the name of the Kubernetes Service Account
that Tiller should use; may be null in
which case the default Service Account will be
used insteadimageName - the name of the Docker image that contains the
Tiller code; may be null in which case
the Java String
"gcr.io/kubernetes-helm/tiller:v" + "2.8.2" will be used insteadimagePullPolicy - an TillerInstaller.ImagePullPolicy specifying how the
Tiller image should be pulled; may be
null in which case
TillerInstaller.ImagePullPolicy.IF_NOT_PRESENT will be
used insteadmaxHistory - the maximum number of release versions stored
per release; a value that is less than or
equal to zero means there is effectively no
limithostNetwork - the value to be used for the
hostNetwork property of the
Tiller Pod's PodSpectls - whether Tiller's conversations with Kubernetes
will be encrypted using TLSverifyTls - whether, if and only if tls is true , additional TLS-related verification will be
performedtlsKeyUri - a URI to the public key used during
TLS communication with Kubernetes; may be
null if tls is falsetlsCertUri - a URI to the certificate used during
TLS communication with Kubernetes; may be
null if tls is falsetlsCaCertUri - a URI to the certificate authority
used during TLS communication with Kubernetes;
may be null if tls is falsetillerConnectionTimeout - the number of milliseconds to wait for a
Tiller pod to become ready; if less than
0 no wait will occurIOException - if a communication error occursinstall(String, String, String, Map, Map, String, String,
ImagePullPolicy, int, boolean, boolean, boolean, URI, URI, URI),
upgrade(String, String, String, String, String, ImagePullPolicy, Map)public void install()
public void install(String namespace, String deploymentName, String serviceName, Map<String,String> labels, String serviceAccountName, String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, boolean hostNetwork, boolean tls, boolean verifyTls, URI tlsKeyUri, URI tlsCertUri, URI tlsCaCertUri) throws IOException
IOExceptionpublic void install(String namespace, String deploymentName, String serviceName, Map<String,String> labels, Map<String,String> nodeSelector, String serviceAccountName, String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, int maxHistory, boolean hostNetwork, boolean tls, boolean verifyTls, URI tlsKeyUri, URI tlsCertUri, URI tlsCaCertUri) throws IOException
IOExceptionpublic void upgrade()
public void upgrade(String namespace, String deploymentName, String serviceName, String serviceAccountName, String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, Map<String,String> labels)
public void upgrade(String namespace, String deploymentName, String serviceName, String serviceAccountName, String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, Map<String,String> labels, boolean force)
protected io.fabric8.kubernetes.api.model.Service createService(String namespace, String serviceName, Map<String,String> labels)
protected io.fabric8.kubernetes.api.model.apps.Deployment createDeployment(String namespace, String deploymentName, Map<String,String> labels, String serviceAccountName, String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, boolean hostNetwork, boolean tls, boolean verifyTls)
protected io.fabric8.kubernetes.api.model.apps.Deployment createDeployment(String namespace, String deploymentName, Map<String,String> labels, Map<String,String> nodeSelector, String serviceAccountName, String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, int maxHistory, boolean hostNetwork, boolean tls, boolean verifyTls)
protected io.fabric8.kubernetes.api.model.Secret createSecret(String namespace, URI tlsKeyUri, URI tlsCertUri, URI tlsCaCertUri, Map<String,String> labels) throws IOException
IOExceptionprotected io.fabric8.kubernetes.api.model.apps.DeploymentSpec createDeploymentSpec(Map<String,String> labels, String serviceAccountName, String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, String namespace, boolean hostNetwork, boolean tls, boolean verifyTls)
protected io.fabric8.kubernetes.api.model.apps.DeploymentSpec createDeploymentSpec(Map<String,String> labels, Map<String,String> nodeSelector, String serviceAccountName, String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, int maxHistory, String namespace, boolean hostNetwork, boolean tls, boolean verifyTls)
protected io.fabric8.kubernetes.api.model.Container createContainer(String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, String namespace, boolean tls, boolean verifyTls)
protected io.fabric8.kubernetes.api.model.Container createContainer(String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, int maxHistory, String namespace, boolean tls, boolean verifyTls)
protected io.fabric8.kubernetes.api.model.ServiceSpec createServiceSpec(Map<String,String> labels)
protected final <T extends io.fabric8.kubernetes.client.HttpClientAware & io.fabric8.kubernetes.client.KubernetesClient> void ping(String namespace, Map<String,String> labels, long timeoutInMilliseconds) throws MalformedURLException
timeoutInMilliseconds is zero or greater, waits for
there to be a Ready Tiller pod and then contacts its health endpoint.
If the Tiller pod is healthy this method will return normally.
namespace - the namespace housing Tiller; may be null in which case a default will be usedlabels - the Kubernetes labels that will be used to find
running Tiller pods; may be null in
which case a Map consisting of a label
of app with a value of helm and a label of name with a value of
tiller will be used insteadtimeoutInMilliseconds - the number of milliseconds to wait for a Tiller
pod to become ready; if less than 0 no
wait will occur and this method will return
immediatelyio.fabric8.kubernetes.client.KubernetesClientException - if there was a problem
connecting to KubernetesMalformedURLException - if there was a problem
forwarding a port to TillerTillerPollingDeadlineExceededException - if Tiller could not be
contacted in timeMalformedURLException - if Tiller was not healthyprotected final boolean isTillerPodReady(String namespace, Map<String,String> labels, long timeoutInMilliseconds)
true if there is a running Tiller pod that is Ready,
waiting for a particular amount of time for this result.namespace - the namespace housing Tiller; may be null in which case a default will be used insteadlabels - labels identifying Tiller pods; may be
null in which case a default set will be
used insteadtimeoutInMilliseconds - the number of milliseconds to wait for a result;
if 0, this method will block and wait
forever; if less than 0 this method will
take no action and will return falsetrue if there is a running Tiller pod that is Ready;
false otherwiseio.fabric8.kubernetes.client.KubernetesClientException - if there was a problem communicating
with Kubernetesprotected static final Map<String,String> normalizeLabels(Map<String,String> labels)
protected static final String normalizeDeploymentName(String deploymentName)
protected static final String normalizeServiceAccountName(String serviceAccountName)
Copyright © 2021. All rights reserved.