Local deployment

Microservice stack comes with a CLI tool that helps you deploy your infrastructure locally. In order to start local deployment, you must first have ran Configuration generator. This generator generates all required files for local deployment.

The deployment CLI can be run using NPX. There are three different CLI commands available

Install

npx @microservice-stack/local-deployment@latest install

This command will set up local Minikube cluster will all deployments that are required to run your application. It will also build and deploy all the services that are located inside the apps/api folder.

Update service

npx @microservice-stack/local-deployment@latest update --service <name>

This command is used to deploy new version of a service to the already deployed minikube. This command will not work correctly if used before install command.

Update ingress controller

npx @microservice-stack/local-deployment@latest update-ingress

This command will deploy new version of the ingress controller. It takes in values that are defined inside the infrastructure/ingress-values.yaml file.

Cluster access

To access your Kubernetes cluster after everything is deployed, you can use kubectl port-forward command.

To do that, you first have to find out your ingress controller pod name. You can do that by running the following command:

kubectl -n ingress-nginx get pods

The response should look something like this

Now that you have the ingress controller name, you can use the port-forward command to expose the cluster to port 3000 using the following command

kubectl -n ingress-nginx port-forward <controller pod name> 3000:80

Last updated