- Enter the dev shell and start the local cluster:
nix develop
- You're also likely to use a local k8s, in this case minikube is available to use:
kubectl config set-context minikube
minikube start --driver=docker --cpus=10 --memory 8192 --disk-size 32g
minikube addons enable ingress
minikube addons enable metrics-server
istioctl install --set profile=demo -y
minikube dashboard
On a second terminal, start the tunnel:
minikube tunnel
To publish multi-arch images, you can use the following command:
$(nix build .#publish-<SERVICE_NAME>-container --no-link --print-out-paths)/bin/push
# For instance, to publish the kontrol-service image:
$(nix build .#publish-kontrol-service-container --no-link --print-out-paths)/bin/push
Building and loading image into minikube:
# First set the docker context to minikube
eval $(minikube docker-env)
docker load < $(nix build ./#kontrol-service-container --no-link --print-out-paths)
To build and run the service directly in dev mode (a locally running Postgres DB is required):
DB_HOSTNAME=localhost DB_USERNAME=postgres DB_NAME=kardinal DB_PORT=5432 DB_PASSWORD=<database password> nix run ./#kontrol-service -- -dev-mode
You will need to do this every time a go.mod
file is edited
nix develop
gomod2nix generate