Skip to content
On this page

Config

yaml
log_level: info # application log, default is info

print: "text to print after the load complate: {{ .APP_NAME }}"

loads: [] # check loads section
preprocess: [] # check preprocess section
server: {} # check server section
services: [] # check services section

Turna now has 4 main sections, loads, preprocess, server and services. Check their sections for more information.

Inside of the main parameters, there is --config-consul, --config-vault additional parameters to get configuration from consul and vault (consul first).
Also this can editable with environment variables.

sh
APP_NAME=test # default is turna
PREFIX_VAULT=finops # default is empty
PREFIX_CONSUL=finops # default is empty

# First initialize configuration, these variables are default
CONFIG_SET_CONSUL=false
CONFIG_SET_VAULT=false
CONFIG_SET_FILE=true

To set Consul's and Vault's configuration use their environment variables.

For basic configuration:

sh
# CONSUL
CONSUL_HTTP_ADDR="localhost:8500"

# VAULT
VAULT_ADDR="http://localhost:8200"
VAULT_ROLE_ID="${ROLE_ID}"
# VAULT_CONSUL_ADDR_DISABLE=false

Environment variables

Consul

Using github.com/hashicorp/consul/api

Environment variableDescription
CONSUL_HTTP_ADDRConsul address
CONSUL_HTTP_TOKEN_FILEConsul token file
CONSUL_HTTP_TOKENConsul token
CONSUL_HTTP_AUTHConsul auth
CONSUL_HTTP_SSLConsul ssl
CONSUL_TLS_SERVER_NAMEConsul tls server name
CONSUL_CACERTConsul cacert
CONSUL_CAPATHConsul capath
CONSUL_CLIENT_CERTConsul client cert
CONSUL_CLIENT_KEYConsul client key
CONSUL_HTTP_SSL_VERIFYConsul ssl verify
CONSUL_NAMESPACEConsul namespace
CONSUL_PARTITIONConsul partition

Vault

Using github.com/hashicorp/vault/api

Environment variableDescription
VAULT_ROLE_IDRole ID
VAULT_ROLE_SECRETRole secret
VAULT_ADDRVault address
VAULT_TOKENVault token
VAULT_AGENT_ADDRVault agent address
VAULT_MAX_RETRIESMax retries
VAULT_CACERTCA certificate
VAULT_CACERT_BYTESCA certificate bytes
VAULT_CAPATHCA path
VAULT_CLIENT_CERTClient certificate
VAULT_CLIENT_KEYClient key
VAULT_RATE_LIMITRate limit
VAULT_CLIENT_TIMEOUTClient timeout
VAULT_SKIP_VERIFYSkip verify
VAULT_SRV_LOOKUPSRV lookup
VAULT_TLS_SERVER_NAMETLS server name
VAULT_HTTP_PROXYHTTP proxy
VAULT_PROXY_ADDRProxy address
VAULT_DISABLE_REDIRECTSDisable redirects
VAULT_APPROLE_BASE_PATH/auth/approle/login/

File

Giving a file configuration, config file can be [toml, yaml, yml, json] in the same directory with binary.
CONFIG_FILE environment variable also can be used to set config file name. Codec understand the file type from the extension.