Skip to content

Commit 8c9c60c

Browse files
author
Tim Bannister
authored
Tweak text formatting
1 parent f9ceed7 commit 8c9c60c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

content/en/blog/_posts/2024-05-01-cri-streaming-explained.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ going to become deprecated.
1717

1818
In this blog post, I'd like to dive into the functionality and history of three
1919
extraordinary Remote Procedure Calls (RPCs), which are truly outstanding in
20-
terms of how they work: **Exec**, **Attach** and **PortForward**.
20+
terms of how they work: `Exec`, `Attach` and `PortForward`.
2121

2222
**Exec** can be used to run dedicated commands within the container and stream
2323
the output to a client like [kubectl](/docs/reference/kubectl) or
@@ -41,7 +41,7 @@ All RPCs of the CRI either use the [gRPC unary calls](https://grpc.io/docs/what-
4141
for communication or the [server side streaming](https://grpc.io/docs/what-is-grpc/core-concepts/#server-streaming-rpc)
4242
feature (only `GetContainerEvents` right now). This means that mainly all RPCs
4343
retrieve a single client request and have to return a single server response.
44-
The same applies to **Exec**, **Attach**, and **PortForward**, where [their protocol definition](https://github.com/kubernetes/cri-api/blob/63929b3/pkg/apis/runtime/v1/api.proto#L94-L99)
44+
The same applies to `Exec`, `Attach`, and `PortForward`, where their [protocol definition](https://github.com/kubernetes/cri-api/blob/63929b3/pkg/apis/runtime/v1/api.proto#L94-L99)
4545
looks like this:
4646

4747
```protobuf
@@ -87,7 +87,7 @@ message PortForwardResponse {
8787
Why is it implemented like that? Well, [the original design document](https://docs.google.com/document/d/1MreuHzNvkBW6q7o_zehm1CBOBof3shbtMTGtUpjpRmY)
8888
for those RPCs even predates [Kubernetes Enhancements Proposals (KEPs)](https://github.com/kubernetes/enhancements)
8989
and was originally outlined back in 2016. The kubelet had a native
90-
implementation for **Exec**, **Attach**, and **PortForward** before the
90+
implementation for `Exec`, `Attach`, and `PortForward` before the
9191
initiative to bring the functionality to the CRI started. Before that,
9292
everything was bound to [Docker](https://www.docker.com) or the later abandoned
9393
container runtime [rkt](https://github.com/rkt/rkt).
@@ -100,7 +100,7 @@ another option that the Kubelet implements a portable, runtime-agnostic solution
100100
has been abandoned over the final one, because this would mean another project
101101
to maintain which nevertheless would be runtime dependent.
102102

103-
This means, that the basic flow for **Exec**, **Attach** and **PortForward**
103+
This means, that the basic flow for `Exec`, `Attach` and `PortForward`
104104
was proposed to look like this:
105105

106106
{{< mermaid >}}
@@ -144,7 +144,7 @@ streaming protocol or (in the future) to a [WebSocket](https://en.wikipedia.org/
144144
connection and starts to stream the data back and forth.
145145

146146
This implementation allows runtimes to have the flexibility to implement
147-
**Exec**, **Attach** and **PortForward** the way they want, and also allows a
147+
`Exec`, `Attach` and `PortForward` the way they want, and also allows a
148148
simple test path. Runtimes can change the underlying implementation to support
149149
any kind of feature without having a need to modify the CRI at all.
150150

@@ -253,7 +253,7 @@ func (s StreamService) Exec(
253253
}
254254
```
255255

256-
### **PortForward**
256+
### PortForward
257257

258258
Forwarding ports to a container works a bit differently when comparing it to
259259
streaming IO data from a workload. The server still has to provide a URL
@@ -292,8 +292,8 @@ func (s StreamService) PortForward(
292292

293293
## Future work
294294

295-
The flexibility Kubernetes provides for the RPCs **Exec**, **Attach** and
296-
**PortForward** is truly outstanding compared to other methods. Nevertheless,
295+
The flexibility Kubernetes provides for the RPCs `Exec`, `Attach` and
296+
`PortForward` is truly outstanding compared to other methods. Nevertheless,
297297
container runtimes have to keep up with the latest and greatest implementations
298298
to support those features in a meaningful way. The general effort to support
299299
WebSockets is not only a plain Kubernetes thing, it also has to be supported by

0 commit comments

Comments
 (0)