Quickstart
You will learn how to build configuration with Microconfig.
Setup
Get Example Config
Checkout with git
git clone https://github.com/microconfig/microconfig-quickstart.git
cd microconfig-quickstart
Or just download and unzip it directly.
Get Microconfig
Download the latest binary for your OS.
Config Structure
Our configuration example has 2 services:
payments-backend
payments-frontend
Services are combined into payments
group.
We have environment specific values for 2 environments:
dev
prod
Each service expects 3 files:
application.yaml
- application configdeploy.yaml
- deployment configlogback.xml
- logging configuration
Build
Examples assume that you run your build in quickstart repository dir.
Generate configuration for a service in a specific environment
Let's generate configuration for payments-backend
service in dev
environment.
microconfig -r . -e dev -s payment-backend
Filtered 1 component(s) in [dev] env.
Copied 'payment-backend' template ../log/logback.xml -> logback.xml
Generated payment-backend/application.yaml
Generated payment-backend/deploy.yaml
Generated [dev] configs in 265ms
Parameters:
-r .
specify root dir (optional)-e dev
generate fordev
environment-s payments-backend
generate forpayments-backend
service
As a result Microconfig created build
folder with dev
configs for
payments-backend
.
build
└── payment-backend
├── application.yaml
├── deploy.yaml
└── logback.xml
Generate configuration for a group in a specific environment
Let's generate configuration for payments
group in prod
environment.
microconfig -e prod -g payments
Filtered 2 component(s) in [prod] env.
Copied 'payment-backend' template ../log/logback.xml -> logback.xml
Copied 'payment-frontend' template ../log/logback.xml -> logback.xml
Generated payment-backend/application.yaml
Generated payment-backend/deploy.yaml
Generated payment-frontend/application.yaml
Generated payment-frontend/deploy.yaml
Generated [prod] configs in 325ms
Parameters:
-e prod
generate forprod
environment-g payments
generate forpayments
group
As a result Microconfig created build
folder with prod
configs for
payments
group.
build
├── payment-backend
│ ├── application.yaml
│ ├── deploy.yaml
│ └── logback.xml
└── payment-frontend
├── application.yaml
├── deploy.yaml
└── logback.xml
Generate configuration for all services in a specific environment
Let's generate configuration for all services in dev
environment.
microconfig -e dev
Filtered 2 component(s) in [dev] env.
Copied 'payment-frontend' template ../log/logback.xml -> logback.xml
Copied 'payment-backend' template ../log/logback.xml -> logback.xml
Generated payment-backend/application.yaml
Generated payment-backend/deploy.yaml
Generated payment-frontend/application.yaml
Generated payment-frontend/deploy.yaml
Generated [dev] configs in 326ms
Parameters:
-e dev
generate fordev
environment
As a result Microconfig created build
folder with configs for all services defined in
dev
environment.
build
├── payment-backend
│ ├── application.yaml
│ ├── deploy.yaml
│ └── logback.xml
└── payment-frontend
├── application.yaml
├── deploy.yaml
└── logback.xml
Conclusion
We hope you agree that microconfig is easy to use. Now you can explore current example to see
Microconfig
syntax,
try out IDE plugin or deep dive into
Docs.