diff --git a/content/en/docs/How to/environment-variables.md b/content/en/docs/How to/environment-variables.md index 57ed49b2..66d450ba 100644 --- a/content/en/docs/How to/environment-variables.md +++ b/content/en/docs/How to/environment-variables.md @@ -21,5 +21,4 @@ The Score Specification supports declaring environment variables in a configurat For more information, see -- [Environment variables in score-compose](https://github.com/score-spec/score-compose/tree/main/examples/02-environment) -- [Environment variables in score-helm](https://github.com/score-spec/score-helm/tree/main/examples/02-environment) +- [Environment variables in `score-compose`](https://github.com/score-spec/score-compose/tree/main/examples/02-environment) diff --git a/content/en/docs/score implementation/Other/_index.md b/content/en/docs/score implementation/Other/_index.md deleted file mode 100644 index 5901d1a0..00000000 --- a/content/en/docs/score implementation/Other/_index.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: "Available implementation CLIs" -linkTitle: "Other" -weight: 3 -description: "An overview of open-source Score implementation CLIs" ---- diff --git a/content/en/docs/score implementation/Other/included/_index.md b/content/en/docs/score implementation/Other/included/_index.md deleted file mode 100644 index 11a0fa86..00000000 --- a/content/en/docs/score implementation/Other/included/_index.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: "score-helm installation" -headless: true -toc_hide: true -hide_summary: true ---- diff --git a/content/en/docs/score implementation/Other/included/install-score-helm-bash.md b/content/en/docs/score implementation/Other/included/install-score-helm-bash.md deleted file mode 100644 index 4754fe97..00000000 --- a/content/en/docs/score implementation/Other/included/install-score-helm-bash.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: "score-helm install on macOS" -description: "Installation for score-helm on macOS." -headless: true -toc_hide: true ---- - -**1.** Download the latest compressed Tar file for your operating system from the [GitHub release page](https://github.com/score-spec/score-helm/releases). By default, the tarball will be saved to your `~/Downloads` directory. If you choose to use a different location, you'll need to change that in the following steps. - -```bash -score-helm.y.z_osx-amd64.tar.gz -``` - -**2.** Install into your `local` directory - -In your terminal, enter the following to create the `score-spec` directory. - -```bash -cd /usr/local/bin/ -# create the directory if needed -mkdir -pv score-spec -``` - -Extract the compressed Tar file (You may need to run the previous command with elevated permissions). - -```bash -tar -xvzf ~/Downloads/score-helm_darwin_arm64.tar.gz -C /usr/local/bin/ -``` - -You should see the following output: - -```bash -x LICENSE -x README.md -x score-helm -``` - -**3.** Export PATH - -Future terminal sessions may require you add this path to your `~/.zshrc` or `~/.bashrc` file, if it isn’t there already. - -```bash -export PATH=$PATH:/usr/local/bin/ -``` - -**4.** Verify installation - -```bash -score-helm --version -``` - -The command returns the following output: - -```bash -score-helm x.y.z -``` - -You’ve successfully installed the score-helm CLI! diff --git a/content/en/docs/score implementation/Other/included/install-score-helm-curl-mac.md b/content/en/docs/score implementation/Other/included/install-score-helm-curl-mac.md deleted file mode 100644 index 34f42f6b..00000000 --- a/content/en/docs/score implementation/Other/included/install-score-helm-curl-mac.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: "score-helm install on macOS" -description: "Installation for score-helm on macOS." -headless: true -toc_hide: true ---- - -**1.** Download the latest release from the [GitHub release page](https://github.com/score-spec/score-helm/releases): - -```bash -wget https://github.com/score-spec/score-helm/releases/download//score-helm_.tar.gz -``` - -**2.** Unpack the latest release - -```bash -tar xvzf score-helm.tgz -``` - -The following is the output of the previous command: - -```bash -x LICENSE -x README.md -x score-helm -``` - -**3.** Clean up the tar file - -```bash -rm score-helm.tgz README.md LICENSE -``` - -**4.** Move the binary to PATH - -```bash -sudo mv ./score-helm /usr/local/bin/score-helm -sudo chown root: /usr/local/bin/score-helm -``` - -You’ve successfully installed the score-helm CLI! diff --git a/content/en/docs/score implementation/Other/included/install-wget-helm.md b/content/en/docs/score implementation/Other/included/install-wget-helm.md deleted file mode 100644 index dd1c1aae..00000000 --- a/content/en/docs/score implementation/Other/included/install-wget-helm.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: "score-helm install with wget" -description: "Installation for score-helm with wget." -headless: true -toc_hide: true ---- - -**1.** Download the latest release from the [GitHub release page](https://github.com/score-spec/score-helm/releases): - -```bash -wget https://github.com/score-spec/score-helm/releases/download//score-helm_.tar.gz -``` - -You should see something similar to the following output: - -```bash -Saving to: score-helm_.tar.gz - -score-helm_ 100%[===================>] 2.85M 5.28MB/s in 0.5s -``` - -**2.** Install into your `local` directory - -In your terminal, enter the following to create the `score-spec` directory. - -```bash -cd /usr/local/bin/ -# create the directory if needed -mkdir -pv score-spec -``` - -Extract the compressed Tar file (You may need to run this command with elevated permissions): - -```bash -tar -xvzf ~//score-helm__.tar.gz -``` - -You should see the following output: - -```bash -x LICENSE -x README.md -x score-helm -``` - -**3:** Export PATH - -Future terminal sessions may require you add this path to your `~/.zshrc` or `~/.bashrc` file, if it isn’t there already. - -```bash -export PATH=$PATH:/usr/local/bin/ -``` - -**4:** Verify installation - -```bash -score-helm --version -``` - -The command returns the following output: - -```bash -score-helm -``` - -You've successfully installed the score-helm CLI! diff --git a/content/en/docs/score implementation/Other/included/install-windows.md b/content/en/docs/score implementation/Other/included/install-windows.md deleted file mode 100644 index 39785a13..00000000 --- a/content/en/docs/score implementation/Other/included/install-windows.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "score-helm install on Windows" -description: "Installation for score-helm on Windows." -headless: true -toc_hide: true ---- - -**1.** Download the latest release from the [GitHub release page](https://github.com/score-spec/score-helm/releases). - -**2.** Decompress the `zip` file, and move the binary to your `PATH`. - -You've successfully installed the score-helm CLI! diff --git a/content/en/docs/score implementation/Other/score-helm.md b/content/en/docs/score implementation/Other/score-helm.md deleted file mode 100644 index d68a3c88..00000000 --- a/content/en/docs/score implementation/Other/score-helm.md +++ /dev/null @@ -1,173 +0,0 @@ ---- -title: "score-helm" -linkTitle: "score-helm" -description: "Get started with the score-helm CLI" -weight: 4 -aliases: -- /docs/reference/score-cli/score-helm-run/ -- /docs/reference/score-cli/score-helm/ ---- - -{{< alert context="info" >}} Deprecation Notice: We have deprecated the score-helm CLI implementation. To get started with Score, we recommend using one of our reference implementations [score-compose]({{< relref "/docs/score implementation/score-compose" >}}) or [score-k8s]({{< relref "/docs/score implementation/score-k8s" >}}). If you're interested in developing a score-helm reference implementation, we'd love to support you! Please [reach out](https://github.com/score-spec/spec?tab=readme-ov-file#-get-in-touch) to us for assistance and collaboration. {{< /alert >}} - -# Overview - -The score-helm CLI allows developers to translate their Score specification into Helm values files. Below you'll find an overview of: - -- [Installation options](#installation) -- [CLI reference](#cli-reference) -- [Examples](#examples) - -For additional details and opportunities to contribute to the project, visit the [score-helm](https://github.com/score-spec/score-helm) GitHub repository. - -## Installation - -You can install the score-helm CLI in a variety of ways: - -- [Homebrew](#homebrew) -- [Go](#go) -- [Docker](#docker) -- [Manual download](#manual-download) - -### Homebrew - -Prerequisites: You must have [brew](https://brew.sh) installed. - -```bash -brew install score-spec/tap/score-helm -``` - -### Go - -Prerequisites: You must have [Go](https://go.dev/dl/) installed. - -```bash -go install -v github.com/score-spec/score-helm/cmd/score-helm@latest -``` - -### Docker - -Prerequisites: You must have [Docker](https://docs.docker.com/get-docker/) installed. - -1. Download the repository. - The following example uses the GitHub CLI to download the project. - -```bash -gh repo clone score-spec/score-helm -``` - -2. Change directories into `score-helm`. - -```bash -cd score-helm -``` - -3. Build the Docker image by running the following command in the same directory as the Dockerfile. - -```bash -docker build -t score-helm:latest . -``` - -4. Run the Docker image by using the `docker run` command. - -```bash -docker run -it score-helm:latest -``` - -If you want to run `score-helm` with the `--help` flag to view the available options, you would run the following command. - -```bash -docker run -it score-helm:latest --help -``` - -This will start a new container based on the image you built, run `score-helm` with the `--help` flag, and then stop the container. - -### Manual download - -The following methods download the score-helm CLI from its [GitHub release page](https://github.com/score-spec/score-helm/releases): - -{{< tabs name="Manual installation methods">}} -{{< tab name="curl on macOS" include="included/install-score-helm-curl-mac.md" />}} -{{< tab name="wget on macOS/Linux" include="included/install-wget-helm.md" />}} -{{< tab name="Github DLs on macOS/Linux" include="included/install-score-helm-bash.md" />}} -{{< tab name="Windows" include="included/install-windows.md" />}} -{{< /tabs >}} - -## CLI Reference - -The score-helm CLI provides a set of commands and flags to enable the generation of Helm values files from Score specifications. - -## Commands - -## `run` - -Translates the Score file into a Helm `values.yaml` file. - -```bash -score-helm run --file ./score.yaml \ - --output ./values.yaml -``` - -#### Flags - -The `run` command can be combined with the following flags: - -#### `--file` | `-f` - -Specifies a Score file to initialize. By default this is `./score.yaml.` - -```bash -score-helm run -f ./another-score.yaml -``` - -#### `--help` | `-h` - -Help for the `run` command. - -```bash -score-helm run -h -``` - -#### `--output` | `-o` - -The output location of the helm file. Uses the default value `./helm.yaml` if the flag isn't specified. - -```bash -score-helm run -f ./score.yaml -o ./another-helm.yaml -``` - -#### `--overrides` - -Specifies the path to the override file. Uses the default value `./overrides.score.yaml` if the flag isn't specified. - -```bash -score-helm run -f ./score.yaml \ - -o ./values.yaml \ - --overrides ./overrides.score.yaml -``` - -#### `--property` - -Overrides selected property value. - -#### `--values` - -Specifies the path that declares reference dependencies, or resource property, values that are environment-specific. - -```bash -score-helm run -f ./score.yaml --values ./env.yaml -o ./values.yaml -``` - -#### `--verbose` - -Enables a stream to which error messages are sent. - -```bash -score-helm run -f ./score.yaml -o ./values.yaml --verbose -``` - -## Examples - -Explore examples for score-helm in the [examples library](https://github.com/score-spec/score-helm/tree/main/examples) on GitHub. - -If you encounter any issues or have questions, feel free to reach out to us in the [Score](https://cloud-native.slack.com/archives/C07DN0D1UCW) channel on the CNCF Slack (). diff --git a/content/en/docs/score implementation/Other/score-humanitec.md b/content/en/docs/score implementation/Other/score-humanitec.md deleted file mode 100644 index c664fc6b..00000000 --- a/content/en/docs/score implementation/Other/score-humanitec.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "score-humanitec" -linkTitle: "score-humanitec" -description: "Get started with Score and the Humanitec Platform Orchestrator" -weight: 4 -aliases: -- /docs/environment-variables/environment-variables-humanitec/ -- /docs/reference/humanitec-extension/ -- /docs/reference/score-cli/score-humanitec-run/ -- /docs/reference/score-cli/score-humanitec-delta/ -- /docs/reference/score-cli/score-humanitec/ ---- - -The Humanitec Platform Orchestrator offers native support for Score, enabling the translation of Score files into a Humanitec Deployment Set for deployment to a remote environment. - -For detailed instructions on usage and configuration, please refer to the [Humanitec developer documentation](https://developer.humanitec.com/score/overview/#how-do-score-and-the-platform-orchestrator-work-together). - -If you have any questions or concerns regarding this implementation, feel free to [reach out to the Humanitec team directly](https://developer.humanitec.com/support/contact). diff --git a/content/en/docs/score implementation/included/install-score-compose-bash.md b/content/en/docs/score implementation/included/install-score-compose-bash.md index 54f6cacf..665c449b 100644 --- a/content/en/docs/score implementation/included/install-score-compose-bash.md +++ b/content/en/docs/score implementation/included/install-score-compose-bash.md @@ -55,4 +55,4 @@ The command returns the following output: score-compose x.y.z ``` -You’ve successfully installed the score-compose CLI! +You’ve successfully installed the `score-compose` CLI! diff --git a/content/en/docs/score implementation/included/install-score-compose-curl-mac.md b/content/en/docs/score implementation/included/install-score-compose-curl-mac.md index c16b4998..8fd327e2 100644 --- a/content/en/docs/score implementation/included/install-score-compose-curl-mac.md +++ b/content/en/docs/score implementation/included/install-score-compose-curl-mac.md @@ -38,4 +38,4 @@ sudo mv ./score-compose /usr/local/bin/score-compose sudo chown root: /usr/local/bin/score-compose ``` -You’ve successfully installed the score-compose CLI! +You’ve successfully installed the `score-compose` CLI! diff --git a/content/en/docs/score implementation/included/install-score-k8s-bash.md b/content/en/docs/score implementation/included/install-score-k8s-bash.md index 4fa8c4f6..9175dda4 100644 --- a/content/en/docs/score implementation/included/install-score-k8s-bash.md +++ b/content/en/docs/score implementation/included/install-score-k8s-bash.md @@ -55,4 +55,4 @@ The command returns the following output: score-k8s x.y.z ``` -You’ve successfully installed the score-k8s CLI! +You’ve successfully installed the `score-k8s` CLI! diff --git a/content/en/docs/score implementation/included/install-score-k8s-curl-mac.md b/content/en/docs/score implementation/included/install-score-k8s-curl-mac.md index da730a1f..b8cf3e79 100644 --- a/content/en/docs/score implementation/included/install-score-k8s-curl-mac.md +++ b/content/en/docs/score implementation/included/install-score-k8s-curl-mac.md @@ -38,4 +38,4 @@ sudo mv ./score-k8s /usr/local/bin/score-k8s sudo chown root: /usr/local/bin/score-k8s ``` -You’ve successfully installed the score-k8s CLI! +You’ve successfully installed the `score-k8s` CLI! diff --git a/content/en/docs/score implementation/included/install-wget-compose.md b/content/en/docs/score implementation/included/install-wget-compose.md index 9907865e..8f24ab20 100644 --- a/content/en/docs/score implementation/included/install-wget-compose.md +++ b/content/en/docs/score implementation/included/install-wget-compose.md @@ -63,4 +63,4 @@ The command returns the following output: score-compose ``` -You've successfully installed the score-compose CLI! +You've successfully installed the `score-compose` CLI! diff --git a/content/en/docs/score implementation/included/install-wget-k8s.md b/content/en/docs/score implementation/included/install-wget-k8s.md index 92af0f75..a0c7fdf9 100644 --- a/content/en/docs/score implementation/included/install-wget-k8s.md +++ b/content/en/docs/score implementation/included/install-wget-k8s.md @@ -63,4 +63,4 @@ The command returns the following output: score-k8s ``` -You've successfully installed the score-k8s CLI! +You've successfully installed the `score-k8s` CLI! diff --git a/content/en/docs/score implementation/included/install-windows-compose.md b/content/en/docs/score implementation/included/install-windows-compose.md index 0a48e48c..2e81efe8 100644 --- a/content/en/docs/score implementation/included/install-windows-compose.md +++ b/content/en/docs/score implementation/included/install-windows-compose.md @@ -9,4 +9,4 @@ toc_hide: true **2.** Decompress the `zip` file, and move the binary to your `PATH`. -You've successfully installed the score-compose CLI! +You've successfully installed the `score-compose` CLI! diff --git a/content/en/docs/score implementation/included/install-windows-k8s.md b/content/en/docs/score implementation/included/install-windows-k8s.md index 3fd61789..16381c84 100644 --- a/content/en/docs/score implementation/included/install-windows-k8s.md +++ b/content/en/docs/score implementation/included/install-windows-k8s.md @@ -9,4 +9,4 @@ toc_hide: true **2.** Decompress the `zip` file, and move the binary to your `PATH`. -You've successfully installed the score-k8s CLI! +You've successfully installed the `score-k8s` CLI! diff --git a/content/en/docs/score implementation/score-compose/_index.md b/content/en/docs/score implementation/score-compose/_index.md new file mode 100644 index 00000000..f74b2915 --- /dev/null +++ b/content/en/docs/score implementation/score-compose/_index.md @@ -0,0 +1,15 @@ +--- +title: "score-compose" +linkTitle: "score-compose" +description: "Get started with the score-compose reference implementation" +weight: 1 +aliases: +- /docs/reference/score-cli/score-compose-run/ +- /docs/reference/score-cli/score-compose/ +--- + +# Overview + +The `score-compose` serves as a reference implementation for the Score specification, providing a standard for the creation of custom Score CLIs. `score-compose` can be utilized both as a reference point for implementation and for practical use in local development with Docker Compose. + +For additional details and opportunities to contribute to the project, visit the [`score-compose`](https://github.com/score-spec/score-compose) GitHub repository. \ No newline at end of file diff --git a/content/en/docs/score implementation/score-compose.md b/content/en/docs/score implementation/score-compose/cli.md similarity index 55% rename from content/en/docs/score implementation/score-compose.md rename to content/en/docs/score implementation/score-compose/cli.md index e21b6f4f..eed9ef0d 100644 --- a/content/en/docs/score implementation/score-compose.md +++ b/content/en/docs/score implementation/score-compose/cli.md @@ -1,98 +1,12 @@ --- -title: "score-compose" -linkTitle: "score-compose" -description: "Get started with the score-compose reference implementation" -weight: 1 +title: "score-compose CLI reference" +linkTitle: "CLI reference" +description: "CLI reference for score-compose" +weight: 2 aliases: -- /docs/reference/score-cli/score-compose-run/ -- /docs/reference/score-cli/score-compose/ +- /docs/reference/score-cli/score-compose/cli --- -# Overview - -The score-compose CLI serves as a reference implementation for the Score specification, providing a standard for the creation of custom Score CLIs. Score-compose can be utilized both as a reference point for implementation and for practical use in local development with Docker Compose. Below you'll find an overview of: - -- [Installation options](#installation) -- [CLI reference](#cli-reference) -- [Examples](#examples) - -For additional details and opportunities to contribute to the project, visit the [score-compose](https://github.com/score-spec/score-compose) GitHub repository. - -## Installation - -You can install the score-compose CLI in a variety of ways: - -- [Homebrew](#homebrew) -- [Go](#go) -- [Docker](#docker) -- [Manual download](#manual-download) - -### Homebrew - -Prerequisites: You must have [brew](https://brew.sh) installed. - -```bash -brew install score-spec/tap/score-compose -``` - -### Go - -Prerequisites: You must have [Go](https://go.dev/dl/) installed. - -```bash -go install -v github.com/score-spec/score-compose/cmd/score-compose@latest -``` - -### Docker - -Prerequisites: You must have [Docker](https://docs.docker.com/get-docker/) installed. - -1. Download the repository. - The following example uses the GitHub CLI to download the project. - -```bash -gh repo clone score-spec/score-compose -``` - -2. Change directories into `score-compose`. - -```bash -cd score-compose -``` - -3. Build the Docker image by running the following command in the same directory as the Dockerfile. - -```bash -docker build -t score-compose:latest . -``` - -4. Run the Docker image by using the `docker run` command. - -```bash -docker run -it score-compose:latest -``` - -If you want to run `score-compose` with the `--help` flag to view the available options, you would run the following command. - -```bash -docker run -it score-compose:latest --help -``` - -This will start a new container based on the image you built, run `score-compose` with the `--help` flag, and then stop the container. - -### Manual download - -The following methods download the score-compose CLI from its [GitHub release page](https://github.com/score-spec/score-compose/releases): - -{{< tabs name="Manual installation methods">}} -{{< tab name="curl on macOS" include="included/install-score-compose-curl-mac.md" />}} -{{< tab name="wget on macOS/Linux" include="included/install-wget-compose.md" />}} -{{< tab name="Github DLs on macOS/Linux" include="included/install-score-compose-bash.md" />}} -{{< tab name="Windows" include="included/install-windows-compose.md" />}} -{{< /tabs >}} - -## CLI Reference - The score-compose CLI provides a set of commands and flags to enable the generation of Docker Compose files from Score specifications. ## Commands @@ -130,7 +44,15 @@ score-compose init --no-sample Sets the name of the Docker Compose project. By default, the project name is the same as the current directory name. ```bash -score-compose init --project custom_project_name.yaml +score-compose init --project score-compose2 +``` + +#### `--provisioners` | `-p` + +Loads additional provisoners from a remote url. May be specified multiple times. Supports http://host/file, https://host/file, git-ssh://git@host/repo.git/file, and git-https://host/repo.git/file formats. + +```bash +score-compose init --provisioners https://raw.githubusercontent.com/user/repo/main/example.yaml ``` #### `--help` | `-h` @@ -143,7 +65,7 @@ score-compose init --help ## `generate` -The generate command converts the Score file(s) in the current Score Compose project into a combined Docker Compose manifest. All resources and links between Workloads will be resolved and provisioned as required. Please be aware that score-compose [init](#init) must be run first. An error will be thrown if the project directory is not present. +The `generate` command converts the Score file(s) in the current Score Compose project into a combined Docker Compose manifest. All resources and links between Workloads will be resolved and provisioned as required. Please be aware that [`score-compose init`](#init) must be run first. An error will be thrown if the project directory is not present. ```bash score-compose generate [flags] @@ -201,6 +123,14 @@ Specifies an optional file of Score overrides to merge in. score-compose generate score.yaml --overrides-file=./overrides.score.yaml ``` +#### `--publish` + +Specifies an optional set of HOST_PORT::CONTAINER_PORT to publish on the host system. could be either for the workload (example: 8080:my-workload:80) or for a resource (example: 5432:postgres#my-workload.db.host:5432). + +```bash +score-compose generate score.yaml --publish 8080:my-workload:80 +``` + #### `--help` | `-h` Displays help information for `generate`, providing a short description of the command along with examples and compatible flags. @@ -211,7 +141,7 @@ score-compose generate --help ## `completion` -The completion command generates an autocompletion script for score-compose in the specified shell. +The `completion` command generates an autocompletion script for `score-compose` in the specified shell. ```bash score-compose completion [command] @@ -238,7 +168,7 @@ score-compose completion [command] --help ## `run (deprecated)` -The run command translates the Score file into a Docker Compose file. Please note that this command is deprecated as it does not support resource provisioning out of the box. Please use the [generate](#generate) command instead. +The `run` command translates the Score file into a Docker Compose file. Please note that this command is deprecated as it does not support resource provisioning out of the box. Please use the [generate](#generate) command instead. ```bash score-compose run --file ./score.yaml \ @@ -334,10 +264,4 @@ Displays the version of score-compose. ```bash score-compose --version -``` - -## Examples - -Explore a variety of examples for score-compose, ranging from simple "hello world" setups to more complex configurations, including resource provisioning and multiple workloads. You can find these examples in our [examples library](https://github.com/score-spec/score-compose/tree/main/examples). - -If you encounter any issues or have questions, feel free to reach out to us in the the [Score](https://cloud-native.slack.com/archives/C07DN0D1UCW) channel on the CNCF Slack (). +``` \ No newline at end of file diff --git a/content/en/docs/score implementation/score-compose/examples.md b/content/en/docs/score implementation/score-compose/examples.md new file mode 100644 index 00000000..f5dd058e --- /dev/null +++ b/content/en/docs/score implementation/score-compose/examples.md @@ -0,0 +1,12 @@ +--- +title: "score-compose examples" +linkTitle: "Examples" +description: "Examples for score-compose" +weight: 4 +aliases: +- /docs/reference/score-cli/score-compose/examples +--- + +Explore a variety of examples for `score-compose`, ranging from simple "hello world" setups to more complex configurations, including resource provisioning and multiple workloads. You can find these examples in our [examples library](https://github.com/score-spec/score-compose/tree/main/examples). + +If you encounter any issues or have questions, feel free to reach out to us in the the [Score](https://cloud-native.slack.com/archives/C07DN0D1UCW) channel on the CNCF Slack (). \ No newline at end of file diff --git a/content/en/docs/score implementation/score-compose/installation.md b/content/en/docs/score implementation/score-compose/installation.md new file mode 100644 index 00000000..9340b8e0 --- /dev/null +++ b/content/en/docs/score implementation/score-compose/installation.md @@ -0,0 +1,79 @@ +--- +title: "score-compose installation" +linkTitle: "Installation" +description: "Installation of score-compose" +weight: 1 +aliases: +- /docs/reference/score-cli/score-compose/install +--- + +You can install the `score-compose` CLI in a variety of ways: + +- [Homebrew](#homebrew) +- [Go](#go) +- [Docker](#docker) +- [Manual download](#manual-download) + +## Homebrew + +Prerequisites: You must have [brew](https://brew.sh) installed. + +```bash +brew install score-spec/tap/score-compose +``` + +## Go + +Prerequisites: You must have [Go](https://go.dev/dl/) installed. + +```bash +go install -v github.com/score-spec/score-compose/cmd/score-compose@latest +``` + +## Docker + +Prerequisites: You must have [Docker](https://docs.docker.com/get-docker/) installed. + +1. Download the repository. + The following example uses the GitHub CLI to download the project. + +```bash +gh repo clone score-spec/score-compose +``` + +2. Change directories into `score-compose`. + +```bash +cd score-compose +``` + +3. Build the Docker image by running the following command in the same directory as the Dockerfile. + +```bash +docker build -t score-compose:latest . +``` + +4. Run the Docker image by using the `docker run` command. + +```bash +docker run -it score-compose:latest +``` + +If you want to run `score-compose` with the `--help` flag to view the available options, you would run the following command. + +```bash +docker run -it score-compose:latest --help +``` + +This will start a new container based on the image you built, run `score-compose` with the `--help` flag, and then stop the container. + +## Manual download + +The following methods download the `score-compose` CLI from its [GitHub release page](https://github.com/score-spec/score-compose/releases): + +{{< tabs name="Manual installation methods">}} +{{< tab name="curl on macOS" include="../included/install-score-compose-curl-mac.md" />}} +{{< tab name="wget on macOS/Linux" include="../included/install-wget-compose.md" />}} +{{< tab name="GitHub DLs on macOS/Linux" include="../included/install-score-compose-bash.md" />}} +{{< tab name="Windows" include="../included/install-windows-compose.md" />}} +{{< /tabs >}} \ No newline at end of file diff --git a/content/en/docs/score implementation/score-compose/resources-provisioners.md b/content/en/docs/score implementation/score-compose/resources-provisioners.md new file mode 100644 index 00000000..a931d9ce --- /dev/null +++ b/content/en/docs/score implementation/score-compose/resources-provisioners.md @@ -0,0 +1,32 @@ +--- +title: "score-compose resources provisioners" +linkTitle: "Resources provisioners" +description: "resources provisioners of score-compose" +weight: 3 +aliases: +- /docs/reference/score-cli/score-compose/provisioners +- /docs/reference/score-cli/score-compose/resources-provisioners +- /docs/reference/score-cli/score-compose/resources +--- + +`score-compose` comes with out-of-the-box support for: + +| Type | Class | Params | Output | +| --------------- | --------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amqp` | `default` | (none) | `host`, `port`, `vhost`, `username`, `password` | +| `dns` | `default` | (none) | `host` | +| `elasticsearch` | `default` | (none) | `host`, `port`, `username`, `password` | +| `environment` | `default` | (none) | `${KEY}` | +| `kafka-topic` | `default` | (none) | `host`, `port`, `name`, `num_partitions` | +| `mongodb` | `default` | (none) | `host`, `port`, `username`, `password`, `connection` | +| `mysql` | `default` | (none) | `host`, `port`, `name` (aka `database`), `username`, `password` | +| `postgres` | `default` | (none) | `host`, `port`, `name` (aka `database`), `username`, `password` | +| `redis` | `default` | (none) | `host`, `port`, `username`, `password` | +| `route` | `default` | `host`, `path`, `port` | | +| `service-port` | `default` | `workload`, `port` | `hostname`, `port` | +| `s3` | `default` | (none) | `endpoint`, `access_key_id`, `secret_key`, `bucket`, with `region=""`, `aws_access_key_id=`, and `aws_secret_key=` for compatibility | +| `volume` | `default` | (none) | `source` | + +These can be found in the default provisioners file. You are encouraged to write your own provisioners and add them to the `.score-compose` directory (with the `.provisioners.yaml` extension) or contribute them upstream to the [default.provisioners.yaml](https://github.com/score-spec/score-compose/blob/main/internal/command/default.provisioners.yaml) file. + +Users are encouraged to write their own custom provisioners to support new resource types or to modify the implementations above. See [example here](https://score.dev/blog/writing-a-custom-score-compose-provisioner-for-apache-kafka/). \ No newline at end of file diff --git a/content/en/docs/score implementation/score-k8s.md b/content/en/docs/score implementation/score-k8s.md deleted file mode 100644 index 60472fc4..00000000 --- a/content/en/docs/score implementation/score-k8s.md +++ /dev/null @@ -1,194 +0,0 @@ ---- -title: "score-k8s" -linkTitle: "score-k8s" -description: "Get started with the score-k8s reference implementation" -weight: 1 ---- - -# Overview - -The score-k8s CLI serves as a reference implementation for the Score specification, providing a standard for the creation of custom Score CLIs. Score-k8s can be utilized both as a reference point for implementation and for practical use in development with Kubernetes. Below you'll find an overview of: - -- [Installation options](#installation) -- [CLI reference](#cli-reference) - -For additional details and opportunities to contribute to the project, visit the [score-k8s](https://github.com/score-spec/score-k8s) GitHub repository. - -# Installation - -You can install the score-k8s CLI in a variety of ways: - -- [Homebrew](#homebrew) -- [Go](#go) -- [Manual download](#manual-download) - -### Homebrew - -Prerequisites: You must have [brew](https://brew.sh) installed. - -```bash -brew install score-spec/tap/score-k8s -``` - -### Go - -Prerequisites: You must have [Go](https://go.dev/dl/) installed. - -```bash -$ go install -v github.com/score-spec/score-k8s@latest -``` - -### Manual download - -The following methods download the score-k8s CLI from its [GitHub release page](https://github.com/score-spec/score-k8s/releases): - -{{< tabs name="Manual installation methods">}} -{{< tab name="curl on macOS" include="included/install-score-k8s-curl-mac.md" />}} -{{< tab name="wget on macOS/Linux" include="included/install-wget-k8s.md" />}} -{{< tab name="Github DLs on macOS/Linux" include="included/install-score-k8s-bash.md" />}} -{{< tab name="Windows" include="included/install-windows-k8s.md" />}} -{{< /tabs >}} - -## CLI Reference - -The score-k8s CLI provides a set of commands and flags to enable the generation of Kubernetes manifests from Score specifications. - -## 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. - -```bash -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`. - -```bash -score-k8s init --file custom_file_name.yaml -``` - -#### `--no-sample` - -Disables the generation of the sample Score file if you already have a Score file in place. - -```bash -score-k8s init --no-sample -``` - -#### `--help` | `-h` - -Displays help information for `init`, providing a short description of the command along with examples and compatible flags. - -```bash -score-k8s init --help -``` - -## `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. - -```bash -score-k8s generate [flags] -``` - -#### Flags - -The `generate` command can be combined with the following flags: - -#### `--image` - -Specifies an optional container image to use for any container with `image == '.'`. - -```bash -score-k8s generate --image your_container_image -``` - -#### `--output` | `-o` - -Specifies the output file to write the manifest to. By default, the output file is named `manifest.yaml`. - -```bash -score-k8s generate --output your_output_file.yaml -``` - -#### `--override-property` - -Specifies an optional set of path=key overrides to set or remove. - -```bash -score-k8s generate --override-property path1=value1 -``` - -#### `--overrides-file` - -Specifies an optional file of Score overrides to merge in. - -```bash -score-k8s generate score.yaml --overrides-file=./overrides.score.yaml -``` - -#### `--patch-manifests` - -Specifies an optional set of `//path=key` operations for the output manifests. - -```bash -score-k8s generate --patch-manifests 'Deployment/my-workload/spec.replicas=3' -``` - -#### `--help` | `-h` - -Displays help information for `generate`, providing a short description of the command along with examples and compatible flags. - -```bash -score-k8s generate --help -``` - -## `help` - -The help command provides information on all commands. - -```bash -score-k8s help [command] [flags] -``` - -## Global flags - -#### `--help` | `-h` - -Displays help information for score-k8s, includig available commands and flags. - -```bash -score-k8s --help -``` - -#### `--quiet` - -Mutes any logging output. - -```bash -score-k8s --quiet -``` - -#### `--verbose count` | `-v` - -Increases log verbosity and detail by specifying this flag one or more times. - -```bash -score-k8s --verbose count -``` - -#### `--version` - -Displays the version of score-k8s. - -```bash -score-k8s --version -``` diff --git a/content/en/docs/score implementation/score-k8s/_index.md b/content/en/docs/score implementation/score-k8s/_index.md new file mode 100644 index 00000000..f6e2b59f --- /dev/null +++ b/content/en/docs/score implementation/score-k8s/_index.md @@ -0,0 +1,10 @@ +--- +title: "score-k8s" +linkTitle: "score-k8s" +description: "Get started with the score-k8s reference implementation" +weight: 2 +--- + +The `score-k8s` CLI serves as a reference implementation for the Score specification, providing a standard for the creation of custom Score CLIs. `score-k8s` can be utilized both as a reference point for implementation and for practical use in development with Kubernetes. + +For additional details and opportunities to contribute to the project, visit the [`score-k8s`](https://github.com/score-spec/score-k8s) GitHub repository. \ No newline at end of file diff --git a/content/en/docs/score implementation/score-k8s/cli.md b/content/en/docs/score implementation/score-k8s/cli.md new file mode 100644 index 00000000..f5ae31bb --- /dev/null +++ b/content/en/docs/score implementation/score-k8s/cli.md @@ -0,0 +1,150 @@ +--- +title: "score-k8s CLI reference" +linkTitle: "CLI reference" +description: "CLI reference for score-k8s" +weight: 2 +aliases: +- /docs/reference/score-cli/score-k8s/cli +--- + +The `score-k8s` CLI provides a set of commands and flags to enable the generation of Kubernetes manifests from Score specifications. + +## 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. + +```bash +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`. + +```bash +score-k8s init --file custom_file_name.yaml +``` + +#### `--no-sample` + +Disables the generation of the sample Score file if you already have a Score file in place. + +```bash +score-k8s init --no-sample +``` + +#### `--help` | `-h` + +Displays help information for `init`, providing a short description of the command along with examples and compatible flags. + +```bash +score-k8s init --help +``` + +## `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. + +```bash +score-k8s generate [flags] +``` + +#### Flags + +The `generate` command can be combined with the following flags: + +#### `--image` + +Specifies an optional container image to use for any container with `image == '.'`. + +```bash +score-k8s generate --image your_container_image +``` + +#### `--output` | `-o` + +Specifies the output file to write the manifest to. By default, the output file is named `manifest.yaml`. + +```bash +score-k8s generate --output your_output_file.yaml +``` + +#### `--override-property` + +Specifies an optional set of path=key overrides to set or remove. + +```bash +score-k8s generate --override-property path1=value1 +``` + +#### `--overrides-file` + +Specifies an optional file of Score overrides to merge in. + +```bash +score-k8s generate score.yaml --overrides-file=./overrides.score.yaml +``` + +#### `--patch-manifests` + +Specifies an optional set of `//path=key` operations for the output manifests. + +```bash +score-k8s generate --patch-manifests 'Deployment/my-workload/spec.replicas=3' +``` + +#### `--help` | `-h` + +Displays help information for `generate`, providing a short description of the command along with examples and compatible flags. + +```bash +score-k8s generate --help +``` + +## `help` + +The `help` command provides information on all commands. + +```bash +score-k8s help [command] [flags] +``` + +## Global flags + +#### `--help` | `-h` + +Displays help information for `score-k8s`, includig available commands and flags. + +```bash +score-k8s --help +``` + +#### `--quiet` + +Mutes any logging output. + +```bash +score-k8s --quiet +``` + +#### `--verbose count` | `-v` + +Increases log verbosity and detail by specifying this flag one or more times. + +```bash +score-k8s --verbose count +``` + +#### `--version` + +Displays the version of `score-k8s`. + +```bash +score-k8s --version +``` diff --git a/content/en/docs/score implementation/score-k8s/installation.md b/content/en/docs/score implementation/score-k8s/installation.md new file mode 100644 index 00000000..2e5dd70c --- /dev/null +++ b/content/en/docs/score implementation/score-k8s/installation.md @@ -0,0 +1,41 @@ +--- +title: "score-k8s installation" +linkTitle: "Installation" +description: "Installation of score-k8s" +weight: 1 +aliases: +- /docs/reference/score-cli/score-k8s/install +--- + +You can install the `score-k8s` CLI in a variety of ways: + +- [Homebrew](#homebrew) +- [Go](#go) +- [Manual download](#manual-download) + +### Homebrew + +Prerequisites: You must have [brew](https://brew.sh) installed. + +```bash +brew install score-spec/tap/score-k8s +``` + +### Go + +Prerequisites: You must have [Go](https://go.dev/dl/) installed. + +```bash +$ go install -v github.com/score-spec/score-k8s@latest +``` + +### Manual download + +The following methods download the `score-k8s` CLI from its [GitHub release page](https://github.com/score-spec/score-k8s/releases): + +{{< tabs name="Manual installation methods">}} +{{< tab name="curl on macOS" include="../included/install-score-k8s-curl-mac.md" />}} +{{< tab name="wget on macOS/Linux" include="../included/install-wget-k8s.md" />}} +{{< tab name="GitHub DLs on macOS/Linux" include="../included/install-score-k8s-bash.md" />}} +{{< tab name="Windows" include="../included/install-windows-k8s.md" />}} +{{< /tabs >}} \ No newline at end of file diff --git a/content/en/docs/score implementation/score-k8s/resources-provisioners.md b/content/en/docs/score implementation/score-k8s/resources-provisioners.md new file mode 100644 index 00000000..7647120a --- /dev/null +++ b/content/en/docs/score implementation/score-k8s/resources-provisioners.md @@ -0,0 +1,27 @@ +--- +title: "score-k8s resources provisioners" +linkTitle: "Resources provisioners" +description: "resources provisioners of score-k8s" +weight: 3 +aliases: +- /docs/reference/score-cli/score-k8s/provisioners +- /docs/reference/score-cli/score-k8s/resources-provisioners +- /docs/reference/score-cli/score-k8s/resources +--- + +`score-k8s` comes with out-of-the-box support for: + +| Type | Class | Params | Output | +| --------------- | --------- | ---------------------- |-----------------------------------------------------------------| +| `ampq` | `default` | (none) | `host`, `port`, `username`, `password`, `vhost` | +| `dns` | `default` | (none) | `host` | +| `mongodb` | `default` | (none) | `host`, `port`, `username`, `password`, `name`, `connection` | +| `mysql` | `default` | (none) | `host`, `port`, `name` (aka `database`), `username`, `password` | +| `postgres` | `default` | (none) | `host`, `port`, `name` (aka `database`), `username`, `password` | +| `redis` | `default` | (none) | `host`, `port`, `username`, `password` | +| `route` | `default` | `host`, `path`, `port` | | +| `volume` | `default` | (none) | `source` | + +These can be found in the default provisioners file. You are encouraged to write your own provisioners and add them to the `.score-k8s` directory (with the `.provisioners.yaml` extension) or contribute them upstream to the [default.provisioners.yaml](https://github.com/score-spec/score-k8s/blob/main/internal/provisioners/default/zz-default.provisioners.yaml) file. + +Users are encouraged to write their own custom provisioners to support new resource types or to modify the implementations above. See [example here](https://score.dev/blog/writing-a-custom-score-compose-provisioner-for-apache-kafka/). \ No newline at end of file