首页 > 解决方案 > 在 Azure 存储服务中挂载时如何更改文件夹或文件权限?

问题描述

请..等待您的认真回答。

我的开发环境是Azure cloud - Kubernetes ,我想在 Azure 的存储服务中安装 Gitlab Docker 镜像。

看下面的日志,Gitlab 启动并尝试更改 Azure 存储的权限,但 Azure 存储不允许这样做。

最终,Gitlab 无法启动。

我尝试在加载 Kubernetes 的 StorageClass、pv 和 pvc 时更改挂载选项,但无法应用。

请回答这个..

================================================================================
    Error executing action `create` on resource 'storage_directory[/var/opt/gitlab/.ssh]'
    ================================================================================
    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    ruby_block[directory resource: /var/opt/gitlab/.ssh] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb line 34) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
    ---- Begin output of chmod 00700 /var/opt/gitlab/.ssh ----
    STDOUT:
    STDERR: chmod: changing permissions of '/var/opt/gitlab/.ssh': Operation not permitted
    ---- End output of chmod 00700 /var/opt/gitlab/.ssh ----
    Ran chmod 00700 /var/opt/gitlab/.ssh returned 1
    Cookbook Trace:
    ---------------
    /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:35:in `run_command'
    /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:55:in `ensure_permissions_set'
    /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb:40:in `block (3 levels) in class_from_file'
    Resource Declaration:
    ---------------------
    # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-shell.rb
     34:   storage_directory dir do
     35:     owner git_user
     36:     group git_group
     37:     mode "0700"
     38:   end
     39: end
    Compiled Resource:
    ------------------
    # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-shell.rb:34:in `block in from_file'
    storage_directory("/var/opt/gitlab/.ssh") do
      action [:create]
      default_guard_interpreter :default
      declared_type :storage_directory
      cookbook_name "gitlab"
      recipe_name "gitlab-shell"
      owner "git"
      group "git"
      mode "0700"
      path "/var/opt/gitlab/.ssh"
    end
    System Info:
    ------------
    chef_version=14.14.29
    platform=ubuntu
    platform_version=16.04
    ruby=ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
    program_name=/opt/gitlab/embedded/bin/chef-client
    executable=/opt/gitlab/embedded/bin/chef-client
Running handlers:
There was an error running gitlab-ctl reconfigure:
storage_directory[/var/opt/gitlab/.ssh] (gitlab::gitlab-shell line 34) had an error: Mixlib::ShellOut::ShellCommandFailed: ruby_block[directory resource: /var/opt/gitlab/.ssh] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb line 34) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of chmod 00700 /var/opt/gitlab/.ssh ----
STDOUT:
STDERR: chmod: changing permissions of '/var/opt/gitlab/.ssh': Operation not permitted
---- End output of chmod 00700 /var/opt/gitlab/.ssh ----
Ran chmod 00700 /var/opt/gitlab/.ssh returned 1
Running handlers complete
Chef Client failed. 7 resources updated in 07 seconds

标签: azurekubernetesgitlab

解决方案


推荐阅读