⚡️ A dev tool for microservice developers to run local applications and/or forward others from/to Kubernetes SSH or TCP
⚡️ A dev tool for microservice developers to run local applications and/or forward others from/to Kubernetes SSH or TCP
/badge.svg) Your new microservice development environment friend. This CLI tool allows you to define a configuration to work with both local applications (Go, NodeJS, Rust or others) and forward some other applications over Kubernetes in case you don't want to run them locally.
✅ Define a unified way to setup applications for all your developers
✅ Run your local applications
✅ Hot reload your applications automatically when a change is made locally
✅ Port-forward an application locally using a remote one on Kubernetes (targeting a pod via label) or over SSH
✅ Forward traffic of a remote application over Kubernetes, SSH or TCP locally (see example forward types)
✅ Auto reconnect when a port-forward connection is lost
✅ Forward multiple times the same port locally, using an hostname
✅ Monitor your local and/or forwarded applications
$ brew install eko/homebrew-tap/mondayThis will install the latest available release
You can download the latest version of the binary built for your architecture here:
Optionally, you can download and build it from the sources. You have to retrieve the project sources by using one of the following way:
$ go get -u github.com/eko/monday
# or
$ git clone https://github.com/eko/monday.gitThen, build the binary using the available target in Makefile:
$ make buildConfiguration of Monday lives in one or multiple YAML files, depending on how you want to organize your files.
By default, monday init will initiates a ~/monday.yaml file. You can customize the configuration directory by setting the MONDAY_CONFIG_PATH environment variable.
Please note that you can also split this configuration in multiple files by respecting the following pattern: ~/monday.<something>.yaml, for instance:
~/monday.localapps.yaml~/monday.forwards.yaml~/monday.projects.yamlThis will help you navigate more easily in your configuration files. These files are merged in memory when Monday starts (YAML anchors can be shared between them), nothing is written back to your configuration directory.
Monday checks your configuration when it starts: an unknown field (a typo, for instance) is reported with its file and line instead of being silently ignored. You can also check your files at any time with:
$ monday validateHere is an example of a local application:
…Then, imagine this GraphQL instance needs to call a user-api but we want to forward it from a Kubernetes environment, we will define it as follows.
<: &user-api-forward
name: user-api
type: kubernetes
values:
context: staging # This is your kubernetes cluster (kubectl config context name)
namespace: backend
labels:
app: user-api
hostname: user-api.svc.local # API will be available under this hostname
ports:
- 8080:8080Well, you have defined both a local app and an application that needs to be forwarded, now just create the project!
- name: graphql
local:
- *graphql-local
forward:
- *user-api-forwardYour project configuration is ready, you can now work easily with your microservices.
For an overview of what's possible to do with configuration file, please look at the configuration example directory here.
To learn more about the configuration, please take a look at the Configuration Wiki page.
First, you have to initialize monday and edit your configuration file (you have a configuration example directory here).
Run the following command and edit the ~/monday.yaml configuration file just created for you:
⚠️ Important note: Because Monday tries to be your best dev tool and manage things for you, you have to give it some chances to help you in editing host file and manipulating network interface for IP/port mapping.
That's why I suggest to run Monday using the following alias:
alias monday='sudo -E monday'$ monday initOnce your configuration file is ready, you can simply run Monday:
$ monday [--no-ui]The terminal UI is enabled by default when running in an interactive terminal: it displays the live state of each forwarded application, scrollable logs with filtering, and per-application colors. Use the --no-ui option (or define a MONDAY_NO_UI environment variable) to get plain text output instead — this is also done automatically when the output is piped or when running in CI.
Or, you can run a specific project directly by running:
$ monday run [--no-ui] <project name>When you want to edit your configuration again, simply run this command to open it in your favorite editor:
$ monday editMonday cleans up the hosts file entries and the loopback IP aliases it created when it stops. If a crash or a forced kill left some behind, remove them with (add --dry-run to only list them):
$ monday cleanTo upgrade Monday to the latest release (the checksum of the downloaded binary is verified), run:
$ monday upgradeThe following environment variables can be used to tweak your Monday configuration:
| Environment variable | Description |
|---|---|
| MONDAY_CONFIG_PATH | Specify the configuration path where your YAML files can be found |
| MONDAY_EDITOR | Specify which editor you want to use in order to edit configuration files |
| MONDAY_EDITOR_ARGS | Specify the editor arguments you want to pass (separated by coma), example: -t,--wite |
| MONDAY_ENABLE_UI | Specify that you want to use the terminal UI instead of simply logging to stdout |
| MONDAY_KUBE_CONFIG | Force a specific Kubernetes config file. By default, the standard KUBECONFIG variable is honored, then ~/.kube/config |
You can join the community Slack space to discuss about your issues, new features or anything else regarding Monday.
Test suite can be run with:
$ go test -v ./...No open issues yet, or sync has not completed.