19

Monday: Manage your development environment when working with microservices

 4 years ago
source link: https://www.tuicool.com/articles/qEfMbyI
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

qq2Mja6.jpg!web

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.

yuIVnaF.jpg!web

What Monday can do for you?

:white_check_mark: Run your local applications

:white_check_mark: Hot reload your applications automatically when a change is made locally

:white_check_mark: Port-forward an application locally using a remote one on Kubernetes (targeting a pod via label) or over SSH

:white_check_mark: Forward traffic of a remote application over Kubernetes or SSH locally (see forward types ssh-remote & kubernetes-remote)

:white_check_mark: Auto reconnect when a port-forward connection is lost

:white_check_mark: Forward multiple times the same port locally, using an hostname

Installation

One-liner

You can download and setup Monday binary by running the following command on your terminal:

$ curl http://composieux.fr/getmonday.sh | sh

Download binary

You can download the latest version of the binary built for your architecture here:

From sources

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.git

Install the needed vendors:

$ GO111MODULE=on go mod vendor

Then, build the binary (here, an example to run on Raspberry PI ARM architecture):

$ go build -o monday .

Usage

First, you have to initialize monday and edit your configuration file (you have a configuration example file here ). Run the following command and edit the ~/monday.yaml configuration file just created for you:

:warning: 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 add your current user to the /etc/hosts file access list and run Monday using the following alias:

sudo chmod +a "$USER allow read,write" /etc/hosts
alias monday='sudo -E monday'
$ monday init

Once your configuration file is ready, you can simply run Monday:

$ monday

When you want to edit your configuration again, simply run this command to open it in your favorite editor:

$ monday edit

Configuration

Configuration 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.

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.yaml

This will help you in having smaller and more readable configuration files.

For an overview of what's possible with configuration file, please look at the configuration example file here .

Run tests

Test suite can be run with:

$ go test -v ./...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK