TritonDataCenter / triton-kubernetes

Kubernetes on Triton
Mozilla Public License 2.0
183 stars 43 forks source link

"Unable to parse private key" error when attempting to create cluster manager on macOS. #167

Open john-terrell opened 3 years ago

john-terrell commented 3 years ago

This repos on latest master and v1.0.1-pre1 with macOS 11.4 as the host.

$ triton-kubernetes create manager
✔ Backend Provider: Local
✔ Cloud Provider: Triton
Cluster Manager Name: DemoClusterManager
Private Registry: None
Rancher Agent Image: Default
Set UI Admin Password: ********
Triton Account Name: <some account here>
Triton Key Path: ~/.ssh/id_rsa
Triton URL: https://<api address>
unable to parse private key: asn1: structure error: tags don't match (16 vs {class:1 tag:15 length:112 isCompound:true}) {optional:false explicit:false application:false private:false defaultValue:<nil> tag:<nil> stringType:0 timeType:0 set:false omitEmpty:false} pkcs1PrivateKey @2

I've tried feeding it the root id_rsa key as well as a special custom RSA private key.

mariuspana commented 3 years ago

I believe you need your keys in the "old" ssh format, MD5.

outbackdingo commented 2 years ago

same still seems broken

triton-kubernetes create manager ✔ Backend Provider: Local ✔ Cloud Provider: Triton ✔ Cluster Manager Name: admin ✔ Private Registry: None ✔ Rancher Server Image: Default ✔ Rancher Agent Image: Default ✔ Set UI Admin Password: ** ✔ Triton Account Name: admin ✔ Triton Key Path: ~/.ssh/id_rsa ✔ Triton URL: https://cloudapi.cloud.cloud.com unable to parse private key: asn1: structure error: tags don't match (16 vs {class:1 tag:15 length:112 isCompound:true}) {optional:false explicit:false application:false private:false defaultValue: tag: stringType:0 timeType:0 set:false omitEmpty:false} pkcs1PrivateKey @2 ❯ triton-kubernetes create manager --non-interactive --config manager-on-triton.yaml Running in non interactive mode Using config file: manager-on-triton.yaml unable to parse private key: asn1: structure error: tags don't match (16 vs {class:1 tag:15 length:112 isCompound:true}) {optional:false explicit:false application:false private:false defaultValue: tag: stringType:0 timeType:0 set:false omitEmpty:false} pkcs1PrivateKey @2

cat manager-on-triton.yaml

This sample config file will create a Cluster Manager on Joyent's Public Cloud (triton)

backend_provider: local name: manager-on-triton manager_cloud_provider: triton private_registry: "" private_registry_username: "" private_registry_password: "" rancher_server_image: "" rancher_agent_image: "" triton_account: admin triton_key_path: ~/.ssh/id_rsa triton_key_id: b6:eb:c4:c3:b0:c8:32:ad:39:d1:77:6f:78:db:1e:b5 triton_url: https://cloudapi.cloud.cloud.com triton_network_names:

pulquero commented 2 years ago

Same issue here, too, MacOS, triton-kubernetes v0.9.0-pre2 from brew install.