TritonDataCenter / triton-kubernetes

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

Manager creation claims Private key does not match Public Key (but it does) #92

Closed ruprict closed 6 years ago

ruprict commented 6 years ago

Here's what I see

 $ triton-kubernetes create manager
✔ Backend Provider: Local
create manager called
✔ Cluster Manager Name: test
✔ Highly Available: Yes
✔ How many master nodes: 2
✔ Private Registry: None
✔ Rancher Server Image: Default
✔ Rancher Agent Image: Default
✔ Triton Key Path: ~/.ssh/id_rsa_triton
Private key file does not match public key fingerprint

I can create docker containers via triton-docker and peform other tasks with the configured Triton profile. Also, I ran the following file to check if the keys match:

PRIVKEY=~/.ssh/id_rsa_triton
TESTKEY=~/.ssh/id_rsa_triton.pub
diff <( ssh-keygen -y -e -f "$PRIVKEY" ) <( ssh-keygen -y -e -f "$TESTKEY" )

which output nothing (as it should for matching keys). I also verified the public key I used on my Triton account matches the public key I have locally.

So, if anyone can help me figure out how to get past this, I'd appreciate it. I really would like to use k8s on Triton...

Thanks.

ruprict commented 6 years ago

Well, as it so often happens, I figured out why this was happening just after creating this issue. In my .zshrc I have the following:

export TRITON_KEY_ID="$(ssh-keygen -l -f $HOME/.ssh/id_rsa_triton.pub | awk '{print $2}')"

which sets the value as something like SHA256:gRCIX3fN2SoW22gsbDaKSPYrvtJwgKP4qKxzvqONj+F which is not the ID Triton uses. I have no idea where that line came from.

Changed it to

ssh-keygen -E md5 -lf ~/.ssh/id_rsa_triton.pub | awk '{ print $2 }' | cut -c 5-

and no longer see the issue.

Sorry...seems like this was another me problem ;)