Skip to content

Commit b784113

Browse files
rbtrjimassa
andauthored
docs: add instructions to install the CLI through Krew (#193)
# Description [Retina is available in Krew!](kubernetes-sigs/krew-index#3722) Updates the docs with installation instructions using Krew. Also updates the Helm chart installation instructions to fetch the latest released version instead of hardcoding a version. ## Related Issue related to #108 provides a permanent fix for #163 --------- Signed-off-by: Evan Baker <[email protected]> Co-authored-by: Jacques I Massa <[email protected]>
1 parent 8df153c commit b784113

File tree

4 files changed

+56
-46
lines changed

4 files changed

+56
-46
lines changed

.goreleaser.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ builds:
2222
- windows
2323
- darwin
2424
ldflags:
25-
- -X github.com/microsoft/retina/cli/cmd.Version={{.Version}}
25+
- -X github.com/microsoft/retina/cli/cmd.Version=v{{.Version}}
2626
main: cli/main.go
2727

2828
archives:

README.md

+22-25
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ Retina has two major features:
4040
Retina can be installed using the Helm chart from GHCR:
4141

4242
```bash
43+
# Set the version to a specific version here or get latest version from GitHub API.
44+
VERSION=$( curl -sL https://api.github.com/repos/microsoft/retina/releases/latest | jq -r .name)
4345
helm upgrade --install retina oci://ghcr.io/microsoft/retina/charts/retina \
44-
--version v0.0.2 \
45-
--set image.tag=v0.0.2 \
46-
--set operator.tag=v0.0.2 \
46+
--version $VERSION \
47+
--set image.tag=$VERSION \
48+
--set operator.tag=$VERSION \
4749
--set logLevel=info \
4850
--set enabledPlugin_linux="\[dropreason\,packetforward\,linuxutil\,dns\]"
4951
```
@@ -56,31 +58,25 @@ After Helm install, follow steps in [Using Prometheus and Grafana](https://retin
5658

5759
#### Captures via CLI
5860

59-
Currently, Retina CLI only supports Linux.
61+
The preferred way to install the Retina CLI using [Krew](https://krew.sigs.k8s.io/).
6062

61-
- Option 1: Download from Release
62-
63-
Download the correct `kubectl-retina` package for your platform from the latest [Retina release](https://github.com/microsoft/retina/releases).
64-
Feel free to move the binary to `/usr/local/bin/`, or add it to your `PATH` otherwise.
65-
66-
- Option 2: Build from source
67-
68-
Requirements:
69-
70-
- go 1.21 or newer
63+
```bash
64+
kubectl krew install retina
65+
```
7166

72-
Clone the Retina repo and execute:
67+
Other installation options are documented in [CLI Installation](https://retina.sh/docs/installation/cli).
7368

74-
```shell
75-
go build -o bin/kubectl-retina cli/main.go
76-
```
69+
Verify installation:
7770

78-
and move bin/kubectl-retina in to your $PATH.
71+
```bash
72+
$ kubectl retina version
73+
v0.0.4 # or latest version
74+
```
7975

80-
Execute Retina:
76+
To quickly start creating a capture:
8177

82-
```shell
83-
kubectl-retina capture create --help
78+
```bash
79+
kubectl retina capture create --name <my-capture> --namespace <my-namespace> --selector <app=my-app>
8480
```
8581

8682
For further CLI documentation, see [Capture with Retina CLI](https://retina.sh/docs/captures/cli).
@@ -90,10 +86,11 @@ For further CLI documentation, see [Capture with Retina CLI](https://retina.sh/d
9086
Install Retina using Helm:
9187

9288
```bash
89+
VERSION=$( curl -sL https://api.github.com/repos/microsoft/retina/releases/latest | jq -r .name)
9390
helm upgrade --install retina oci://ghcr.io/microsoft/retina/charts/retina \
94-
--version v0.0.2 \
95-
--set image.tag=v0.0.2 \
96-
--set operator.tag=v0.0.2 \
91+
--version $VERSION \
92+
--set image.tag=$VERSION \
93+
--set operator.tag=$VERSION \
9794
--set image.pullPolicy=Always \
9895
--set logLevel=info \
9996
--set os.windows=true \

docs/installation/cli.md

+17-6
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,34 @@ Currently, Retina CLI supports Linux, Windows, and MacOS on x86_64 and ARM64 pla
44

55
For CLI usage, see [Capture with Retina CLI](../captures/cli.md).
66

7-
## Option 1: Download from Release
7+
## Option 1: Install using Krew
88

9-
Download `kubectl-retina` from the latest [Retina release](https://github.com/microsoft/retina/releases).
10-
Feel free to move the binary to `/usr/local/bin/`, or add it to your `PATH` otherwise.
9+
Retina CLI is available as a [Krew plugin](https://krew.sigs.k8s.io/)! To install it, run:
10+
11+
```bash
12+
kubectl krew install retina
13+
```
14+
15+
## Option 2: Download the binary from the latest release on GitHub
16+
17+
Download the `kubectl-retina` package for your platform from the latest [Retina release](https://github.com/microsoft/retina/releases/latest).
1118

1219
## Option 2: Build from source
1320

1421
Building the CLI requires go1.21 or greater.
1522

16-
To build the CLI simply with Go:
23+
To build the CLI simply and quickly with Go:
1724

1825
```bash
1926
go build -o bin/kubectl-retina cli/main.go
2027
```
2128

22-
To cross-compile for all supported platforms, use [GoReleaser](https://goreleaser.com/):
29+
The release pipeline uses [GoReleaser](https://goreleaser.com/), which is the recommended way to build the CLI.
30+
31+
To build the CLI with GoReleaser:
2332

2433
```bash
25-
goreleaser build --snapshot --clean
34+
goreleaser build --snapshot --clean [--single-target]
2635
```
36+
37+
Note: --single-target is optional and can be used to build for the current platform only. Omit it to cross-compile for all supported platforms.

docs/installation/setup.md

+16-14
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@ Note: you can also run captures with just the [CLI](./cli.md).
66

77
## Installation
88

9-
When installing with helm, substitute the `version` and image `tag` arguments to the desired version, if different.
10-
119
### Basic Mode
1210

1311
```shell
12+
VERSION=$( curl -sL https://api.github.com/repos/microsoft/retina/releases/latest | jq -r .name)
1413
helm upgrade --install retina oci://ghcr.io/microsoft/retina/charts/retina \
15-
--version v0.0.2 \
14+
--version $VERSION \
1615
--namespace kube-system \
17-
--set image.tag=v0.0.2 \
18-
--set operator.tag=v0.0.2 \
16+
--set image.tag=$VERSION \
17+
--set operator.tag=$VERSION \
1918
--set logLevel=info \
2019
--set enabledPlugin_linux="\[dropreason\,packetforward\,linuxutil\,dns\]"
2120
```
2221

2322
### Basic Mode (with Capture support)
2423

2524
```shell
25+
VERSION=$( curl -sL https://api.github.com/repos/microsoft/retina/releases/latest | jq -r .name)
2626
helm upgrade --install retina oci://ghcr.io/microsoft/retina/charts/retina \
27-
--version v0.0.2 \
27+
--version $VERSION \
2828
--namespace kube-system \
29-
--set image.tag=v0.0.2 \
30-
--set operator.tag=v0.0.2 \
29+
--set image.tag=$VERSION \
30+
--set operator.tag=$VERSION \
3131
--set logLevel=info \
3232
--set image.pullPolicy=Always \
3333
--set logLevel=info \
@@ -43,11 +43,12 @@ helm upgrade --install retina oci://ghcr.io/microsoft/retina/charts/retina \
4343
See [Metric Modes](../metrics/modes.md).
4444

4545
```shell
46+
VERSION=$( curl -sL https://api.github.com/repos/microsoft/retina/releases/latest | jq -r .name)
4647
helm upgrade --install retina oci://ghcr.io/microsoft/retina/charts/retina \
47-
--version v0.0.2 \
48+
--version $VERSION \
4849
--namespace kube-system \
49-
--set image.tag=v0.0.2 \
50-
--set operator.tag=v0.0.2 \
50+
--set image.tag=$VERSION \
51+
--set operator.tag=$VERSION \
5152
--set image.pullPolicy=Always \
5253
--set logLevel=info \
5354
--set os.windows=true \
@@ -64,11 +65,12 @@ helm upgrade --install retina oci://ghcr.io/microsoft/retina/charts/retina \
6465
See [Metric Modes](../metrics/modes.md).
6566

6667
```shell
68+
VERSION=$( curl -sL https://api.github.com/repos/microsoft/retina/releases/latest | jq -r .name)
6769
helm upgrade --install retina oci://ghcr.io/microsoft/retina/charts/retina \
68-
--version v0.0.2 \
70+
--version $VERSION \
6971
--namespace kube-system \
70-
--set image.tag=v0.0.2 \
71-
--set operator.tag=v0.0.2 \
72+
--set image.tag=$VERSION \
73+
--set operator.tag=$VERSION \
7274
--set image.pullPolicy=Always \
7375
--set logLevel=info \
7476
--set os.windows=true \

0 commit comments

Comments
 (0)