Class KubernetesSlave
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.Node
-
- hudson.model.Slave
-
- hudson.slaves.AbstractCloudSlave
-
- org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<Node>
,ModelObject
,ReconfigurableDescribable<Node>
,Saveable
,SearchableModelObject
,SearchItem
,AccessControlled
,Serializable
,OnMaster
public class KubernetesSlave extends AbstractCloudSlave
- Author:
- Carlos Sanchez carlos@apache.org
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KubernetesSlave.Builder
Builds aKubernetesSlave
instance.static class
KubernetesSlave.DescriptorImpl
-
Nested classes/interfaces inherited from class hudson.model.Slave
Slave.JnlpJar, Slave.SlaveDescriptor
-
Nested classes/interfaces inherited from class hudson.model.Node
Node.InternalComputerListener, Node.Mode
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.Node
holdOffLaunchUntilSave, SKIP_BUILD_CHECK_ON_FLYWEIGHTS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
KubernetesSlave(String name, PodTemplate template, String nodeDescription, String cloudName, String labelStr, ComputerLauncher computerLauncher, RetentionStrategy rs)
KubernetesSlave(PodTemplate template, String nodeDescription, String cloudName, String labelStr, RetentionStrategy rs)
Deprecated.UseKubernetesSlave.Builder
instead.KubernetesSlave(PodTemplate template, String nodeDescription, KubernetesCloud cloud, Label label)
Deprecated.UseKubernetesSlave.Builder
instead.KubernetesSlave(PodTemplate template, String nodeDescription, KubernetesCloud cloud, String labelStr)
Deprecated.UseKubernetesSlave.Builder
instead.KubernetesSlave(PodTemplate template, String nodeDescription, KubernetesCloud cloud, String labelStr, RetentionStrategy rs)
Deprecated.UseKubernetesSlave.Builder
instead.
-
Method Summary
-
Methods inherited from class hudson.slaves.AbstractCloudSlave
terminate
-
Methods inherited from class hudson.model.Slave
getClockDifferenceCallable, getComputer, getDescriptor, getLabelAtomSet, getLabelString, getLauncher, getMode, getNodeDescription, getNodeName, getNodeProperties, getNumExecutors, getRetentionStrategy, getUserId, getWorkspaceFor, getWorkspaceRoot, setLabelString, setLauncher, setMode, setNodeDescription, setNodeName, setNodeProperties, setNumExecutors, setRetentionStrategy, setUserId
-
Methods inherited from class hudson.model.Node
canTake, canTake, createPath, getACL, getAssignedLabels, getChannel, getClockDifference, getDisplayName, getFileSystemProvisioner, getLabelCloud, getNodeProperty, getNodeProperty, getNodePropertyDescriptors, getSearchUrl, getSelfLabel, getTemporaryOfflineCause, isAcceptingTasks, isHoldOffLaunchUntilSave, reconfigure, save, toComputer
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2
-
-
-
-
Constructor Detail
-
KubernetesSlave
@Deprecated public KubernetesSlave(PodTemplate template, String nodeDescription, KubernetesCloud cloud, String labelStr) throws Descriptor.FormException, IOException
Deprecated.UseKubernetesSlave.Builder
instead.- Throws:
Descriptor.FormException
IOException
-
KubernetesSlave
@Deprecated public KubernetesSlave(PodTemplate template, String nodeDescription, KubernetesCloud cloud, Label label) throws Descriptor.FormException, IOException
Deprecated.UseKubernetesSlave.Builder
instead.- Throws:
Descriptor.FormException
IOException
-
KubernetesSlave
@Deprecated public KubernetesSlave(PodTemplate template, String nodeDescription, KubernetesCloud cloud, String labelStr, RetentionStrategy rs) throws Descriptor.FormException, IOException
Deprecated.UseKubernetesSlave.Builder
instead.- Throws:
Descriptor.FormException
IOException
-
KubernetesSlave
@Deprecated @DataBoundConstructor public KubernetesSlave(PodTemplate template, String nodeDescription, String cloudName, String labelStr, RetentionStrategy rs) throws Descriptor.FormException, IOException
Deprecated.UseKubernetesSlave.Builder
instead.- Throws:
Descriptor.FormException
IOException
-
KubernetesSlave
protected KubernetesSlave(String name, @NonNull PodTemplate template, String nodeDescription, String cloudName, String labelStr, ComputerLauncher computerLauncher, RetentionStrategy rs) throws Descriptor.FormException, IOException
- Throws:
Descriptor.FormException
IOException
-
-
Method Detail
-
getTemplate
@NonNull public PodTemplate getTemplate() throws IllegalStateException
- Throws:
IllegalStateException
-
getTemplateId
@NonNull public String getTemplateId()
-
getTemplateOrNull
@CheckForNull public PodTemplate getTemplateOrNull()
-
getRunListener
@NonNull public TaskListener getRunListener()
Makes a best effort to find the build log corresponding to this agent.
-
getCloudName
public String getCloudName()
-
setNamespace
public void setNamespace(@NonNull String namespace)
-
getNamespace
@NonNull public String getNamespace()
-
getPodName
public String getPodName()
-
getRemoteFS
public String getRemoteFS()
- Overrides:
getRemoteFS
in classSlave
-
getRootPath
@CheckForNull public FilePath getRootPath()
- Overrides:
getRootPath
in classSlave
-
getCloud
@Deprecated public Cloud getCloud()
Deprecated.Please use the strongly typed getKubernetesCloud() instead.
-
getPod
public Optional<io.fabric8.kubernetes.api.model.Pod> getPod()
-
getKubernetesCloud
@NonNull public KubernetesCloud getKubernetesCloud()
Returns the cloud instance which created this agent.- Returns:
- the cloud instance which created this agent.
- Throws:
IllegalStateException
- if the cloud doesn't exist anymore, or is not aKubernetesCloud
.
-
createComputer
public KubernetesComputer createComputer()
- Specified by:
createComputer
in classAbstractCloudSlave
-
getPodRetention
public PodRetention getPodRetention(KubernetesCloud cloud)
-
_terminate
protected void _terminate(TaskListener listener) throws IOException, InterruptedException
- Specified by:
_terminate
in classAbstractCloudSlave
- Throws:
IOException
InterruptedException
-
createLauncher
public Launcher createLauncher(TaskListener listener)
- Overrides:
createLauncher
in classSlave
-
readResolve
protected Object readResolve()
- Overrides:
readResolve
in classSlave
-
builder
public static KubernetesSlave.Builder builder()
Returns a newKubernetesSlave.Builder
instance.- Returns:
- a new
KubernetesSlave.Builder
instance.
-
-