kr8_init

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateClusterJsonnet

func GenerateClusterJsonnet(cSpec types.Kr8ClusterSpec, dstDir string) error

Generate a cluster.jsonnet file based on the provided Kr8ClusterSpec and store it in the specified directory.

func GenerateComponentJsonnet

func GenerateComponentJsonnet(componentOptions Kr8InitOptions, dstDir string) error

Generate default component kr8_spec values and store in params.jsonnet. Based on the type:

jsonnet: create a component.jsonnet file and reference it from the params.jsonnet file

yml: leave a note in the params.jsonnet file about where and how the yml files can be referenced

chart: generate a simple taskfile that handles vendoring the chart data

func GenerateLib

func GenerateLib(fetch bool, dstDir string) error

Downloads a starter kr8 jsonnet lib from github. If fetch is true, downloads the repo in the /lib directory. If false, prints the git commands to run. Repo: https://github.com/ice-bergtech/kr8-libsonnet . return util.FetchRepoUrl("https://github.com/ice-bergtech/kr8-libsonnet", dstDir+"/kr8-lib", !fetch).

func GenerateReadme

func GenerateReadme(dstDir string, cmdOptions Kr8InitOptions, clusterSpec types.Kr8ClusterSpec) error

Generates a starter readme for the repo, and writes it to the destination directory.

Types

type Kr8InitOptions

type Kr8InitOptions struct {
	// URL to fetch the skeleton directory from
	InitUrl string
	// Name of the cluster to initialize
	ClusterName string
	// Name of the component to initialize
	ComponentName string
	// Type of component to initialize (e.g. jsonnet, yml, chart, compose)
	ComponentType string
	// Whether to run in interactive mode or not
	Interactive bool
	// Whether to fetch remote resources or not
	Fetch bool
}

Kr8InitOptions defines the options used by the init subcommands.

Jump to

Keyboard shortcuts

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