我正在实现对使用双向挂载传播的CSIDriver的支持。这要求容器为特权,但是在这个项目中,我们不允许使用特权容器。
还有别的办法吗?我尝试过使用SYS_ADMIN功能,但它没有起作用。
- name: spiffe-csi-driver
image: ghcr.io/spiffe/spiffe-csi-driver:0.1.0
imagePullPolicy: IfNotPresent
args: [
"-workload-api-socket-dir", "/spire-agent-socket",
"-csi-socket-path", "/spiffe-csi/csi.sock",
]
env:
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- mountPath: /spire-agent-socket
name: spire-agent-socket
readOnly: true
- mountPath: /spiffe-csi
name: spiffe-csi-socket-dir
# The volume containing mount points for containers.
- mountPath: /var/lib/kubelet/pods
mountPropagation: Bidirectional
name: mountpoint-dir
securityContext:
privileged: true # need to remove
# capabilities: # this didn't work
# add:
# - SYS_ADMIN发布于 2022-05-04 02:13:48
据K8s 正式文件说
它只允许在特权容器中使用。
https://stackoverflow.com/questions/72101275
复制相似问题