This is how to deploy thw image on your local k8s running on Mac. In reference to the project Aegis
- Install
kindandkubectl
brew install kind kubectl - Create kind cluster if not already created
kind create cluster kubectl get nodes - Build the Docker image with podman
podman build -t aegis:dev . - Save and load image to kind cluster
podman save localhost/aegis:dev -o aegis.tar kind load image-archive aegis.tar - Deploy PostgreSQL 18
kubectl apply -f k8s/postgres.yaml - Wait for PostgreSQL to be ready
kubectl wait --for=condition=ready pod -l app=postgres --timeout=60s kubectl get pods - Create data extension and run migrations
kubectl exec deployment/postgres -- psql -U admin -d jwt_server -c "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" cat migrations/0001_initial.up.sql | kubectl exec -i deployment/postgres -- psql -U admin -d jwt_server - Apply application configuration
Below command is to create configmap and save it to k8s/configmap.yaml kubectl create configmap aegis-config --from-file=configs/application.yaml --from-file=configs/secrets.json --dry-run=client -o yaml > k8s/configmap.yaml kubectl apply -f k8s/configmap.yaml kubectl apply -f k8s/deployment.yaml kubectl apply -f k8s/service.yaml - Wait for the application to be ready
kubectl wait --for=condition=ready pod -l app=aegis --timeout=60s kubectl get pods - Check logs to verify it's running
kubectl logs deployment/aegis - Access the service locally
# Port forward to access the API kubectl port-forward svc/aegis 8080:80 # In another terminal, test the API curl -X POST http://localhost:8080/api/v1/auth/signup \ -H "Content-Type: application/json" \ -d '{ "email": "test@example.com", "firstName": "Test", "lastName": "User", "password": "TestPassword123!" }'
When building the image on arm-64 mac using podman it might fail. In that case increase the memory
podman machine stopto stop the podmanpodman machine set --memory 8192to increase the memory to 8GBpodman machine set --cpus 4to increase the cpus to 4podman machine startto start the podmanpodman machine infoto see the info of the podman. Then Re-run the build