While reading the "Kubernetes in Action" book I saw the following excerpt (p. 124):
Listing 5.2 Enabling standard input for a container
apiVersion: v1
kind: Pod
metadata:
name: kiada-stdin
spec:
containers:
- name: kiada
image: luksa/kiada:0.2
stdin: true
ports:
- containerPort: 8080
As you can see in the listing, if the application running in a pod wants to read from standard input, you must indicate this in the pod manifest by setting the stdin field in the container definition to true. This tells Kubernetes to allocate a buffer for the standard input stream, otherwise, the application will always receive an EOF when it tries to read from it.
The last sentence confuses me. What does it mean to "allocate a buffer for the standard input"? I tried to look for some clues, but I only see some things related to C programming, which I do not have much idea about and have hard time understanding the concept.
Could someone explain it in a more "language-agnostic" way? What is that buffer? What is EOF?
As far as I know, every (?) Linux process is given three files:
- stdin
- stdout
- stderr
The process can write to the last two, and it can read the first one.