Documentation
¶
Index ¶
- Variables
- func Execute(version string)
- func JsonnetVM(vmconfig VMConfig) (*jsonnet.VM, error)
- func Pretty(input string, colorOutput bool) string
- func RegisterNativeFuncs(vm *jsonnet.VM)
- type Cluster
- type ClusterComponent
- type ClusterJsonnet
- type ClusterSpec
- type Clusters
- type CmdGetOptions
- type CmdJsonnetOptions
- type ComponentJsonnet
- type ComponentSpec
- type ExtFileVar
- type IncludeFileEntryStruct
- type IncludeFileSpec
- type PathFilterOptions
- type VMConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{
Use: "kr8",
Short: "Kubernetes config parameter framework",
Long: `A tool to generate Kubernetes configuration from a hierarchy
of jsonnet files`,
}
RootCmd represents the base command when called without any subcommands
View Source
var Version string
exported Version variable
Functions ¶
func Execute ¶
func Execute(version string)
Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func RegisterNativeFuncs ¶
Types ¶
type ClusterComponent ¶
type ClusterComponent struct {
// The path to a component folder that contains a params.jsonnet file
Path string `json:"path"`
}
type ClusterJsonnet ¶
type ClusterJsonnet struct {
// kr8 configuration for how to process the cluster
ClusterSpec ClusterSpec `json:"_kr8_spec"`
// Cluster Level configuration that components can reference
Cluster Cluster `json:"_cluster"`
// Distictly named components.
Components map[string]ClusterComponent `json:"_components"`
}
type ClusterSpec ¶
type ClusterSpec struct {
// A jsonnet function that each output entry is processed through. Default `function(input) input`
PostProcessor string `json:"postprocessor"`
// The name of the root generate directory. Default `generated`
GenerateDir string `json:"generate_dir"`
// if this is true, we don't use the full file path to generate output file names
GenerateShortNames bool `json:"generate_short_names"`
// if this is true, we prune component parameters
PruneParams bool `json:"prune_params"`
// The root directory for the cluster. Default `clusters`
ClusterDir string `json:"-"`
// The name of the current cluster
Name string `json:"-"`
}
func CreateClusterSpec ¶
type CmdGetOptions ¶
type CmdJsonnetOptions ¶
type ComponentJsonnet ¶
type ComponentJsonnet struct {
// The default namespace to deploy the component to (optional)
Namespace string `json:"namespace"`
// A unique name for the component (optional)
ReleaseName string `json:"release_name"`
// Component version number (optional)
Version string `json:"version"`
// Component-specific configuration for kr8 (required)
Kr8Spec ComponentSpec `json:"kr8_spec"`
}
type ComponentSpec ¶
type ComponentSpec struct {
// If true, includes the parameters of the current cluster when generating this component
Kr8_allparams bool `json:"enable_kr8_allparams"`
// If true, includes the parameters of all other clusters when generating this component
Kr8_allclusters bool `json:"enable_kr8_allclusters"`
// If false, all non-generated files present in the output directory will be removed
DisableOutputDirClean bool `json:"disable_output_clean"`
// A list of filenames to include as jsonnet vm external vars
ExtFiles ExtFileVar `json:"extfiles"`
// Additional jsonnet libs to the jsonnet vm, path component scoped
JPaths []string `json:"jpaths"`
// A list of filenames to include and output as files
Includes []interface{} `json:"includes"`
}
kr8_spec object in cluster config
func CreateComponentSpec ¶
func CreateComponentSpec(spec gjson.Result) (ComponentSpec, error)
type ExtFileVar ¶
file to load as a string into the jsonnet vm name to reference the variable in jsonnet code through std.extvar() value of the variable, loaded from a file or provided directly
type IncludeFileEntryStruct ¶
type IncludeFileEntryStruct struct {
// an input file to process
// accepted filetypes: .jsonnet .yml .yaml .tmpl .tpl
File string `json:"file"`
// handle alternate output directory for file
DestDir string `json:"dest_dir,omitempty"`
// override destination file name
DestName string `json:"dest_name,omitempty"`
// override destination file extension
DestExt string `json:"dest_ext,omitempty"`
}
type IncludeFileSpec ¶
type IncludeFileSpec interface {
string
IncludeFileEntryStruct
}
A struct describing an included file
type PathFilterOptions ¶
Click to show internal directories.
Click to hide internal directories.