docker-compose up -d
go mod tidy
go run ./services/{service-name}/cmd/main.gofrom ./shared/env
_ = env.LoadEnv("payment-service")from ./shared/env
port := env.GetString("REST_PORT", "3001")
num := env.GetInt("SECRET_INT", 3000)Tilt builds code for Linux, so Windows users must use WSL2: WSL Installation guide: https://medium.com/@sidsamanta/installing-wsl-in-windows-10-b6e8d04f5481
Configure Docker Desktop for WSL2:
- Open Docker Desktop Settings
- Go to Resources → WSL Integration
- Enable integration with your WSL2 distro (Ubuntu)
- Click "Apply & Restart"
Alternatively, if you don't want to use WSL, you must add .bat file to build compatible code for linux system Example, chat-build.bat
set CGO_ENABLED=0
set GOOS=linux
set GOARCH=amd64
go build -o build/chat-service ./services/chat-service/cmd/main.goAnd add tilt script to run .bat file
chat_compile_cmd = 'CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/chat-service ./services/chat-service'
if os.name == 'nt':
chat_compile_cmd = './infra/development/docker/chat-build.bat'Open WSL2 terminal (Ubuntu) and run:
# Install Minikube
# See: https://minikube.sigs.k8s.io/docs/start/?arch=%2Fmacos%2Farm64%2Fstable%2Fbinary+download if this command is bug
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
# Install kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
# Install Tilt
curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.sh | bash
# Install Make
sudo apt-get update
sudo apt-get install make# Install Homebrew (if not installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Minikube
brew install minikube
# Install kubectl
brew install kubectl
# Install Tilt
brew install tilt
# Install Make (usually pre-installed, verify with: make --version)Create centralized secrets file:
All secrets are now centralized in a single file:
infra/development/k8s/secrets.yaml
Note: This file is gitignored. Make sure to create it locally and never commit secrets to version control.
Run on terminal
# Start Minikube
minikube start
# Verify cluster is running
kubectl cluster-info
# Check nodes
kubectl get nodestilt up
# Open Tilt UI in browser
# Visit http://localhost:10350# Stop Tilt (Ctrl+C in terminal, then)
tilt downminikube stop # Stop Minikube (optional)
minikube delete # Delete Minikube cluster (if needed)Make Installation
- Windows: Install in WSL2:
sudo apt-get install make - macOS: Pre-installed (verify with
make --version)
Windows WSL2: Run in WSL2 terminal
macOS: Run in Terminal
# Create service with custom name
make create SERVICE=order-servicemake list-protos# Generate from a proto file
make proto FILE=user_management.proto- Outputs to
shared/proto/{package_name}/
make proto-all- Generates code for each file in its own package directory
Removes all generated protobuf files.
# Using proto-clean
make proto-clean
# Or using clean (same effect)
make cleanStarts all microservices concurrently in separate processes.
make run# Clean and regenerate all protos
make clean && make proto-all