Kubernetes + Next.js Microservice Boilerplate
This project was built using Stephen Grider's course as a guideline.
It has been modernized and refactored to my own personal styling/organizational choices.
It's recommended to use pnpm for package management and running scripts.
The repository is managed with Lerna and enhanced with NX.
- Kubernetes cluster running with ingress-nginx
- With minikube, use
pnpm setup:minikube
andpnpm setup:secrets
scripts
- With minikube, use
- Hostfile mapping from skaffold.local to cluster IP
- Alternatively, update domain name in configuration
To see all available scripts, type pnpm scripts
pnpm setup:minikube
: startup or create a minikube clusterpnpm setup:secrets
: setup environment secretspnpm start
: start the Skaffold development environmentpnpm build
: build all packages (concurrency 6)pnpm test
: test all packagespnpm pods
: show current Kubernetes podspnpm pods:ingress
: show the ingress-nginx podspnpm graph
: view the NX project graphpnpm version:[inc]
: increment version number; [inc] = major, minor, or patchpnpm commit:quick
: for easy testing, perform a commit with generic messagepnpm publish:quick
: for easy testing, commit, patch, and publish all packagespnpm docker:build
: build the docker images for all packagespnpm docker:push
: push the docker images for all packages
- package.json
- skaffold.yaml
- packages/*
- Microservice source files
- k8s/*
- Kubernetes configuration
Tests can be debugged using the Visual Studio Code debugger, and can be run from the workspace with the included launch.json
, which should be updated to match modifications to the project.