TritonDataCenter / docker-machine-driver-triton

Joyent's Docker Machine Driver for provisioning Docker hosts on Triton
Mozilla Public License 2.0
4 stars 7 forks source link

Machine driver for Rancher #12

Open neuroserve opened 6 years ago

neuroserve commented 6 years ago

I'd like to add the triton machine driver to Rancher (rancher.com). Docs: http://rancher.com/docs/rancher/v1.3/en/configuration/machine-drivers/

Where can I find the "machine driver binary 64-bit Linux" or how can I create it? Sorry, I'm not a go master (yet).

neuroserve commented 6 years ago

Sorry - my go version was to old. I got a binary now

neuroserve commented 6 years ago

OK. Having compiled docker-machine-driver-triton I tried to add it as a custom docker-machine driver to rancher (s. http://rancher.com/docs/rancher/v1.3/en/configuration/machine-drivers/). That worked OK. Problem is, that we have to add "A path to an SSH private key file that has been added to $SDC_ACCOUNT" to provision a VM. I guess, this path would be inside the rancher server (which is a docker container, as well). I've tried to add it (by mapping a volume inside the rancher server) but get

Error with pre-create check: "error creating SSH private key signer: Error PEM-decoding private key material: nil block received

back from the cloudapi. I know, that this is probably a rancher question but at the same time I suspect that here are more Joyent users than in the rancher-community. Can I provide the key instead of the path to the key?

jwreagor commented 6 years ago

The error you've described, error creating SSH private key signer: Error PEM-decoding private key material: nil block received, typically comes from a string value being input into our Go client library (triton-go) but not in a format that can be parsed. That would be the Error PEM-decoding private key material part.

Verify the key input into the Docker Machine driver. Make sure you are handling newlines properly or transforming newlines before it is used by Docker Machine. I'm not sure how this can be done with Rancher.

Let me know what you find, interested in helping debug this.

jwreagor commented 6 years ago

As another example, the same Go client library (triton-go) that Docker Machine driver is using is also used by Minio. In order to pass a key into a container to run Minio I had to transform newlines into # than back into newlines. Here's the relevant bits.

blackwood821 commented 2 years ago

@neuroserve I'm a little late to the party but did you ever get this working? I'm interested in a rancher machine driver for triton as well.

blackwood821 commented 2 years ago

@neuroserve I recently worked on getting this machine driver working in Rancher and IIRC I also encountered this error in the beginning:

error creating SSH private key signer: Error PEM-decoding private key material: nil block received

and I think I worked around it by generating a new SSH key in PEM format (ssh-keygen -m PEM ...) and added that to my Triton account. Then triton-go didn't complain about the key. The key that it didn't like started with:

-----BEGIN OPENSSH PRIVATE KEY-----

and the PEM key that it liked started with:

-----BEGIN RSA PRIVATE KEY-----

I guess, this path would be inside the rancher server (which is a docker container, as well). I've tried to add it (by mapping a volume inside the rancher server)

Since this is a very old issue with no recent activity I opened a new issue (https://github.com/TritonDataCenter/docker-machine-driver-triton/issues/13) related to this that will be followed up by a PR for making this driver compatible with Rancher.