repositorypackage
1.2.1
Repository: https://github.com/sankalp-r/kubermatic.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# README
Kubermatic API
Development environment
Due to the big dependency tree derived from Kubernetes it is strongly recommended to set up a separate GOPATH
environment for Kubermatic:
$ mkdir $HOME/src/kubermatic
$ cd $HOME/src/kubermatic
$ export GOPATH=$PWD
$ mkdir -p bin pkg src
$ cd src/kubermatic
$ git clone [email protected]:kubermatic/api
$ git clone [email protected]:kubermatic/config
$ cd api
$ echo 'dummy: dummy' > secrets.yaml
mkdir -p template/coreos &&
pushd template/coreos &&
ln -sf ../../../config/kubermatic/static/nodes/aws/template/coreos/cloud-config-node.yaml aws-cloud-config-node.yaml &&
ln -sf ../../../config/kubermatic/static/nodes/digitalocean/template/coreos/cloud-config-node.yaml do-cloud-config-node.yaml &&
popd
Dependencies
Install dependencies
glide install --strip-vendor
Update dependencies
glide update --strip-vendor
Building locally
In order to use incremental compilation one can compile a binary as follows:
$ make GOBUILD="go install" build
Running locally
kubermatic-api
./kubermatic-api \
--worker-name="unique-label-abcdef123" \
--kubeconfig=$GOPATH/src/github.com/kubermatic/config/seed-clusters/dev.kubermatic.io/kubeconfig \
--datacenters=$GOPATH/src/github.com/kubermatic/config/seed-clusters/dev.kubermatic.io/datacenters.yaml \
--jwt-key=RE93Ef1Yt5-mrp2asikmfalfmcRaaa27gpH8hTAlby48LQQbUbn9d4F7yh01g_cc \
--logtostderr \
--v=8 \
--address=127.0.0.1:8080 \
kubermatic-cluster-controller
./kubermatic-cluster-controller \
--datacenters=$GOPATH/src/github.com/kubermatic/config/seed-clusters/dev.kubermatic.io/datacenters.yaml \
--kubeconfig=$GOPATH/src/github.com/kubermatic/config/seed-clusters/dev.kubermatic.io/kubeconfig \
--worker-name="unique-label-abcdef123" \
--logtostderr=1 \
--master-resources=$GOPATH/src/github.com/kubermatic/config/kubermatic/static/master \
--v=4 \
--addon-resources=$GOPATH/src/github.com/kubermatic/api/addon-charts \
--external-url=dev.kubermatic.io
Valid worker-name label value must be 63 characters or less and must be empty or begin and end with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. The dev label should be also unique between a pair of api<->controller.
Linting / Testing
Install linters
go get -u github.com/golang/lint/golint
go get -u github.com/client9/misspell/cmd/misspell
go get -u github.com/kisielk/errcheck
go get -u github.com/Masterminds/glide
go get -u github.com/opennota/check/cmd/varcheck
go get -u github.com/opennota/check/cmd/structcheck
go get -u honnef.co/go/tools/cmd/unused
go get -u honnef.co/go/tools/cmd/gosimple
Run linters
Before every push, make sure you run:
make check
gofmt errors can be automatically fixed by running
make fix
Run tests
make test
CI/CD
Currently: Wercker - Which uses the wercker.yaml
& does a build on every push.
Future: Jenkins which uses the Jenkinsfile
& also does a build on every push.