I have a kubernetes cluster running on coreos. I wish to run journal2gelf https://github.com/systemd/journal2gelf in a container in a pod I call logging. (I also have a fluentd container in this pod, which works great, I highly recommend it for streaming logs elsewhere). Is it possible to configure a pod to allow essentially this:
journalctl -o json -f | docker run <my journal2gelf image> -d -p $GRAYLOG_PORT
but within the containers:
key in a replication controller config? And in general can kubernetes allow piping to a container?
Within a Pod, containers share an IP address and port space, and can find each other via localhost . The containers in a Pod can also communicate with each other using standard inter-process communications like SystemV semaphores or POSIX shared memory.
Kubernetes assumes that pods can communicate with other pods, regardless of which host they land on. Kubernetes gives every pod its own cluster-private IP address, so you do not need to explicitly create links between pods or map container ports to host ports.
Containers in a Pod share the same IPC namespace, which means they can also communicate with each other using standard inter-process communications such as SystemV semaphores or POSIX shared memory. Containers use the strategy of the localhost hostname for communication within a Pod.
This will let you send stdin to a container:
kubectl exec -i POD_NAME COMMAND
Or
kubectl attach -i POD_NAME
But there isn't a good way to define to stdin sent to all containers in a pod, or all containers spawned by a replication controller
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With