You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/stunnerctl/README.md
+61-11Lines changed: 61 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,11 @@ go build -o stunnerctl cmd/stunnerctl/main.go
26
26
27
27
## Usage
28
28
29
-
Type `stunnerctl` to get a glimpse of the features provided. Below are some common usage examples.
29
+
Type `stunnerctl` to get a glimpse of the sub-commands and features provided.
30
+
31
+
### Config
32
+
33
+
The `config` sub-command is used to load or watch running dataplane configs from the STUNner config discovery service (CDS) running in a remote Kubernetes cluster. Usually the CDS server role is fulfilled by the [STUNner gateway operator](https://github.com/l7mp/stunner-gateway-operator) but you can choose any CDS service you want (see the `--cds-server-*` CLI flags in the help). The main use of this command is to check the active dataplane configuration for troubleshooting connectivity problems.
30
34
31
35
- Dump a summary of the running config of the STUNner gateway called `udp-gateway` deployed into the `stunner` namespace:
32
36
@@ -42,15 +46,21 @@ Type `stunnerctl` to get a glimpse of the features provided. Below are some comm
42
46
Endpoints: [10.76.1.3, 10.80.7.104]
43
47
```
44
48
45
-
- Dump a the running config of all gateways in the `stunner` namespace in JSON format (YAML is also available using `-o yaml`):
49
+
- The same, but using the alternative Kubernetes config file `~/my-config.conf` to access the cluster. The rest of the usual `kubectl` flags (`--context`, `--token`, etc.) are also available to select the cluster to connect to.
@@ -59,8 +69,6 @@ Type `stunnerctl` to get a glimpse of the features provided. Below are some comm
59
69
...
60
70
```
61
71
62
-
## Fallback
63
-
64
72
For those who don't have the Go toolchain available to run `go install`, STUNner provides a minimalistic `stunnerctl` replacement called `stunnerctl.sh`.
65
73
This script requires nothing else than `bash`, `kubectl`, `curl` and `jq` to work.
66
74
@@ -80,19 +88,15 @@ Listener 1
80
88
Public port: 3478
81
89
```
82
90
83
-
## Last resort
84
-
85
-
You can also use `kubectl port-forward` to load or watch STUNner configs manually.
86
-
Open a port-forwarded connection to the STUNner gateway operator:
91
+
You can also use `kubectl port-forward` to load or watch STUNner configs manually. Open a port-forwarded connection to the STUNner gateway operator:
87
92
88
93
```console
89
94
export CDS_SERVER_NAME=$(kubectl get pods -l stunner.l7mp.io/config-discovery-service=enabled --all-namespaces -o jsonpath='{.items[0].metadata.name}')
90
95
export CDS_SERVER_NAMESPACE=$(kubectl get pods -l stunner.l7mp.io/config-discovery-service=enabled --all-namespaces -o jsonpath='{.items[0].metadata.namespace}')
If all goes well, you can now connect to the STUNner config discovery API served by the gateway operator directly, just using `curl`.
95
-
The below will load the config of the `udp-gateway` in the `stunner` namespace:
99
+
If all goes well, you can now connect to the STUNner CDS API served by the gateway operator through the port-forwarded tunnel opened by `kubectl` just using `curl`. The below will load the config of the `udp-gateway` in the `stunner` namespace:
- Same but report only the runtime status of the `stunnerd` pods in the `stunner` namespace:
132
+
133
+
```console
134
+
stunnerctl -n stunner status -o jsonpath='{.status}'
135
+
READY
136
+
TERMINATING
137
+
```
138
+
139
+
### Authentication
140
+
141
+
The `auth` sub-command can be used to obtain a TURN credential or a full ICE server config for connecting to a specific gateway. The authentication service API is usually served by a separate [STUNner authentication server](https://github.com/l7mp/stunner-auth-service) deployed alongside the gateway operator. The main use of this command is to feed an ICE agent manually with the ICE server config to connect to a specific STUNner gateway.
142
+
143
+
- Obtain a full ICE server config for `udp-gateway` deployed into the `stunner` namespace:
- Request a plain [TURN credential](https://datatracker.ietf.org/doc/html/draft-uberti-behave-turn-rest-00) using the authentication service deployed into the `stunner-system-prod` namespace:
Copy file name to clipboardExpand all lines: docs/cmd/stunnerctl.md
+63-22Lines changed: 63 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -5,16 +5,7 @@ The prominent use of `stunnerctl` is to load or watch STUNner dataplane configur
5
5
6
6
## Installation
7
7
8
-
On Linux and macOS, Use [this script](/cmd/getstunner/getstunner.sh) to download the latest version of the `stunnerctl` binary:
9
-
10
-
```console
11
-
curl -sL https://raw.githubusercontent.com/l7mp/stunner/main/cmd/getstunner/getstunner.sh | sh -
12
-
export PATH=$HOME/.l7mp/bin:$PATH
13
-
```
14
-
> [!NOTE]
15
-
> The script installs `turncat` too.
16
-
17
-
Install the `stunnerctl` binary using the standard Go toolchain and add it to `$PATH`.
8
+
Install the `stunnerctl` binary using the standard Go toolchain and add it to `$PATH`.
18
9
19
10
```console
20
11
go install github.com/l7mp/stunner/cmd/stunnerctl@latest
@@ -35,7 +26,11 @@ go build -o stunnerctl cmd/stunnerctl/main.go
35
26
36
27
## Usage
37
28
38
-
Type `stunnerctl` to get a glimpse of the features provided. Below are some common usage examples.
29
+
Type `stunnerctl` to get a glimpse of the sub-commands and features provided.
30
+
31
+
### Config
32
+
33
+
The `config` sub-command is used to load or watch running dataplane configs from the STUNner config discovery service (CDS) running in a remote Kubernetes cluster. Usually the CDS server role is fulfilled by the [STUNner gateway operator](https://github.com/l7mp/stunner-gateway-operator) but you can choose any CDS service you want (see the `--cds-server-*` CLI flags in the help). The main use of this command is to check the active dataplane configuration for troubleshooting connectivity problems.
39
34
40
35
- Dump a summary of the running config of the STUNner gateway called `udp-gateway` deployed into the `stunner` namespace:
41
36
@@ -51,15 +46,21 @@ Type `stunnerctl` to get a glimpse of the features provided. Below are some comm
51
46
Endpoints: [10.76.1.3, 10.80.7.104]
52
47
```
53
48
54
-
- Dump a the running config of all gateways in the `stunner` namespace in JSON format (YAML is also available using `-o yaml`):
49
+
- The same, but using the alternative Kubernetes config file `~/my-config.conf` to access the cluster. The rest of the usual `kubectl` flags (`--context`, `--token`, etc.) are also available to select the cluster to connect to.
@@ -68,16 +69,14 @@ Type `stunnerctl` to get a glimpse of the features provided. Below are some comm
68
69
...
69
70
```
70
71
71
-
## Fallback
72
-
73
72
For those who don't have the Go toolchain available to run `go install`, STUNner provides a minimalistic `stunnerctl` replacement called `stunnerctl.sh`.
74
73
This script requires nothing else than `bash`, `kubectl`, `curl` and `jq` to work.
75
74
76
75
The below will dump the running config of `tcp-gateway` deployed into the `stunner` namespace:
If all goes well, you can now connect to the STUNner config discovery API served by the gateway operator directly, just using `curl`.
104
-
The below will load the config of the `udp-gateway` in the `stunner` namespace:
99
+
If all goes well, you can now connect to the STUNner CDS API served by the gateway operator through the port-forwarded tunnel opened by `kubectl` just using `curl`. The below will load the config of the `udp-gateway` in the `stunner` namespace:
- Same but report only the runtime status of the `stunnerd` pods in the `stunner` namespace:
132
+
133
+
```console
134
+
stunnerctl -n stunner status -o jsonpath='{.status}'
135
+
READY
136
+
TERMINATING
137
+
```
138
+
139
+
### Authentication
140
+
141
+
The `auth` sub-command can be used to obtain a TURN credential or a full ICE server config for connecting to a specific gateway. The authentication service API is usually served by a separate [STUNner authentication server](https://github.com/l7mp/stunner-auth-service) deployed alongside the gateway operator. The main use of this command is to feed an ICE agent manually with the ICE server config to connect to a specific STUNner gateway.
142
+
143
+
- Obtain a full ICE server config for `udp-gateway` deployed into the `stunner` namespace:
- Request a plain [TURN credential](https://datatracker.ietf.org/doc/html/draft-uberti-behave-turn-rest-00) using the authentication service deployed into the `stunner-system-prod` namespace:
0 commit comments