Class SshLaunchStrategy
java.lang.Object
hudson.model.AbstractDescribableImpl<AgentLaunchStrategy>
io.jenkins.plugins.namespacecloud.launcher.AgentLaunchStrategy
io.jenkins.plugins.namespacecloud.launcher.SshLaunchStrategy
- All Implemented Interfaces:
ExtensionPoint,Describable<AgentLaunchStrategy>
Connects by SSH from the controller into the instance.
Use this when the agent cannot dial out to Jenkins. The controller must be
able to reach Namespace's regional ingress, and the token additionally needs
the instance:ssh and ingress:access grants.
Namespace authorises SSH against public keys injected at instance creation. Those are computed from the configured private-key credential rather than configured alongside it: a separately stored public key silently stops matching the moment the credential is rotated, and the failure surfaces only as an agent that cannot be reached.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.jenkins.plugins.namespacecloud.launcher.AgentLaunchStrategy
AgentLaunchStrategy.AgentLaunchStrategyDescriptorNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe image must contain a JRE; the controller copiesagent.jarinto it. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidContributes to the instance request before it is sent — typically the container that will host the agent, plus any credentials it needs.createLauncher(NamespaceClient client, Compute.InstanceMetadata instance, LaunchContext ctx) Builds the Jenkins-side launcher.getImage()booleanWhether this strategy needs theinstance:sshandingress:accessgrants.voidvoidsetJavaPath(String javaPath) Methods inherited from class io.jenkins.plugins.namespacecloud.launcher.AgentLaunchStrategy
getDescriptor, requiresNodeRegisteredFirst
-
Field Details
-
DEFAULT_IMAGE
The image must contain a JRE; the controller copiesagent.jarinto it.- See Also:
-
-
Constructor Details
-
SshLaunchStrategy
-
-
Method Details
-
getImage
-
setImage
-
getCredentialsId
-
getJavaPath
-
setJavaPath
-
requiresSshGrants
public boolean requiresSshGrants()Description copied from class:AgentLaunchStrategyWhether this strategy needs theinstance:sshandingress:accessgrants.- Overrides:
requiresSshGrantsin classAgentLaunchStrategy
-
configureInstance
public void configureInstance(@NonNull Compute.CreateInstanceRequest.Builder builder, @NonNull LaunchContext ctx) throws IOException Description copied from class:AgentLaunchStrategyContributes to the instance request before it is sent — typically the container that will host the agent, plus any credentials it needs.- Specified by:
configureInstancein classAgentLaunchStrategy- Throws:
IOException- if the request cannot be completed, for instance because a configured credential is missing or unreadable. Failing here is preferable to provisioning an instance the controller would then be unable to connect to.
-
createLauncher
@NonNull public ComputerLauncher createLauncher(@NonNull NamespaceClient client, @NonNull Compute.InstanceMetadata instance, @NonNull LaunchContext ctx) throws IOException Description copied from class:AgentLaunchStrategyBuilds the Jenkins-side launcher. Called once the instance is RUNNING, so implementations may query the instance for connection details.- Specified by:
createLauncherin classAgentLaunchStrategy- Throws:
IOException
-