类 TillerInstaller
- java.lang.Object
-
- org.microbean.helm.TillerInstaller
-
@Experimental public class TillerInstaller extends Object
A class that idiomatically but faithfully emulates the Tiller-installing behavior of thehelm initcommand.In general, this class follows the logic as expressed in the
install.gosource code from the Helm project, problematic or not. The intent is to have an installer, usable as an idiomatic Java library, that behaves just likehelm init.Note: This class is experimental and its API is subject to change without notice.
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classTillerInstaller.ImagePullPolicyAnenumrepresenting valid values for a KubernetesimagePullPolicyfield.
-
构造器概要
构造器 构造器 说明 TillerInstaller()Creates a newTillerInstaller, using a newDefaultKubernetesClient.TillerInstaller(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient)Creates a newTillerInstaller.TillerInstaller(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, String tillerNamespace)Creates a newTillerInstaller.
-
方法概要
所有方法 静态方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 protected io.fabric8.kubernetes.api.model.ContainercreateContainer(String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, int maxHistory, String namespace, boolean tls, boolean verifyTls)protected io.fabric8.kubernetes.api.model.ContainercreateContainer(String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, String namespace, boolean tls, boolean verifyTls)protected io.fabric8.kubernetes.api.model.apps.DeploymentcreateDeployment(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.DeploymentcreateDeployment(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.DeploymentSpeccreateDeploymentSpec(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.DeploymentSpeccreateDeploymentSpec(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.SecretcreateSecret(String namespace, URI tlsKeyUri, URI tlsCertUri, URI tlsCaCertUri, Map<String,String> labels)protected io.fabric8.kubernetes.api.model.ServicecreateService(String namespace, String serviceName, Map<String,String> labels)protected io.fabric8.kubernetes.api.model.ServiceSpeccreateServiceSpec(Map<String,String> labels)voidinit()voidinit(boolean upgrade)voidinit(boolean upgrade, long tillerConnectionTimeout)voidinit(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)已过时。voidinit(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)voidinstall()voidinstall(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)voidinstall(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)protected booleanisTillerPodReady(String namespace, Map<String,String> labels, long timeoutInMilliseconds)Returnstrueif there is a running Tiller pod that isReady, waiting for a particular amount of time for this result.protected static StringnormalizeDeploymentName(String deploymentName)protected static StringnormalizeImageName(String imageName)protected static Map<String,String>normalizeLabels(Map<String,String> labels)protected StringnormalizeNamespace(String namespace)protected static StringnormalizeServiceAccountName(String serviceAccountName)protected static StringnormalizeServiceName(String serviceName)protected <T extends io.fabric8.kubernetes.client.HttpClientAware & io.fabric8.kubernetes.client.KubernetesClient>
voidping(String namespace, Map<String,String> labels, long timeoutInMilliseconds)If the suppliedtimeoutInMillisecondsis zero or greater, waits for there to be aReadyTiller pod and then contacts its health endpoint.voidupgrade()voidupgrade(String namespace, String deploymentName, String serviceName, String serviceAccountName, String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, Map<String,String> labels)voidupgrade(String namespace, String deploymentName, String serviceName, String serviceAccountName, String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, Map<String,String> labels, boolean force)
-
-
-
构造器详细资料
-
TillerInstaller
public TillerInstaller()
Creates a newTillerInstaller, using a newDefaultKubernetesClient.
-
TillerInstaller
public TillerInstaller(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient)
Creates a newTillerInstaller.- 参数:
kubernetesClient- theKubernetesClientto use to communicate with Kubernetes; must not benull- 另请参阅:
TillerInstaller(KubernetesClient, String)
-
TillerInstaller
public TillerInstaller(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, String tillerNamespace)Creates a newTillerInstaller.- 参数:
kubernetesClient- theKubernetesClientto use to communicate with Kubernetes; must not benulltillerNamespace- the namespace into which to install Tiller; may benullin which case the value of the TILLER_NAMESPACE environment variable will be used—if that isnullthenkube-systemwill be used instead
-
-
方法详细资料
-
init
public void init()
-
init
public void init(boolean upgrade)
-
init
public void init(boolean upgrade, long tillerConnectionTimeout)
-
init
@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
已过时。Attempts to install Tiller into the Kubernetes cluster, silently returning if Tiller is already installed andupgradeisfalse, or upgrading the Tiller installation ifupgradeistrueand 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 benullin which case a default will be useddeploymentName- the name that the Kubernetes Deployment representing Tiller will have; may benull;tiller-deployby defaultserviceName- the name that the Kubernetes Service representing Tiller will have; may benull;tiller-deploy(yes,tiller-deploy) by defaultlabels- the Kubernetes Labels that will be applied to various Kubernetes resources representing Tiller; may benullin which case aMapconsisting of a label ofappwith a value ofhelmand a label ofnamewith a value oftillerwill be used insteadserviceAccountName- the name of the Kubernetes Service Account that Tiller should use; may benullin which case the default Service Account will be used insteadimageName- the name of the Docker image that contains the Tiller code; may benullin which case the JavaString"gcr.io/kubernetes-helm/tiller:v" + "2.8.2"will be used insteadimagePullPolicy- anTillerInstaller.ImagePullPolicyspecifying how the Tiller image should be pulled; may benullin which caseTillerInstaller.ImagePullPolicy.IF_NOT_PRESENTwill be used insteadhostNetwork- the value to be used for thehostNetworkproperty of the Tiller Pod'sPodSpectls- whether Tiller's conversations with Kubernetes will be encrypted using TLSverifyTls- whether, if and only iftlsistrue, additional TLS-related verification will be performedtlsKeyUri- aURIto the public key used during TLS communication with Kubernetes; may benulliftlsisfalsetlsCertUri- aURIto the certificate used during TLS communication with Kubernetes; may benulliftlsisfalsetlsCaCertUri- aURIto the certificate authority used during TLS communication with Kubernetes; may benulliftlsisfalse- 抛出:
IOException- if a communication error occurs- 另请参阅:
init(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)
-
init
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 IOExceptionAttempts to install Tiller into the Kubernetes cluster, silently returning if Tiller is already installed andupgradeisfalse, or upgrading the Tiller installation ifupgradeistrueand 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 benullin which case a default will be useddeploymentName- the name that the Kubernetes Deployment representing Tiller will have; may benull;tiller-deployby defaultserviceName- the name that the Kubernetes Service representing Tiller will have; may benull;tiller-deploy(yes,tiller-deploy) by defaultlabels- the Kubernetes Labels that will be applied to various Kubernetes resources representing Tiller; may benullin which case aMapconsisting of a label ofappwith a value ofhelmand a label ofnamewith a value oftillerwill be used insteadnodeSelector- aMaprepresenting labels that will be written as a node selector; may benullserviceAccountName- the name of the Kubernetes Service Account that Tiller should use; may benullin which case the default Service Account will be used insteadimageName- the name of the Docker image that contains the Tiller code; may benullin which case the JavaString"gcr.io/kubernetes-helm/tiller:v" + "2.8.2"will be used insteadimagePullPolicy- anTillerInstaller.ImagePullPolicyspecifying how the Tiller image should be pulled; may benullin which caseTillerInstaller.ImagePullPolicy.IF_NOT_PRESENTwill 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 thehostNetworkproperty of the Tiller Pod'sPodSpectls- whether Tiller's conversations with Kubernetes will be encrypted using TLSverifyTls- whether, if and only iftlsistrue, additional TLS-related verification will be performedtlsKeyUri- aURIto the public key used during TLS communication with Kubernetes; may benulliftlsisfalsetlsCertUri- aURIto the certificate used during TLS communication with Kubernetes; may benulliftlsisfalsetlsCaCertUri- aURIto the certificate authority used during TLS communication with Kubernetes; may benulliftlsisfalsetillerConnectionTimeout- the number of milliseconds to wait for a Tiller pod to become ready; if less than0no wait will occur- 抛出:
IOException- if a communication error occurs- 另请参阅:
install(String, String, String, Map, Map, String, String, ImagePullPolicy, int, boolean, boolean, boolean, URI, URI, URI),upgrade(String, String, String, String, String, ImagePullPolicy, Map)
-
install
public void install()
-
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
- 抛出:
IOException
-
install
public 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
- 抛出:
IOException
-
upgrade
public void upgrade()
-
upgrade
public void upgrade(String namespace, String deploymentName, String serviceName, String serviceAccountName, String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, Map<String,String> labels)
-
upgrade
public void upgrade(String namespace, String deploymentName, String serviceName, String serviceAccountName, String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, Map<String,String> labels, boolean force)
-
createService
protected io.fabric8.kubernetes.api.model.Service createService(String namespace, String serviceName, Map<String,String> labels)
-
createDeployment
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)
-
createDeployment
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)
-
createSecret
protected io.fabric8.kubernetes.api.model.Secret createSecret(String namespace, URI tlsKeyUri, URI tlsCertUri, URI tlsCaCertUri, Map<String,String> labels) throws IOException
- 抛出:
IOException
-
createDeploymentSpec
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)
-
createDeploymentSpec
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)
-
createContainer
protected io.fabric8.kubernetes.api.model.Container createContainer(String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, String namespace, boolean tls, boolean verifyTls)
-
createContainer
protected io.fabric8.kubernetes.api.model.Container createContainer(String imageName, TillerInstaller.ImagePullPolicy imagePullPolicy, int maxHistory, String namespace, boolean tls, boolean verifyTls)
-
createServiceSpec
protected io.fabric8.kubernetes.api.model.ServiceSpec createServiceSpec(Map<String,String> labels)
-
ping
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
If the suppliedtimeoutInMillisecondsis zero or greater, waits for there to be aReadyTiller pod and then contacts its health endpoint.If the Tiller pod is healthy this method will return normally.
- 参数:
namespace- the namespace housing Tiller; may benullin which case a default will be usedlabels- the Kubernetes labels that will be used to find running Tiller pods; may benullin which case aMapconsisting of a label ofappwith a value ofhelmand a label ofnamewith a value oftillerwill be used insteadtimeoutInMilliseconds- the number of milliseconds to wait for a Tiller pod to become ready; if less than0no wait will occur and this method will return immediately- 抛出:
io.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 healthy
-
isTillerPodReady
protected final boolean isTillerPodReady(String namespace, Map<String,String> labels, long timeoutInMilliseconds)
Returnstrueif there is a running Tiller pod that isReady, waiting for a particular amount of time for this result.- 参数:
namespace- the namespace housing Tiller; may benullin which case a default will be used insteadlabels- labels identifying Tiller pods; may benullin which case a default set will be used insteadtimeoutInMilliseconds- the number of milliseconds to wait for a result; if0, this method will block and wait forever; if less than0this method will take no action and will returnfalse- 返回:
trueif there is a running Tiller pod that isReady;falseotherwise- 抛出:
io.fabric8.kubernetes.client.KubernetesClientException- if there was a problem communicating with Kubernetes
-
normalizeLabels
protected static final Map<String,String> normalizeLabels(Map<String,String> labels)
-
normalizeDeploymentName
protected static final String normalizeDeploymentName(String deploymentName)
-
normalizeServiceAccountName
protected static final String normalizeServiceAccountName(String serviceAccountName)
-
-