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: docs/content/en/docs/design/api.md
+19-21
Original file line number
Diff line number
Diff line change
@@ -21,38 +21,36 @@ To retrieve information about the Skaffold pipeline, the Skaffold API provides t
21
21
To control the individual phases of the Skaffold, the Skaffold API provides [fine-grained control]({{< relref "#control-api" >}})
22
22
over the individual phases of the pipeline (build, deploy, and sync).
23
23
24
-
25
24
## Connecting to the Skaffold API
26
25
The Skaffold API is `gRPC` based, and it is also exposed via the gRPC gateway as a JSON over HTTP service.
27
-
The server is hosted locally on the same host where the skaffold process is running, and will serve by default on ports 50051 and 50052.
28
-
These ports can be configured through the `--rpc-port` and `--rpc-http-port` flags.
29
26
30
-
For reference, we generate the server's [gRPC service definitions and message protos]({{< relref "/docs/references/api/grpc" >}}) as well as the [Swagger based HTTP API Spec]({{< relref "/docs/references/api/swagger" >}}).
27
+
The API can be enabled via setting the `--rpc-port` or `--rpc-http-port` flags (or both)
28
+
depending on whether you want to enable the gRPC API or the HTTP REST API, respectively.
31
29
32
30
33
-
### HTTP server
34
-
The HTTP API is exposed on port `50052` by default. The default HTTP port can be overridden with the `--rpc-http-port` flag.
35
-
If the HTTP API port is taken, Skaffold will find the next available port.
36
-
The final port can be found from Skaffold's startup logs.
31
+
{{< alert title="Note">}}
32
+
The `--enable-rpc` flag is now deprecated in favor of `--rpc-port` and `--rpc-http-port` flags.
33
+
{{</alert>}}
37
34
38
-
```code
39
-
$ skaffold dev
40
-
WARN[0000] port 50052 for gRPC HTTP server already in use: using 50055 instead
41
-
```
42
35
43
-
### gRPC Server
36
+
For reference, we generate the server's [gRPC service definitions and message protos]({{< relref "/docs/references/api/grpc" >}}) as well as the [Swagger based HTTP API Spec]({{< relref "/docs/references/api/swagger" >}}).
37
+
38
+
## gRPC Server
44
39
45
-
The gRPC API is exposed on port `50051` by default and can be overridden with the `--rpc-port` flag.
46
-
As with the HTTP API, if this port is taken, Skaffold will find the next available port.
47
-
You can find this port from Skaffold's logs on startup.
40
+
The gRPC API can be started by specifying the `--rpc-port` flag. If the specified port is not available, Skaffold will
41
+
exit with failure.
48
42
49
-
```code
50
-
$ skaffold dev
51
-
WARN[0000] port 50051 for gRPC server already in use: using 50053 instead
52
-
```
43
+
### HTTP server
44
+
45
+
The HTTP REST API can be started by specifying the `--rpc-http-port` flag. If the specified port is not available,
46
+
Skaffold will exit with failure.
47
+
48
+
Starting the HTTP REST API will also start the gRPC API as it proxies the requests to the gRPC API. By default, Skaffold
49
+
chooses a random available port for gRPC, but it can be customized (see below).
53
50
54
51
#### Creating a gRPC Client
55
-
To connect to the `gRPC` server at default port `50051`, create a client using the following code snippet.
52
+
53
+
To connect to the `gRPC` server at the specified port, create a client using the following code snippet.
56
54
57
55
{{< alert title="Note" >}}
58
56
The skaffold gRPC server is not compatible with HTTPS, so connections need to be marked as insecure with `grpc.WithInsecure()`
0 commit comments