This page explains you how to set up your development environment.
Before you start, install the following tools and packages:
- go
- goimports
- dep
- golangci-lint
- kubectl (>= 1.11)
- kubebuilder
- minikube
- docker
- gcloud (Install
beta
components) - sha1sum (for Mac
brew install md5sha1sum
)
go get -u github.com/elastic/cloud-on-k8s
cd ${GOPATH:-$HOME/go}/src/github.com/elastic/cloud-on-k8s
Run make check-requisites
to check that all dependencies are installed.
-
Run
make dep-vendor-only
to download extra Go libraries needed to compile the project and store them in the vendor directory. -
Get a working development Kubernetes cluster. You can either use:
make bootstrap-minikube # Sets up a Minikube cluster with required resources
or GKE
Make sure that container registry authentication is correctly configured as described here.
export GCLOUD_PROJECT=my-project-id make bootstrap-gke # Sets up GKE cluster with required resources
-
Deploy the operator.
make run
to run the operator locally, ormake deploy
to deploy the operators into the configured k8s cluster.make samples
to apply a sample stack resource.
E2E tests will run in the e2e
namespace. An operator must run and manage resources in the e2e
namespace.
To do that, run MANAGED_NAMESPACE=e2e make run
. Then you can run E2E tests in a separate shell make e2e-local
.