Distributed microservices using Kite and Kontrol

497 views Asked by At

I am able to register my kite microservice to kontrol but unable to discover it,

kites, err := k.GetKites(&protocol.KontrolQuery{
        Username:    k.Config.Username,
        Environment:k.Config.Environment,
        Name:"myservice",
    })enter code here
    if err != nil {
        fmt.Println("has error")
        log.Fatalln(err)
    }

I am getting authenticationError.

has error
2015/06/16 09:59:16 authenticationError: token contains an invalid number of segments
exit status 1

Also I am not able to find $USER_HOME/.kite/kite.key file.

1

There are 1 answers

2
Shishir On BEST ANSWER

I have figured it out. I need to export these environment variable,

export KONTROL_PORT=4099
export KONTROL_USERNAME="kontrol"
export KONTROL_STORAGE="etcd"
export KONTROL_KONTROLURL="http://127.0.0.1:4099/kite"
export KONTROL_PUBLICKEYFILE=~/certs/key_pub.pem
export KONTROL_PRIVATEKEYFILE=~/certs/key.pem

Then generate rsa token,

cd ~/certs/
openssl genrsa -out key.pem 2048
openssl rsa -in key.pem -pubout > key_pub.pem
openssl rsa -in key.pem -pubout > key_pub.pem

Run Kontrol CLI with -install flag.