public class KubernetesCloud extends Cloud
Modifier and Type | Class and Description |
---|---|
static class |
KubernetesCloud.DescriptorImpl |
static class |
KubernetesCloud.PodTemplateSourceImpl |
ExtensionPoint.LegacyInstancesAreScopedToHudson
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_REQUESTS_PER_HOST |
static Map<String,String> |
DEFAULT_POD_LABELS
Deprecated.
|
static Integer |
DEFAULT_WAIT_FOR_POD_SEC |
static String |
JNLP_NAME |
Constructor and Description |
---|
KubernetesCloud(String name) |
KubernetesCloud(String name,
KubernetesCloud source)
Copy constructor.
|
KubernetesCloud(String name,
List<? extends PodTemplate> templates,
String serverUrl,
String namespace,
String jenkinsUrl,
String containerCapStr,
int connectTimeout,
int readTimeout,
int retentionTimeout)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addDynamicTemplate(PodTemplate t)
Add a dynamic pod template.
|
void |
addTemplate(PodTemplate t)
Add a new template to the cloud
|
boolean |
canProvision(Label label) |
io.fabric8.kubernetes.client.KubernetesClient |
connect()
Connects to Kubernetes.
|
boolean |
equals(Object o) |
List<PodTemplate> |
getAllTemplates()
Returns all pod templates for this cloud including the dynamic ones.
|
int |
getConnectTimeout() |
int |
getContainerCap() |
String |
getContainerCapStr() |
String |
getCredentialsId() |
String |
getDefaultsProviderTemplate() |
String |
getJenkinsTunnel() |
String |
getJenkinsUrl() |
String |
getJenkinsUrlOrDie()
Returns Jenkins URL to be used by agents launched by this cloud.
|
Map<String,String> |
getLabels()
Deprecated.
use
getPodLabels() |
ArrayList<PodTemplate> |
getMatchingTemplates(Label label)
Deprecated.
Use
getTemplatesFor(Label) instead. |
int |
getMaxRequestsPerHost() |
String |
getMaxRequestsPerHostStr() |
String |
getNamespace() |
List<PodLabel> |
getPodLabels()
Labels for all pods started by the plugin
|
PodRetention |
getPodRetention()
Gets the global pod retention policy for the plugin.
|
int |
getReadTimeout() |
int |
getRetentionTimeout() |
String |
getServerCertificate() |
String |
getServerUrl() |
PodTemplate |
getTemplate(Label label)
Gets
PodTemplate that has the matching Label . |
List<PodTemplate> |
getTemplates() |
List<PodTemplate> |
getTemplatesFor(Label label)
Gets all PodTemplates that have the matching
Label . |
PodTemplate |
getUnwrappedTemplate(PodTemplate podTemplate)
Unwraps the given pod template.
|
Integer |
getWaitForPodSec() |
int |
hashCode() |
boolean |
isAddMasterProxyEnvVars() |
boolean |
isCapOnlyOnAlivePods()
Deprecated.
|
boolean |
isOpenShift() |
boolean |
isSkipTlsVerify() |
boolean |
isUsageRestricted() |
Collection<NodeProvisioner.PlannedNode> |
provision(Label label,
int excessWorkload) |
void |
removeDynamicTemplate(PodTemplate t)
Remove a dynamic pod template.
|
void |
removeTemplate(PodTemplate t)
Remove a
|
void |
setAddMasterProxyEnvVars(boolean addMasterProxyEnvVars) |
void |
setCapOnlyOnAlivePods(boolean capOnlyOnAlivePods)
Deprecated.
|
void |
setConnectTimeout(int connectTimeout) |
void |
setContainerCapStr(String containerCapStr) |
void |
setCredentialsId(String credentialsId) |
void |
setDefaultsProviderTemplate(String defaultsProviderTemplate) |
void |
setJenkinsTunnel(String jenkinsTunnel) |
void |
setJenkinsUrl(String jenkinsUrl) |
void |
setLabels(Map<String,String> labels)
Deprecated.
|
void |
setMaxRequestsPerHostStr(String maxRequestsPerHostStr) |
void |
setNamespace(String namespace) |
void |
setPodLabels(List<PodLabel> labels)
Set Pod labels for all pods started by the plugin.
|
void |
setPodRetention(PodRetention podRetention)
Set the global pod retention policy for the plugin.
|
void |
setReadTimeout(int readTimeout) |
void |
setRetentionTimeout(int retentionTimeout) |
void |
setServerCertificate(String serverCertificate) |
void |
setServerUrl(String serverUrl) |
void |
setSkipTlsVerify(boolean skipTlsVerify) |
void |
setTemplates(List<PodTemplate> templates) |
void |
setUsageRestricted(boolean usageRestricted) |
void |
setWaitForPodSec(Integer waitForPodSec) |
String |
toString() |
all, getACL, getDescriptor, getDisplayName, getSearchUrl, getUrl
addAction, addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, removeAction, removeActions, replaceAction, replaceActions
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
checkPermission, hasPermission, hasPermission
public static final int DEFAULT_MAX_REQUESTS_PER_HOST
public static final Integer DEFAULT_WAIT_FOR_POD_SEC
public static final String JNLP_NAME
@Deprecated public static final Map<String,String> DEFAULT_POD_LABELS
@DataBoundConstructor public KubernetesCloud(String name)
public KubernetesCloud(@NonNull String name, @NonNull KubernetesCloud source)
name
- Name of the cloud to be createdsource
- Source Kubernetes cloud implementation@Deprecated public KubernetesCloud(String name, List<? extends PodTemplate> templates, String serverUrl, String namespace, String jenkinsUrl, String containerCapStr, int connectTimeout, int readTimeout, int retentionTimeout)
public boolean isUsageRestricted()
@DataBoundSetter public void setUsageRestricted(boolean usageRestricted)
public int getRetentionTimeout()
@DataBoundSetter public void setRetentionTimeout(int retentionTimeout)
public String getDefaultsProviderTemplate()
@DataBoundSetter public void setDefaultsProviderTemplate(String defaultsProviderTemplate)
public boolean isOpenShift()
@Nonnull public List<PodTemplate> getTemplates()
@Nonnull public List<PodTemplate> getAllTemplates()
@DataBoundSetter public void setTemplates(@Nonnull List<PodTemplate> templates)
public String getServerUrl()
public String getServerCertificate()
@DataBoundSetter public void setServerCertificate(String serverCertificate)
public boolean isSkipTlsVerify()
@DataBoundSetter public void setSkipTlsVerify(boolean skipTlsVerify)
public boolean isAddMasterProxyEnvVars()
@DataBoundSetter public void setAddMasterProxyEnvVars(boolean addMasterProxyEnvVars)
public String getNamespace()
@DataBoundSetter public void setNamespace(String namespace)
@CheckForNull public String getJenkinsUrl()
@DataBoundSetter @Deprecated public void setCapOnlyOnAlivePods(boolean capOnlyOnAlivePods)
@Deprecated public boolean isCapOnlyOnAlivePods()
@Nonnull public String getJenkinsUrlOrDie()
IllegalStateException
- if no Jenkins URL could be computed.@DataBoundSetter public void setJenkinsUrl(String jenkinsUrl)
public String getJenkinsTunnel()
@DataBoundSetter public void setJenkinsTunnel(String jenkinsTunnel)
public String getCredentialsId()
@DataBoundSetter public void setCredentialsId(String credentialsId)
public int getContainerCap()
@DataBoundSetter public void setContainerCapStr(String containerCapStr)
public String getContainerCapStr()
public int getReadTimeout()
@DataBoundSetter public void setReadTimeout(int readTimeout)
public int getConnectTimeout()
@Deprecated public Map<String,String> getLabels()
getPodLabels()
@Deprecated public void setLabels(Map<String,String> labels)
setPodLabels(List)
labels
- pod labels@NonNull public List<PodLabel> getPodLabels()
@DataBoundSetter public void setPodLabels(@CheckForNull List<PodLabel> labels)
@DataBoundSetter public void setMaxRequestsPerHostStr(String maxRequestsPerHostStr)
public String getMaxRequestsPerHostStr()
public int getMaxRequestsPerHost()
@DataBoundSetter public void setConnectTimeout(int connectTimeout)
public PodRetention getPodRetention()
@DataBoundSetter public void setPodRetention(PodRetention podRetention)
podRetention
- the pod retention policy for the plugin.public io.fabric8.kubernetes.client.KubernetesClient connect() throws UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, IOException, CertificateEncodingException
UnrecoverableKeyException
NoSuchAlgorithmException
KeyStoreException
IOException
CertificateEncodingException
public Collection<NodeProvisioner.PlannedNode> provision(@CheckForNull Label label, int excessWorkload)
public boolean canProvision(@CheckForNull Label label)
canProvision
in class Cloud
public PodTemplate getTemplate(@CheckForNull Label label)
PodTemplate
that has the matching Label
.label
- label to look for in templatespublic PodTemplate getUnwrappedTemplate(PodTemplate podTemplate)
podTemplate
- the pod template to unwrap.@Deprecated public ArrayList<PodTemplate> getMatchingTemplates(@CheckForNull Label label)
getTemplatesFor(Label)
instead.Label
.label
- label to look for in templatespublic List<PodTemplate> getTemplatesFor(@CheckForNull Label label)
Label
.label
- label to look for in templatespublic void addTemplate(PodTemplate t)
t
- docker templatepublic void removeTemplate(PodTemplate t)
t
- docker templatepublic void addDynamicTemplate(PodTemplate t)
t
- the template to addpublic void removeDynamicTemplate(PodTemplate t)
t
- the template to removepublic Integer getWaitForPodSec()
@DataBoundSetter public void setWaitForPodSec(Integer waitForPodSec)
Copyright © 2016–2019. All rights reserved.