Skip to content

Latest commit

 

History

History
66 lines (56 loc) · 1.48 KB

File metadata and controls

66 lines (56 loc) · 1.48 KB

Development Guide

We welcome contributions! If you'd like to contribute to Lighthouse, please:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Submit a pull request.

Prerequisites

  • A Kubernetes Cluster (Can run locally with Kind of other tools)
    or a kubeconfig file of a remotely accessible Kubernetes cluster
  • A mongodb instance (For now, we only supporting mongodb but have plans to support more)
  • Golang dev environment

Steps

1. Create a Kind Cluster (Optional)

kind create cluster --name lighthouse

2. Clone Repository

3. Create a .env file taking reference from .env-example file

4. Set Environment Variables (in .env file):

  • Set RUN_MODE=DEVELOP
  • Set KUBE_CONFIG_FILE=YOUR_KUBECONFIG_FILENAME. Kubeconfig file is expected in $HOME/.kube directory.
  • Set CONTROLLER_GRPC_TLS_ENABLED="true"
  • Set MONGO_URI=YOUR_MONGO_CONNECTION_URI

5. Download Dependencies

go mod tidy

6. Run Controller

go run pkg/controller/main.go

7. Run Agent

go run pkg/agent/main.go

7. Run Frontend

cd frontend
npm install
npm start

Others

1. Generate Protobuf Go Files

protoc --go_out=. --go-grpc_out=. pkg/common/pb/PROTO_FILE_NAME

2. Run Go Test

cd pkg/k8s_test
go test
--  for specific func
go test -run TestFunctionA
-- coverage
go tool cover --html=coverage.out
-- to view in browser 
go tool cover --html=coverage.out