Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 89 additions & 22 deletions documentation/content/en/installation/kpt-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,104 @@ Users can get kpt CLI in a variety of ways:

Download pre-compiled binaries:

- [Linux (amd64)][linux-amd64]
- [Linux (arm64)][linux-arm64]
- [MacOS (amd64)][darwin-amd64]
- [MacOS (arm64)][darwin-arm64]
{{< tabpane text=true >}}
{{% tab header="Linux amd64" %}}
```shell
curl -LO https://github.com/kptdev/kpt/releases/download/v{{< kpt_version >}}/kpt_linux_amd64-{{< kpt_version >}}.tar.gz
```
{{% /tab %}}
{{% tab header="Linux arm64" %}}
```shell
curl -LO https://github.com/kptdev/kpt/releases/download/v{{< kpt_version >}}/kpt_linux_arm64-{{< kpt_version >}}.tar.gz
```
{{% /tab %}}
{{% tab header="macOS amd64" %}}
```shell
curl -LO https://github.com/kptdev/kpt/releases/download/v{{< kpt_version >}}/kpt_darwin_amd64-{{< kpt_version >}}.tar.gz
```
{{% /tab %}}
{{% tab header="macOS arm64" %}}
```shell
curl -LO https://github.com/kptdev/kpt/releases/download/v{{< kpt_version >}}/kpt_darwin_arm64-{{< kpt_version >}}.tar.gz
```
{{% /tab %}}
{{< /tabpane >}}

Optionally verify the [SLSA3 signatures](https://slsa.dev/) generated using the OpenSSF's
[slsa-framework/slsa-github-generator](https://github.com/slsa-framework/slsa-github-generator) during the release
process. To verify a release binary:
process. To verify a release archive:

1. Install the verification tool from [slsa-framework/slsa-verifier#installation](https://github.com/slsa-framework/slsa-verifier#installation).
2. Download the signature file `multiple.intoto.jsonl` from the [GitHub releases page](https://github.com/kptdev/kpt/releases).
2. Download the signature file:

```shell
curl -LO https://github.com/kptdev/kpt/releases/download/v{{< kpt_version >}}/multiple.intoto.jsonl
```
3. Run the verifier:

{{< tabpane text=true >}}
{{% tab header="Linux amd64" %}}
```shell
slsa-verifier verify-artifact \
--provenance-path multiple.intoto.jsonl \
--source-uri github.com/kptdev/kpt \
--source-versioned-tag v{{< kpt_version >}} \
kpt_linux_amd64-{{< kpt_version >}}.tar.gz
```
{{% /tab %}}
{{% tab header="Linux arm64" %}}
```shell
slsa-verifier verify-artifact \
--provenance-path multiple.intoto.jsonl \
--source-uri github.com/kptdev/kpt \
--source-versioned-tag v{{< kpt_version >}} \
kpt_linux_arm64-{{< kpt_version >}}.tar.gz
```
{{% /tab %}}
{{% tab header="macOS amd64" %}}
```shell
slsa-verifier verify-artifact --provenance-path multiple.intoto.jsonl --source-uri github.com/kptdev/kpt --source-versioned-tag <the-tag> kpt_<os>_<arch>
slsa-verifier verify-artifact \
--provenance-path multiple.intoto.jsonl \
--source-uri github.com/kptdev/kpt \
--source-versioned-tag v{{< kpt_version >}} \
kpt_darwin_amd64-{{< kpt_version >}}.tar.gz
```
{{% /tab %}}
{{% tab header="macOS arm64" %}}
```shell
slsa-verifier verify-artifact \
--provenance-path multiple.intoto.jsonl \
--source-uri github.com/kptdev/kpt \
--source-versioned-tag v{{< kpt_version >}} \
kpt_darwin_arm64-{{< kpt_version >}}.tar.gz
```
{{% /tab %}}
{{< /tabpane >}}

On Linux and MacOS, make it executable:
After downloading (and optionally verifying), extract the archive:

{{< tabpane text=true >}}
{{% tab header="Linux amd64" %}}
```shell
tar -xzf kpt_linux_amd64-{{< kpt_version >}}.tar.gz
```
{{% /tab %}}
{{% tab header="Linux arm64" %}}
```shell
tar -xzf kpt_linux_arm64-{{< kpt_version >}}.tar.gz
```
{{% /tab %}}
{{% tab header="macOS amd64" %}}
```shell
chmod +x kpt
tar -xzf kpt_darwin_amd64-{{< kpt_version >}}.tar.gz
```
{{% /tab %}}
{{% tab header="macOS arm64" %}}
```shell
tar -xzf kpt_darwin_arm64-{{< kpt_version >}}.tar.gz
```
{{% /tab %}}
{{< /tabpane >}}

On MacOS the first time, it may be necessary to open the program from the finder with _ctrl-click open_.

Expand Down Expand Up @@ -89,20 +165,20 @@ Running kpt via Docker does not install kpt on your machine. Each `docker run ..
### `kpt`

```shell
docker run ghcr.io/kptdev/kpt:{{< kpt_version >}} version
docker run ghcr.io/kptdev/kpt:v{{< kpt_version >}} version
```

To use kpt with files on your host, mount your current directory into the container and set a working directory:

```shell
docker run --rm -v "$PWD":/workdir -w /workdir ghcr.io/kptdev/kpt:{{< kpt_version >}} pkg tree
docker run --rm -v "$PWD":/workdir -w /workdir ghcr.io/kptdev/kpt:{{< kpt_version >}} fn render
docker run --rm -v "$PWD":/workdir -w /workdir ghcr.io/kptdev/kpt:v{{< kpt_version >}} pkg tree
docker run --rm -v "$PWD":/workdir -w /workdir ghcr.io/kptdev/kpt:v{{< kpt_version >}} fn render
```

On Windows PowerShell, use `${PWD}.Path` for the current directory:

```shell
docker run --rm -v "${PWD}.Path:/workdir" -w /workdir ghcr.io/kptdev/kpt:{{< kpt_version >}} pkg tree
docker run --rm -v "${PWD}.Path:/workdir" -w /workdir ghcr.io/kptdev/kpt:v{{< kpt_version >}} pkg tree
```

This pattern ensures kpt reads and writes files under `/workdir`, which maps to your current directory on the host.
Expand Down Expand Up @@ -166,13 +242,4 @@ kpt version

[ghcr.io/kptdev/kpt]: https://github.com/kptdev/kpt/pkgs/container/kpt
[cloud-sdk]: https://github.com/GoogleCloudPlatform/cloud-sdk-docker

[linux-amd64]:
https://github.com/kptdev/kpt/releases/download/{{< kpt_version >}}/kpt_linux_amd64
[linux-arm64]:
https://github.com/kptdev/kpt/releases/download/{{< kpt_version >}}/kpt_linux_arm64
[darwin-amd64]:
https://github.com/kptdev/kpt/releases/download/{{< kpt_version >}}/kpt_darwin_amd64
[darwin-arm64]:
https://github.com/kptdev/kpt/releases/download/{{< kpt_version >}}/kpt_darwin_arm64
[bash-completion]: https://github.com/scop/bash-completion#installation
2 changes: 1 addition & 1 deletion documentation/layouts/shortcodes/kpt_version.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{- getenv "HUGO_KPT_VERSION" | default .Site.Params.kpt_version -}}
{{- (getenv "HUGO_KPT_VERSION" | default .Site.Params.kpt_version) | strings.TrimPrefix "v" -}}