konfigctl

command module
v0.160.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2025 License: MIT Imports: 2 Imported by: 0

README

CircleCI codecov Go Report Card Go Reference

Konfig Control

A tool to control the konfig daemon.

Background

Have a look at the konfig background.

Why a client?

We want to separate the daemon from the control. This is a similar design to other systems, such as kubernetes.

Client

The client contains multiple commands. They all share the way we connect to the service, this is configured as:

client:
  address: localhost:12000
  user_agent: "Konfig-client/1.0 gRPC/1.0"
  retry:
    attempts: 3
    backoff: 100ms
    timeout: 10s
  timeout: 5s
Config

The client can download a configuration.

❯ ./konfigctl config --help
Get Config.

Usage:
  konfigctl config [flags]

Flags:
  -h, --help            help for config
  -o, --output string   output config location (format kind:location) (default "env:KONFIG_APP_CONFIG_FILE")

Global Flags:
  -i, --input string   input config location (format kind:location) (default "env:KONFIG_CONFIG_FILE")

This can be configured as following:

client:
  config:
    application: test
    version: v1.11.0
    environment: staging
    continent: '*'
    country: '*'
    command: server
    kind: yaml
    mode: 0o600

The client writes the config to the location specified by the flag called --output. As per the following:

  • env:KONFIG_APP_CONFIG_FILE - Write to an env variable called KONFIG_APP_CONFIG_FILE. This is the default if nothing is passed.
  • file:path - Write to the path.
Secrets

The client can write secrets to a specified path.

❯ ./konfigctl config --help
Get Config.

Usage:
  konfigctl config [flags]

Flags:
  -h, --help            help for config
  -o, --output string   output config location (format kind:location) (default "env:KONFIG_APP_CONFIG_FILE")

Global Flags:
  -i, --input string   input config location (format kind:location) (default "env:KONFIG_CONFIG_FILE")

This can be configured as following:

client:
  secrets:
    files:
      vault.secret: vault:/secret/data/transport/http/user_agent
      ssm.secret: ssm:/secret/data/transport/http/user_agent
    path: reports
    mode: 0o600

Design

Please take a look at the template this is derived from.

Development

If you would like to contribute, here is how you can get started.

Structure

The project follows the structure in golang-standards/project-layout.

Dependencies

Please make sure that you have the following installed:

Style

This project favours the Uber Go Style Guide

Setup

Check out CI.

Changes

To see what has changed, please have a look at CHANGELOG.md

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL