Closed giuseppegreco closed 6 years ago
$ kitectl register --help
Usage: kitectl register [options]
Registers your host to a kite authority.
If no server is specified, "https://discovery.koding.io/kite" is the default.
Options:
-to=https://discovery.koding.io/kite Kontrol URL
-username=koding Username
You need to point kitectl at your kontrol container with -to
flag. As to best practices for registering with kontrol, you should generate a kite.key for each of your app and inject it to each container.
Thanks it worked for me :-)
Hi @giuseppegreco do you have some example Dockerfiles? I am struggling with this as well. Thanks
Here it is:
FROM golang:alpine as builder
RUN apk add --update --no-cache git RUN go get -u github.com/golang/dep/cmd/dep RUN go get -d github.com/koding/kite
WORKDIR ${GOPATH}/src/github.com/koding/kite
RUN mkdir /build RUN ${GOPATH}/bin/dep ensure RUN go build -o /build/kontrol ./kontrol/kontrol
FROM alpine ENV APP_HOME /opt/robotrader
WORKDIR ${APP_HOME}
ADD ./certs/* /certs/ ADD ./kontrol.sh . RUN chmod a+x ./kontrol.sh
COPY --from=builder /build/kontrol . CMD ["./kontrol.sh"]
kontrol.sh looks like this:
while ! nc -z etcd 2379; do sleep 3; done ./kontrol -initial ./kontrol
I hope it helps, j3d
On 25 Jan 2019, at 08:25, Ralph King notifications@github.com wrote:
Hi @giuseppegreco do you have some example Dockerfiles? I am struggling with this as well. Thanks
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Thanks so much! Do you have one for one of your kites that is connecting? Showing how you are using kitetcl?
I use compose... and here’s my full file: version: '3.3'
services: etcd: image: 'quay.io/coreos/etcd' command: > etcd -name etcd -advertise-client-urls http://127.0.0.1:2379,http://127.0.0.1:4001 -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 -initial-advertise-peer-urls http://127.0.0.1:2380 -listen-peer-urls http://0.0.0.0:2380 healthcheck: test: ["CMD", "curl", "-f", "http://etcd:2379/version"] interval: '30s' timeout: '10s' retries: 5 networks: robotrader:
mongo: build: context: '.' dockerfile: 'Dockerfile.mongo' environment: MONGO_INITDB_DATABASE: 'robotrader' ports:
'data-storage:/data/db' networks: robotrader:
kontrol: env_file: 'variables.env' build: context: '.' dockerfile: 'Dockerfile.kontrol' ports:
'kite-key:/root/.kite' networks: robotrader:
broker_j3d: env_file: 'variables.env' build: context: '.' dockerfile: 'broker/Dockerfile' args: config_file: 'broker_j3d_prd.toml' ports:
'kite-key:/root/.kite' networks: robotrader:
analyzer: env_file: 'variables.env' build: context: '.' dockerfile: 'analyzer/Dockerfile' args: config_file: 'analyzer_prd.toml' ports:
'kite-key:/root/.kite' networks: robotrader:
trader: env_file: 'variables.env' build: context: '.' dockerfile: 'trader/Dockerfile' args: config_file: 'trader_prd.toml' ports:
volumes: data-storage: kite-key:
networks: robotrader: And here’s the Dockerfike of one of my kites (the others are just very similar): FROM golang:alpine as builder
RUN apk add --update --no-cache git RUN go get -u github.com/golang/dep/cmd/dep
ADD ./base ${GOPATH}/src/github.com/agamura/robotrader/base ADD ./broker ${GOPATH}/src/github.com/agamura/robotrader/broker ADD ./config ${GOPATH}/src/github.com/agamura/robotrader/config ADD ./logging ${GOPATH}/src/github.com/agamura/robotrader/logging ADD ./utils ${GOPATH}/src/github.com/agamura/robotrader/utils
COPY ./Gopkg.lock ${GOPATH}/src/github.com/agamura/robotrader/Gopkg.lock COPY ./Gopkg.toml ${GOPATH}/src/github.com/agamura/robotrader/Gopkg.toml
WORKDIR ${GOPATH}/src/github.com/agamura/robotrader
RUN mkdir /build RUN ${GOPATH}/bin/dep ensure RUN go build -o /build/broker ./broker/broker
FROM alpine ARG config_file
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
ENV APP_HOME /opt/robotrader WORKDIR ${APP_HOME}
ADD ./certs/* /certs/ COPY ./broker/config/${config_file} ./broker.toml COPY --from=builder /build/broker .
CMD ["./broker"]
Cheers, j3d
Sent from my iPhone
On 25 Jan 2019, at 09:09, Ralph King notifications@github.com wrote:
Thanks so much! Do you have one for one of your kites that is connecting? Showing how you are using kitetcl?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Thank you!
I've 3 kites, each dockerizied with its own container. The container running
kontrol
is fine as the first time the container is started, commandkontrol -inital
is executed and filekite.key
created in folder~/.kite
. However, the containers running my own kites fail because file~/.kite/kite.key
doesn't exist. Does this mean I should runkontrol -inital
in each container? How should I usekitectl
to register my kites tokontrol
, which is running on a different container?I've read the documentation but it is not very clear to me (
kitectl
is not explained very extensively and I was unable to find at least a working example). I've tried this...but it doesn't work:
Any help would be really appreciated. Many thanks :-)