问题标签 [podsecuritypolicy]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
102 浏览

kubernetes - why does my Openldap container keeps crashing due to pod security policy

I have successfully created a PodSecurityPolicy, CluserRole and a ClusterRoleBinding on GKE. I am now trying to use OpenLDap from here. Without my PodSecurityPolicy installed on the k8s cluster, the helm installation of this OpenLDap works fine.

However when i install the PSP, and i try to install the OpenLDap, i the container stays in a CrashLoopBackOff state.

I am aware than openldap requires connection to ldapPort: and 389 sslLdapPort: 636 and i am aware that those are privileged ports. I already tried changing my just the privileged setting in the psp yaml to true, that did not work.

PodSecurityPolicy yaml

ClusterRole

ClusterRoleBinding

when i do a describe on the openldap pod, i get Back-off restarting failed container what could i be doing wrong here thats stopping the openldap to run.

0 投票
0 回答
59 浏览

kubernetes - hostNetwork 设置为 false 不允许复制到 hostPath

理论上我已经通过hostNetwork了 Kubernetes 提供的定义。对于以下 pod 规格

并尝试写入文件

但这在我设置时有效hostNetwork:true

我能得到一些关于这实际上是如何工作的以及为什么需要 hostNetwork 的信息。

0 投票
1 回答
76 浏览

kubernetes - 如何使用 'kubectl auth can-i ... psp' 在命名空间中检查 podsecuritypolicy 的“使用”是否被授权?

返回以下错误:

当我执行时:

我已经有podsecuritypolicy(psp.yaml)、role(role.yaml) 和rolebinding(rb.yaml) 的以下清单并部署在 namespace 中mytest1

psp.yaml

角色.yaml

和 rb.yaml

我希望返回yesno检查kubectl auth can-i ...而不是上述错误。验证检查的用例是否正确?我很欣赏他的指正。

0 投票
0 回答
123 浏览

kubernetes - dpdk-devbind 在 pod 容器中执行失败

我正在尝试将 vfio-pci 驱动程序绑定到 k8s pod 容器中的 sriov vfs,但打印错误

但是 dpdk-devbind.py 可以在另一个创建的 docker 容器中工作"docker run --privileged ",我认为这可能是PodSecurityPolicy问题所在。
在我创建 PodSecurityPolicy 之后"privileged: true, readOnlyRootFilesystem: false",问题仍然存在,我很困惑。

为什么 dpdk-devbind.py 不能在具有特权的 k8s pod 容器中工作?
我应该将绑定操作移至主机吗?但是一些在容器中运行的应用程序确实想要选择 sriov VF 并绑定 vfio-pci 驱动程序。

此外,KNI不能很好地工作。

更新:insmod rte_kni.ko carrier=on,然后注释代码rte_kni_update_link()可以修复 KNI 问题

更新:根据Kubernetes 卷未挂载,使用initContainers挂载主机/sys到 pod /sys rw,现在 dpdk-devbind.py 可以工作了。

非常感谢!

0 投票
2 回答
113 浏览

kubernetes - 为什么我不能配置 POD 级别的 securityContext 设置以应用于所有底层容器?

在我的 POD 中,我想将所有容器限制为具有 securityContext: readOnlyRootFilesystem: true
示例的只读文件系统(注意:为简洁起见,yaml 已减少)

这将导致:

错误:验证“server123.yaml”时出错:验证数据时出错:ValidationError(Pod.spec.securityContext):io.k8s.api.core.v1.PodSecurityContext中的未知字段“readOnlyRootFilesystem”;如果您选择忽略这些错误,请使用 --validate=false 关闭验证

相反,我必须配置为:

有没有办法为所有容器设置一次这个安全限制?如果不是为什么不呢?