Microconfig Server Beta

MicroConfig Server was built to simplify configuration delivery to microservices. It provides a REST API (MicroConfig Server) and binary CLI (microctl) to fetch different configuration types for your services.

MicroConfig Server handles all configuration repo GIT operations and templating, so you don't have to. Also it allows for 3rd party integrations like HashiCorp Vault Coming Soon and Spring Boot Coming Soon

You can see a schema below for a deployment of orders-service pod using MicroConfig Server. Your deploy task fetches Helm values.yaml and uses them to deploy application pod. At startup orders-service pod fetches it's own application.yaml.

Microconfig Server

Server Setup

MicroConfig Server was designed to be Cloud Native from the start, so all you need is Docker

This will start your server on port 8080 with microconfig-quickstart as it's configuration repo.

                docker run -p 8080:80 microconfig/server:latest
                16-03-2021 18:45:37.909 [INFO] o.s.b.StartupInfoLogger - Started MicroconfigServerKt in 13.973 seconds (JVM running for 16.68)

Available Environment Variables:

Variable Description Default
REMOTE_URL your configuration repo git url microconfig-quickstart repo
USERNAME git repo username open
PASSWORD git repo password source
CONFIG_BRANCH main git branch master

Cli Setup

Microctl is a cli binary to fetch your configs from server. You can get it from GitHub releases

You can also use HomeBrew

                brew tap microconfig/microctl
                brew install microctl

Cli Usage

After you installed microctl and started your server you can fetch configuration.

All examples assume that you have your server running on http://localhost:8080 with microconfig-quickstart repo.

To use your own server url you can either use MC_ADDRESS environment variable or specify it with --server flag. If you don't specify anything http://localhost:8080 is used.

Almost all flags are doubled with environment variables

microctl help

Use this command to show available commands and common flags

                    $ microctl help

                    Usage: microctl [command] [service] [flags]
                      show:     fetch config and show it in console (MC_CMD=show)
                      save:     fetch config and save it to disk (MC_CMD=save)
                      version:  show cli version
                      help:     show this message
                      Generate configs for this service name (MC_SERVICE)
                    Common Flags:
                      --ref [master]: git branch or tag to use, by default master (MC_REF)
                      --timeout [10]: server calls timeout in seconds, by default 10 (MC_TIMEOUT)
                      --server [url]:  server url, by default [http://localhost:8080] (MC_ADDRESS)
                      --skip-tls: skip server tls certificate verification (MC_SKIP_TLS=true)
                      --tls-root-ca [path]: expected Root CA certificate (MC_ROOT_CA)

Notice --skip-tls and --tls-root-ca flags. They allow to work with self-signed certificates or private Certificate Authority.

microctl show

Use this command to fetch service config and show it in console

                    $ microctl show

                    Usage microctl show [service] [flags]
                    Generates configuration of specified type for service and outputs it to console
                      -e, --env  [name]: config environment (MC_ENV)
                      -t, --type [name]: config type, 'app' by default (MC_TYPE)
                      -s, --set  [foo=bar]: override values for placeholders and vars

                    $ microctl show payment-backend -t deploy -e dev

                    image: "payment-backend:latest"

                    replicas: 1

                      host: http://payment-backend.local

                      health: /monitoring/health
                      ready: /monitoring/ready

microctl save

Use this command to fetch service config and save it to disk

                    $ microctl save

                    Usage microctl save [service] [flags]
                    Generates configuration for service and saves it to disk
                      -e, --env  [name]: config environment (MC_ENV)
                      -t, --type [name]: config type, all types by default (MC_TYPE)
                      -d, --dir  [path]: output directory, current dir by default (MC_DIR)
                      -s, --set  [foo=bar]: override values for placeholders and vars

                    $ microctl save payment-backend -t app -e dev -d config

                    $ ls config
                    327 application.yaml
                    264 logback.xml

microctl version

Display microctl version

                    $ microctl version

                    Version 0.5.0

Kubernetes Usage

You can use microctl in your init container to fetch configuration at pod's startup.

Example Deployment of payment-backend pod

                    apiVersion: apps/v1
                    kind: Deployment
                      name: payment-backend
                      namespace: default
                      replicas: 1
                          app: payment-backend
                            app: payment-backend
                            - name: config
                              emptyDir: { }
                            - name: microconfig
                              image: "microconfig/server-cli:latest"
                              imagePullPolicy: Always
                                - name: MC_ADDRESS
                                  value: http://microconfig-server.default.svc.cluster.local
                                - name: MC_CMD
                                  value: save
                                - name: MC_SERVICE
                                  value: payment-backend
                                - name: MC_ENV
                                  value: dev
                                - name: MC_DIR
                                  value: "/config"
                                - name: config
                                  mountPath: "/config"
                            - name: payment-backend
                              image: "alpine:latest"
                              imagePullPolicy: Always
                              command: [ "sleep", "infinity" ]
                                - name: config
                                  mountPath: "/config"


Microconfig Server is in active development and currently in Beta. If you have any issues or suggestions you can contact us on Github or Join our Slack!