Class PodTemplate

java.lang.Object
hudson.model.AbstractDescribableImpl<PodTemplate>
org.csanchez.jenkins.plugins.kubernetes.PodTemplate
All Implemented Interfaces:
Describable<PodTemplate>, Saveable, Serializable

public class PodTemplate extends AbstractDescribableImpl<PodTemplate> implements Serializable, Saveable
Kubernetes Pod Template
Author:
Nicolas De Loof
See Also:
  • Field Details

    • DEFAULT_SLAVE_JENKINS_CONNECTION_TIMEOUT

      public static final Integer DEFAULT_SLAVE_JENKINS_CONNECTION_TIMEOUT
      Connection timeout expiration in seconds, default to 1000 seconds
    • JENKINS_LABEL

      public static final String JENKINS_LABEL
      See Also:
    • JENKINS_LABEL_DIGEST

      public static final String JENKINS_LABEL_DIGEST
      See Also:
  • Constructor Details

    • PodTemplate

      public PodTemplate()
    • PodTemplate

      @DataBoundConstructor public PodTemplate(@CheckForNull String id)
    • PodTemplate

      public PodTemplate(PodTemplate from)
    • PodTemplate

      @Deprecated public PodTemplate(String image, List<? extends PodVolume> volumes)
      Deprecated.
  • Method Details

    • getLabelDigestFunction

      protected static MessageDigest getLabelDigestFunction()
      Digest function that is used to compute the kubernetes label "jenkins/label-digest" Not used for security.
    • getId

      @NonNull public String getId()
    • getYamlMergeStrategy

      @CheckForNull public YamlMergeStrategy getYamlMergeStrategy()
    • getResolvedYamlMergeStrategy

      @NonNull public YamlMergeStrategy getResolvedYamlMergeStrategy()
    • setYamlMergeStrategy

      @DataBoundSetter public void setYamlMergeStrategy(@CheckForNull YamlMergeStrategy yamlMergeStrategy)
    • getYamlsPod

      public io.fabric8.kubernetes.api.model.Pod getYamlsPod()
    • getInheritFrom

      public String getInheritFrom()
    • setInheritFrom

      @DataBoundSetter public void setInheritFrom(String inheritFrom)
    • setName

      @DataBoundSetter public void setName(String name)
    • getName

      public String getName()
    • getNamespace

      public String getNamespace()
    • setNamespace

      @DataBoundSetter public void setNamespace(String namespace)
    • getImage

      @Deprecated public String getImage()
      Deprecated.
    • setCommand

      @Deprecated @DataBoundSetter public void setCommand(String command)
      Deprecated.
    • getCommand

      @Deprecated public String getCommand()
      Deprecated.
    • setArgs

      @Deprecated @DataBoundSetter public void setArgs(String args)
      Deprecated.
    • getArgs

      @Deprecated public String getArgs()
      Deprecated.
    • getDisplayName

      @Deprecated public String getDisplayName()
      Deprecated.
    • setRemoteFs

      @DataBoundSetter @Deprecated public void setRemoteFs(String remoteFs)
      Deprecated.
    • getRemoteFs

      @Deprecated public String getRemoteFs()
      Deprecated.
    • setInstanceCap

      @DataBoundSetter public void setInstanceCap(int instanceCap)
    • getInstanceCap

      public int getInstanceCap()
    • setSlaveConnectTimeout

      @DataBoundSetter public void setSlaveConnectTimeout(int slaveConnectTimeout)
    • getSlaveConnectTimeout

      public int getSlaveConnectTimeout()
    • setInstanceCapStr

      @DataBoundSetter public void setInstanceCapStr(String instanceCapStr)
    • getInstanceCapStr

      public String getInstanceCapStr()
    • setSlaveConnectTimeoutStr

      @DataBoundSetter public void setSlaveConnectTimeoutStr(String slaveConnectTimeoutStr)
    • getSlaveConnectTimeoutStr

      public String getSlaveConnectTimeoutStr()
    • setIdleMinutes

      @DataBoundSetter public void setIdleMinutes(int i)
    • getIdleMinutes

      public int getIdleMinutes()
    • setActiveDeadlineSeconds

      @DataBoundSetter public void setActiveDeadlineSeconds(int i)
    • getActiveDeadlineSeconds

      public int getActiveDeadlineSeconds()
    • setIdleMinutesStr

      @DataBoundSetter public void setIdleMinutesStr(String idleMinutes)
    • getIdleMinutesStr

      public String getIdleMinutesStr()
    • setActiveDeadlineSecondsStr

      @DataBoundSetter public void setActiveDeadlineSecondsStr(String activeDeadlineSeconds)
    • getActiveDeadlineSecondsStr

      public String getActiveDeadlineSecondsStr()
    • getLabelSet

      public Set<LabelAtom> getLabelSet()
    • getLabelsMap

      public Map<String,String> getLabelsMap()
    • setLabel

      @DataBoundSetter public void setLabel(String label)
    • getLabel

      public String getLabel()
    • setNodeSelector

      @DataBoundSetter public void setNodeSelector(String nodeSelector)
    • getNodeSelector

      public String getNodeSelector()
    • setNodeUsageMode

      @DataBoundSetter public void setNodeUsageMode(Node.Mode nodeUsageMode)
    • setNodeUsageMode

      @DataBoundSetter public void setNodeUsageMode(String nodeUsageMode)
    • getNodeUsageMode

      public Node.Mode getNodeUsageMode()
    • setPrivileged

      @Deprecated @DataBoundSetter public void setPrivileged(boolean privileged)
      Deprecated.
    • isPrivileged

      @Deprecated public boolean isPrivileged()
      Deprecated.
    • setRunAsUser

      @DataBoundSetter public void setRunAsUser(String runAsUser)
    • getRunAsUser

      public String getRunAsUser()
    • getRunAsUserAsLong

      public Long getRunAsUserAsLong()
    • setRunAsGroup

      @DataBoundSetter public void setRunAsGroup(String runAsGroup)
    • getRunAsGroup

      public String getRunAsGroup()
    • getRunAsGroupAsLong

      public Long getRunAsGroupAsLong()
    • setSupplementalGroups

      @DataBoundSetter public void setSupplementalGroups(String supplementalGroups)
    • getSupplementalGroups

      public String getSupplementalGroups()
    • setHostNetwork

      @DataBoundSetter public void setHostNetwork(Boolean hostNetwork)
    • isHostNetwork

      public boolean isHostNetwork()
    • isHostNetworkSet

      public boolean isHostNetworkSet()
    • getServiceAccount

      public String getServiceAccount()
    • setServiceAccount

      @DataBoundSetter public void setServiceAccount(String serviceAccount)
    • getSchedulerName

      public String getSchedulerName()
    • setSchedulerName

      @DataBoundSetter public void setSchedulerName(String schedulerName)
    • setAlwaysPullImage

      @Deprecated @DataBoundSetter public void setAlwaysPullImage(boolean alwaysPullImage)
      Deprecated.
    • isAlwaysPullImage

      @Deprecated public boolean isAlwaysPullImage()
      Deprecated.
    • setCapOnlyOnAlivePods

      @DataBoundSetter @Deprecated public void setCapOnlyOnAlivePods(boolean capOnlyOnAlivePods)
      Deprecated.
    • isCapOnlyOnAlivePods

      @Deprecated public boolean isCapOnlyOnAlivePods()
      Deprecated.
    • getEnvVars

      public List<TemplateEnvVar> getEnvVars()
    • addEnvVars

      public void addEnvVars(List<TemplateEnvVar> envVars)
    • doDoDelete

      @POST public org.kohsuke.stapler.HttpResponse doDoDelete(@AncestorInPath PodTemplateGroup owner) throws IOException
      Deletes the template.
      Throws:
      IOException
    • doConfigSubmit

      @POST public org.kohsuke.stapler.HttpResponse doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, @AncestorInPath PodTemplateGroup owner) throws IOException, javax.servlet.ServletException, Descriptor.FormException
      Throws:
      IOException
      javax.servlet.ServletException
      Descriptor.FormException
    • setEnvVars

      @DataBoundSetter public void setEnvVars(List<TemplateEnvVar> envVars)
    • getAnnotations

      public List<PodAnnotation> getAnnotations()
    • addAnnotations

      public void addAnnotations(List<PodAnnotation> annotations)
    • setAnnotations

      @DataBoundSetter public void setAnnotations(List<PodAnnotation> annotations)
    • getImagePullSecrets

      public List<PodImagePullSecret> getImagePullSecrets()
    • addImagePullSecrets

      public void addImagePullSecrets(List<PodImagePullSecret> imagePullSecrets)
    • setImagePullSecrets

      @DataBoundSetter public void setImagePullSecrets(List<PodImagePullSecret> imagePullSecrets)
    • setNodeProperties

      @DataBoundSetter public void setNodeProperties(List<? extends NodeProperty<?>> properties)
    • getNodeProperties

      @NonNull public PodTemplateToolLocation getNodeProperties()
    • getResourceRequestMemory

      @Deprecated public String getResourceRequestMemory()
      Deprecated.
    • setResourceRequestMemory

      @Deprecated @DataBoundSetter public void setResourceRequestMemory(String resourceRequestMemory)
      Deprecated.
    • getResourceLimitCpu

      @Deprecated public String getResourceLimitCpu()
      Deprecated.
    • setResourceLimitCpu

      @Deprecated @DataBoundSetter public void setResourceLimitCpu(String resourceLimitCpu)
      Deprecated.
    • getResourceLimitMemory

      @Deprecated public String getResourceLimitMemory()
      Deprecated.
    • setResourceLimitMemory

      @Deprecated @DataBoundSetter public void setResourceLimitMemory(String resourceLimitMemory)
      Deprecated.
    • getResourceRequestCpu

      @Deprecated public String getResourceRequestCpu()
      Deprecated.
    • setResourceRequestCpu

      @Deprecated @DataBoundSetter public void setResourceRequestCpu(String resourceRequestCpu)
      Deprecated.
    • setVolumes

      @DataBoundSetter public void setVolumes(@NonNull List<PodVolume> items)
    • getVolumes

      @NonNull public List<PodVolume> getVolumes()
    • getWorkspaceVolume

      @NonNull public WorkspaceVolume getWorkspaceVolume()
    • setWorkspaceVolume

      @DataBoundSetter public void setWorkspaceVolume(WorkspaceVolume workspaceVolume)
    • setContainers

      @DataBoundSetter public void setContainers(@NonNull List<ContainerTemplate> items)
    • getContainers

      @NonNull public List<ContainerTemplate> getContainers()
    • getYaml

      public String getYaml()
      Returns:
      The persisted yaml fragment
    • setYaml

      @DataBoundSetter public void setYaml(String yaml)
    • getYamls

      @NonNull public List<String> getYamls()
    • setYamls

      public void setYamls(List<String> yamls)
    • getPodRetention

      public PodRetention getPodRetention()
    • setPodRetention

      @DataBoundSetter public void setPodRetention(PodRetention podRetention)
    • getListener

      @NonNull public TaskListener getListener()
      See Also:
    • getListenerOrNull

      @CheckForNull public TaskListener getListenerOrNull()
      See Also:
    • setListener

      public void setListener(@CheckForNull TaskListener listener)
    • getTerminationGracePeriodSeconds

      public Long getTerminationGracePeriodSeconds()
    • setTerminationGracePeriodSeconds

      public void setTerminationGracePeriodSeconds(Long terminationGracePeriodSeconds)
    • readResolve

      protected Object readResolve()
    • build

      @Deprecated public io.fabric8.kubernetes.api.model.Pod build(io.fabric8.kubernetes.client.KubernetesClient client, KubernetesSlave slave)
      Deprecated.
    • build

      public io.fabric8.kubernetes.api.model.Pod build(KubernetesSlave slave)
      Build a Pod object from a PodTemplate
      Parameters:
      slave -
    • getDescriptionForLogging

      @Deprecated public String getDescriptionForLogging()
      Deprecated.
      Use Serialization.asYaml(build(KubernetesSlave)) instead.
    • isInheritYamlMergeStrategy

      public boolean isInheritYamlMergeStrategy()
    • setInheritYamlMergeStrategy

      @DataBoundSetter public void setInheritYamlMergeStrategy(boolean inheritYamlMergeStrategy)
    • isShowRawYaml

      public boolean isShowRawYaml()
    • setShowRawYaml

      @DataBoundSetter public void setShowRawYaml(boolean showRawYaml)
    • save

      public void save()
      Empty implementation of Saveable interface. This interface is used for DescribableList implementation
      Specified by:
      save in interface Saveable
    • toString

      public String toString()
      Overrides:
      toString in class Object