pgAdmin 的 Kubernetes statefulset 中的 ACL 权限

ACL permissions in Kubernetes statefulset for pgAdmin

我正在按照本教程在 kubernetes 集群中部署 pgAdmin: https://www.enterprisedb.com/blog/how-deploy-pgadmin-kubernetes

大部分情况下都有效,但我收到关于卷的 acl 权限的错误:

WARNING: Failed to set ACL on the directory containing the configuration database:
[Errno 1] Operation not permitted: '/var/lib/pgadmin'
HINT   : You may need to manually set the permissions on
         /var/lib/pgadmin to allow pgadmin to write to it.

由于之前在statefulset中看到一些类似的错误,将securityContext调整为:

   spec:
     securityContext:
      runAsUser: 5050
      runAsGroup: 5050
      fsGroup: 5050
     containers:
       ...

有些问题已经解决了,但上面的没有。在 pgAdmin 文档中,我只能找到如何通过在文件夹上使用 chmod 来解决这个问题,但我希望 yml 文件中的这些权限可以稳定部署。

如何在我的配置文件中执行此操作?

在 kubernetes 集群中,教程似乎有多个缺陷:ACL 权限可能会失败,这可以通过 initContainer 处理,并且命名空间必须适合。之后,它就像一个魅力。