Kubernetes中的Pod可以查看/访问在同一Pod中运行的其他容器的进程吗? [英] Can pods in Kubernetes see/access the processes of other containers running in the same pod?

查看:1121
本文介绍了Kubernetes中的Pod可以查看/访问在同一Pod中运行的其他容器的进程吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此页面上的Kubernetes文档豆荚,它指出

On this page in the Kubernetes docs Pods, it states

pod的上下文可以定义为几个Linux名称空间的结合:

The context of the pod can be defined as the conjunction of several Linux namespaces:

PID名称空间(窗格中的应用程序可以看到彼此的进程) 网络名称空间(pod中的应用程序可以访问相同的IP和端口空间)

PID namespace (applications within the pod can see each other's processes) network namespace (applications within the pod have access to the same IP and port space)

IPC名称空间(pod中的应用程序可以使用SystemV IPC或POSIX消息队列进行通信)

IPC namespace (applications within the pod can use SystemV IPC or POSIX message queues to communicate)

UTS名称空间(pod中的应用程序共享一个主机名)

UTS namespace (applications within the pod share a hostname)

但是,它接着说

就Docker结构而言,一个容器由一组共享容器的Docker容器组成,这些容器位于同一位置.尚未使用Docker实现PID名称空间共享.

In terms of Docker constructs, a pod consists of a colocated group of Docker containers with shared volumes. PID namespace sharing is not yet implemented with Docker.

那么这是否意味着Pod无法看到其他容器中的进程,也不能在同一Pod中运行的容器之间执行任何类型的IPC?如何将信号发送到另一个Pod中运行的进程?

So does this mean that pods cannot see processes in other containers or perform any kind of IPC between containers running in the same pod? How would I send a signal to a process running in another pod?

推荐答案

是的,我们希望他们可以共享PID名称空间,但是正如您所说的,Docker当前不支持它.在Docker中获得支持后,我们将迅速将其添加到Kubernetes.

Yeah, we wish that they could share the PID namespace, but as you say, it is not currently supported by Docker. Once we have support in Docker, we will rapidly add it to Kubernetes.

这意味着您不能使用信号来通知Pod中的其他进程.

This means that you can't use signal to signal other processes in the Pod.

但是,您可以使用IPC机制,例如管道和共享内存.

You can, however, use IPC mechanisms like pipes and shared memory.

这篇关于Kubernetes中的Pod可以查看/访问在同一Pod中运行的其他容器的进程吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆