Configuration
The kubetail CLI tool can be configured using a local config file. If a config file is not found, Kubetail will use the defaults shown below. The file supports YAML, JSON, and TOML formats and values can reference environment variables using ${VARIABLE_NAME} syntax.
Initialization
Section titled “Initialization”The default config file path is ~/.kubetail/config.yaml. You can initialize the config by placing a file in the default location or by using the CLI config init command to do it for you:
kubetail config initEverytime you run a kubetail command, it will automatically look for a config file in the default location. You can specify a different path with the global --config flag:
kubetail serve --config /path/to/config.yamlDefaults
Section titled “Defaults”## Kubetail CLI Configuration File## This file defines the behavior for the kubetail CLI tool,# including logs command defaults and dashboard server settings.#
## version #### Schema version for the configuration file#version: 1
## general ###general:
## kubeconfig ## # # Path to the kubeconfig file to use for CLI requests. # If empty, the default path (~/.kube/config) or KUBECONFIG env var is used. # # Default value: "" # kubeconfig: ""
## commands ###commands:
## logs ## # # Settings specific to the 'logs' subcommand # logs:
## kube-context ## # # The specific Kubernetes context to use. # If empty, the current active context is used. # # Default value: "" # kube-context: ""
## head ## # # The number of lines to show from the beginning of the log buffer # # Default value: 10 # head: 10
## tail ## # # The number of lines to show from the end of the log buffer # # Default value: 10 # tail: 10
## columns ## # # Full set of output columns for 'logs' records. # Allowed values: timestamp,dot,node,region,zone,os,arch,namespace,pod,container # # Default value: ["timestamp", "dot"] # columns: - timestamp - dot
## serve ## # # Settings for the dashboard server # serve:
## host ## # # The network interface the server should bind to. # # Default value: localhost # host: localhost
## port ## # # The TCP port the server will listen on. # # Default value: 7500 # port: 7500
## skip-open ## # # If true, the CLI will not automatically open the browser # when the server starts. # # Default value: false # skip-open: false# Kubetail CLI Configuration File## Defines behavior for the kubetail CLI tool, including# logs command defaults and dashboard server settings.
# Schema version for the configuration fileversion = 1
[general]# Path to kubeconfig. If empty, uses ~/.kube/config or KUBECONFIG env var.kubeconfig = ""
[commands.logs]# Specific Kubernetes context to use. If empty, uses active context.kube-context = ""
# Number of lines to show from the beginning of the log bufferhead = 10
# Number of lines to show from the end of the log buffertail = 10
# Full set of output columns for 'logs' records.# Allowed values: timestamp,dot,node,region,zone,os,arch,namespace,pod,containercolumns = ["timestamp", "dot"]
[commands.serve]# Network interface the server binds tohost = "localhost"
# TCP port the server listens onport = 7500
# If true, don't automatically open browser when server startsskip-open = false{ "version": 1, "general": { "kubeconfig": "" }, "commands": { "logs": { "kube-context": "", "head": 10, "tail": 10, "columns": ["timestamp", "dot"] }, "serve": { "host": "localhost", "port": 7500, "skip-open": false } }}