Skip to content

Configure docker-plugin clouds agent with ssh key strategi #2739

@colbacc8

Description

@colbacc8

Describe your use-case which is not covered by existing documentation.

Dear all,
I'm using jenkins casc plugin to configure my jenkins instance.

I'm using the docker-plugin with cloud agents to build images with jenkins.

Until now, I used the connector attach strategy to connect jenkins with agents.

I need to create the jcasc configuration to apply the ssh key strategy with credentials to connetct jenkins and agents

I tried to find examples, but without success...

I've tried to use the following configuration:

- labelString: "worker1-agent"
            dockerTemplateBase:
              image: "jenkins/ssh-agent:latest-jdk17"
              mounts:
                - "type=tmpfs,destination=/run"
                - "type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock"
            remoteFs: "/home/jenkins/agent"
            connector:
              ssh:
                user: "root"

it failed with the following error:

io.jenkins.plugins.casc.UnknownAttributesException: ssh: Invalid configuration elements for type: class io.jenkins.docker.connector.DockerComputerSSHConnector : user.

If I remove user: "root", I receive another error

could you please help me in make this configuration working with jcasc?

Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationA PR that adds to documentation - used by Release Drafter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions