aks pod 无法授予目录权限 (chown)

aks pod can't give permission (chown) to a directory

你好,我希望大家一切都好, 我在 azure kubernetes 服务 aks

中遇到问题

我将我在 kubernetes 集群中 运行 的项目部署到 aks

我使用 ArgoCD 构建项目 argocd

这是 pod 的日志:

Failed to start Standalone CDAP
2021-10-21 15:33:35,031 - ERROR [main:i.c.c.StandaloneMain@446] - Failed to start Standalone CDAP
com.google.common.util.concurrent.UncheckedExecutionException: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.RuntimeException: Error applying authorization policy on hive configuration: ExitCodeException exitCode=1: chmod: changing permissions of '/opt/cdap/sandbox-6.2.3/data/explore/tmp/cdap/06667586-7b60-43cc-bd13-5a5136b601fc': Operation not permitted

        at com.google.common.util.concurrent.Futures.wrapAndThrowUnchecked(Futures.java:1015)
        at com.google.common.util.concurrent.Futures.getUnchecked(Futures.java:1001)
        at com.google.common.util.concurrent.AbstractService.startAndWait(AbstractService.java:220)
        at com.google.common.util.concurrent.AbstractIdleService.startAndWait(AbstractIdleService.java:106)
        at io.cdap.cdap.StandaloneMain.startUp(StandaloneMain.java:300)
        at io.cdap.cdap.StandaloneMain.doMain(StandaloneMain.java:436)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at io.cdap.cdap.StandaloneMain.main(StandaloneMain.java:418)
Caused by: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.RuntimeException: Error applying authorization policy on hive configuration: ExitCodeException exitCode=1: chmod: changing permissions of '/opt/cdap/sandbox-6.2.3/data/explore/tmp/cdap/06667586-7b60-43cc-bd13-5a5136b601fc': Operation not permitted

        at com.google.common.util.concurrent.Futures.wrapAndThrowUnchecked(Futures.java:1015)
        at com.google.common.util.concurrent.Futures.getUnchecked(Futures.java:1001)
        at com.google.common.util.concurrent.AbstractService.startAndWait(AbstractService.java:220)
        at com.google.common.util.concurrent.AbstractIdleService.startAndWait(AbstractIdleService.java:106)
        at io.cdap.cdap.explore.executor.ExploreExecutorService.startUp(ExploreExecutorService.java:99)
        at com.google.common.util.concurrent.AbstractIdleService.run(AbstractIdleService.java:43)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: Error applying authorization policy on hive configuration: ExitCodeException exitCode=1: chmod: changing permissions of '/opt/cdap/sandbox-6.2.3/data/explore/tmp/cdap/06667586-7b60-43cc-bd13-5a5136b601fc': Operation not permitted

        at org.apache.hive.service.cli.CLIService.init(CLIService.java:114)
        at io.cdap.cdap.explore.service.hive.BaseHiveExploreService.startUp(BaseHiveExploreService.java:309)
        at io.cdap.cdap.explore.service.hive.Hive14ExploreService.startUp(Hive14ExploreService.java:76)
        ... 2 more
Caused by: java.lang.RuntimeException: ExitCodeException exitCode=1: chmod: changing permissions of '/opt/cdap/sandbox-6.2.3/data/explore/tmp/cdap/06667586-7b60-43cc-bd13-5a5136b601fc': Operation not permitted

        at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:522)
        at org.apache.hive.service.cli.CLIService.applyAuthorizationConfigPolicy(CLIService.java:127)
        at org.apache.hive.service.cli.CLIService.init(CLIService.java:112)
        ... 4 more
Caused by: ExitCodeException exitCode=1: chmod: changing permissions of '/opt/cdap/sandbox-6.2.3/data/explore/tmp/cdap/06667586-7b60-43cc-bd13-5a5136b601fc': Operation not permitted

        at org.apache.hadoop.util.Shell.runCommand(Shell.java:972)
        at org.apache.hadoop.util.Shell.run(Shell.java:869)
        at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:1170)
        at org.apache.hadoop.util.Shell.execCommand(Shell.java:1264)
        at org.apache.hadoop.util.Shell.execCommand(Shell.java:1246)
        at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem.java:771)
        at org.apache.hadoop.fs.RawLocalFileSystem.mkOneDirWithMode(RawLocalFileSystem.java:515)
        at org.apache.hadoop.fs.RawLocalFileSystem.mkdirsWithOptionalPermission(RawLocalFileSystem.java:555)
        at org.apache.hadoop.fs.RawLocalFileSystem.mkdirs(RawLocalFileSystem.java:533)
        at org.apache.hadoop.fs.FilterFileSystem.mkdirs(FilterFileSystem.java:313)
        at org.apache.hadoop.hive.ql.session.SessionState.createPath(SessionState.java:639)
        at org.apache.hadoop.hive.ql.session.SessionState.createSessionDirs(SessionState.java:574)
        at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:508)
        ... 6 more

我使用 azurefile 作为我的默认存储 class。

pod 无法 chmod 目录,

我发现 aks 存储 class 没有 ext4 这是我的存储空间 class

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: wp-storage
  uid: a4251a1d-98aa-4e1d-a832-1caa82a7fc72
  resourceVersion: '570443'
  creationTimestamp: '2021-10-22T08:52:39Z'
  annotations:
    storageclass.kubernetes.io/is-default-class: 'true'
  managedFields:
    - manager: Mozilla
      operation: Update
      apiVersion: storage.k8s.io/v1
      time: '2021-10-22T08:52:39Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:mountOptions: {}
        f:parameters:
          .: {}
          f:skuName: {}
        f:provisioner: {}
        f:reclaimPolicy: {}
        f:volumeBindingMode: {}
    - manager: kubectl-patch
      operation: Update
      apiVersion: storage.k8s.io/v1
      time: '2021-10-22T08:55:06Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:annotations:
            .: {}
            f:storageclass.kubernetes.io/is-default-class: {}
provisioner: kubernetes.io/azure-file
parameters:
  skuName: Standard_LRS
reclaimPolicy: Delete
mountOptions:
  - dir_mode=0777
  - file_mode=0777
  - uid=1000
  - gid=1000
volumeBindingMode: Immediate

我看了看如何改变这个但没有运气 我希望有人可以帮助我或指导我正确的方向。

祝你有美好的一天。

经过大量测试后,我更改了存储 class 我安装了 rook-ceph 使用:this procedure 注意: 您必须将 cluster.yaml 中的图像版本从 ceph/ceph:v14.​​2.4 更改为 ceph/ceph:v16