score-k8s CLI reference
3 minute read
The score-k8s CLI provides a set of commands and flags to enable the generation of Kubernetes manifests from Score specifications.
Global flags
--help | -h
Displays help information, including available commands and flags.
score-k8s --help
--quiet
Mutes any logging output.
score-k8s --quiet
--verbose count | -v
Increases log verbosity and detail by specifying this flag one or more times.
score-k8s --verbose count
--version
Displays the version of score-k8s.
score-k8s --version
Commands
init
The init command will prepare the current directory for working with score-k8s and write the initial empty state and default provisioners file into the '.score-k8s' subdirectory. The '.score-k8s' directory contains state that will be used to generate any Kubernetes resource manifests including potentially sensitive data and raw secrets, so this should not be checked into generic source control.
score-k8s init [flags]
Flags
The init command can be combined with the following flags:
--file | -f
Specifies a Score file to initialize. By default this is ./score.yaml.
score-k8s init --file custom_file_name.yaml
--no-default-provisioners
Skips default provisoners file creation
score-k8s init --provisioners https://raw.githubusercontent.com/user/repo/main/example.yaml --no-default-provisioners
--no-sample
Disables the generation of the sample Score file if you already have a Score file in place.
score-k8s init --no-sample
--patch-templates
Loads patch templates files. May be specified multiple times. Supports the following formats:
-(read from standard input)./local/path/file-or-folderhttp://host/filehttps://host/filegit-ssh://git@host/repo.git/filegit-https://host/repo.git/fileoci://[registry/][namespace/]repository[:tag|@digest][#file]
score-k8s init --patch-templates https://raw.githubusercontent.com/user/repo/main/example.yaml
Learn more about this --patch-templates feature here.
--provisioners
Loads provisioners files. May be specified multiple times. Supports the following formats:
-(read from standard input)./local/path/file-or-folderhttp://host/filehttps://host/filegit-ssh://git@host/repo.git/filegit-https://host/repo.git/fileoci://[registry/][namespace/]repository[:tag|@digest][#file]
score-k8s init --provisioners https://raw.githubusercontent.com/user/repo/main/example.yaml
Learn more about this --provisioners feature here.
generate
The generate command will convert Score files in the current Score state into a combined set of Kubernetes manifests. All resources and links between Workloads will be resolved and provisioned as required. score-k8s init must be run first. An error will be thrown if the project directory is not present.
score-k8s generate [flags]
Flags
The generate command can be combined with the following flags:
--generate-namespace
Specifies optionally if a Namespace resource should be generated in the manifests. Requires --namespace to be set.
score-k8s generate --namespace test-ns --generate-namespace
--image | -i
Specifies an optional container image to use for any container with image == '.'.
score-k8s generate --image your_container_image
--namespace | -n
Specifies an optional Namespace to set on the resources in the manifests.
score-k8s generate --namespace test-ns
--output | -o
Specifies the output file to write the manifests to. By default, the output file is named manifests.yaml.
score-k8s generate --output your_output_file.yaml
--override-property
Specifies an optional set of path=key overrides to set or remove.
score-k8s generate --override-property path1=value1
--overrides-file
Specifies an optional file of Score overrides to merge in.
score-k8s generate score.yaml --overrides-file=./overrides.score.yaml
provisioners
The provisioners command provides subcommand related to provisioners in score-k8s
score-k8s provisioners [command]
list
List available provisioners
score-k8s provisioners list [flags]
resources
The resources command provides subcommands related to provisioned resources in score-k8s.
score-k8s resources [command]
get-outputs
Returns the outputs of provisioned resources. This command retrieves values that can be used by workloads or other processes.
score-k8s resources get-outputs
list
Lists the unique identifiers (UIDs) of all provisioned resources.
score-k8s resources list
version
Show the version for score-k8s and new version to update if available.
score-k8s version
Flags
--no-logo
Do not show the Score logo.
score-k8s version --no-logo
--no-updates-check
Do not check for a new version.
score-k8s version --no-updates-check
check-version
Assert that the version of score-k8s matches the required constraint.
score-k8s check-version