Class NamespaceCloud
- All Implemented Interfaces:
ExtensionPoint,Describable<Cloud>,ModelObject,SearchableModelObject,SearchItem,AccessControlled,ModelObjectWithContextMenu
Configured once globally (endpoint, token, profiles); jobs then select a profile by label and Jenkins asks this cloud to provision when the queue cannot be served by existing nodes.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class hudson.slaves.Cloud
Cloud.CloudStateNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanProvision(Cloud.CloudState state) client()Returns a client for the configured endpoint and token, rebuilding it if either changed since last time.voiddestroyInstance(String instanceId, String reason) The URL the agent will dial back to.ComputeService is regional; the override exists for non-standard deployments.The label shown in the UI, which is safe to change at any time.intThe site to place the instance in, e.g.The workspace segment in nscr.io image references, e.g.provision(Cloud.CloudState state, int excessWorkload) static SecretresolveToken(String credentialsId) Public so the launch strategies can resolve the same credential for their own lookups.voidsetComputeEndpointOverride(String computeEndpointOverride) voidsetCredentialsId(String credentialsId) voidsetDisplayName(String displayName) voidsetInstanceCap(int instanceCap) voidsetInstanceRegion(String instanceRegion) voidsetJenkinsUrlOverride(String jenkinsUrlOverride) voidvoidsetRegistryPrefix(String registryPrefix) voidsetTemplates(List<AgentTemplate> templates) templateFor(Label label) Methods inherited from class hudson.slaves.Cloud
all, canProvision, doConfigSubmit, doDoDelete, getACL, getDescriptor, getIcon, getIconAltText, getIconClassName, getSearchUrl, getUrl, provision, reconfigure, reconfigure, registerPermissionsMethods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, getDynamic, removeAction, removeActions, replaceAction, replaceActionsMethods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2Methods inherited from interface hudson.search.SearchItem
getSearchGroup, getSearchIcon
-
Field Details
-
LABEL_MANAGED_BY
Instance labels, used to reap instances orphaned by a controller restart.Namespace documents label names as matching
^[a-z]([a-z0-9-.]*[a-z0-9])?$and at most 63 bytes. A Kubernetes-stylejenkins.io/agentis therefore rejected: the slash is not in that character class, and CreateInstance fails with INVALID_ARGUMENT.- See Also:
-
LABEL_CLOUD
- See Also:
-
LABEL_AGENT
- See Also:
-
MANAGED_BY_VALUE
- See Also:
-
-
Constructor Details
-
NamespaceCloud
-
-
Method Details
-
getDisplayName
The label shown in the UI, which is safe to change at any time.Cloud.namedeliberately is not editable on the configuration page. Jenkins asks for it when the cloud is created and rejects a duplicate there, but nothing stops a later edit from colliding with another cloud, and duplicate cloud names cause trouble inside Jenkins. Renaming is therefore done here instead, leaving the identity alone.Falls back to the name so the UI never shows a blank cloud.
- Specified by:
getDisplayNamein interfaceModelObject- Overrides:
getDisplayNamein classCloud
-
setDisplayName
-
getCredentialsId
-
setCredentialsId
-
getRegion
-
setRegion
-
getComputeEndpointOverride
-
setComputeEndpointOverride
-
getInstanceRegion
The site to place the instance in, e.g.ord.Distinct from
getRegion(), which only selects which API host to talk to. Blank is the sensible default: Namespace then picks any site with capacity for the requested shape. Setting this to an endpoint prefix such as "us" matches no site and the API rejects the request withno available region to start a linux/amd64 instance. -
setInstanceRegion
-
getRegistryPrefix
The workspace segment in nscr.io image references, e.g.abc012abc012innscr.io/abc012abc012/jenkins-agent:1.0.It has to be configured: the registry API reports bare repository names and the tenant is implicit in the token, and no RPC available to a least-privileged token reveals the tenant id. Without it, suggested image references are missing the segment and Namespace answers
failed to resolve image. -
setRegistryPrefix
-
getComputeEndpoint
ComputeService is regional; the override exists for non-standard deployments. -
getJenkinsUrlOverride
-
setJenkinsUrlOverride
-
getInstanceCap
public int getInstanceCap() -
setInstanceCap
@DataBoundSetter public void setInstanceCap(int instanceCap) -
getTemplates
-
setTemplates
-
client
Returns a client for the configured endpoint and token, rebuilding it if either changed since last time.- Throws:
IOException
-
resolveToken
Public so the launch strategies can resolve the same credential for their own lookups. -
destroyInstance
-
templateFor
-
canProvision
- Overrides:
canProvisionin classCloud
-
provision
public Collection<NodeProvisioner.PlannedNode> provision(Cloud.CloudState state, int excessWorkload) -
effectiveJenkinsUrl
The URL the agent will dial back to.- Throws:
IOException
-