簡體   English   中英

Kubernetes 上 azure

[英]Kubernetes on azure

我在 azure 上使用 Kubernetes 並且我的架構作為圖像附加。

我可以使用 azure 文件創建一個持久卷,並使用持久卷聲明將它附加到我的 pod。

我的問題是:

正如您在圖像上看到的,azure 文件上有文件和目錄,我需要對這些文件/目錄設置特殊權限

例如

  • 帶有 (rw--) 的 notes.txt
  • user1 是目錄數據的所有者
  • user2 成為工具的所有者
  • 在工具格式中具有權限(rwx-rw-r)和統計信息(rwx-rr)

我詢問了這個特性,它沒有在 azure 文件上實現。 你能建議任何其他解決方案嗎?

先感謝您。

問候,

哈吉姆

在此處輸入圖像描述

您可以使用 kubernetes 安全上下文來配置對安裝的訪問。 檢查此鏈接https://kubernetes.io/docs/tasks/configure-pod-container/security-context/

引用文檔:

由於指定了 fsGroup 字段,容器的所有進程也是補充組 ID 2000 的一部分。卷 /data/demo 的所有者以及在該卷中創建的任何文件都將是組 ID 2000。

apiVersion: v1
kind: Pod
metadata:
  name: security-context-demo
spec:
  securityContext:
    runAsUser: 1000
    runAsGroup: 3000
    fsGroup: 2000
  volumes:
  - name: sec-ctx-vol
    emptyDir: {}
  containers:
  - name: sec-ctx-demo
    image: busybox
    command: [ "sh", "-c", "sleep 1h" ]
    volumeMounts:
    - name: sec-ctx-vol
      mountPath: /data/demo
    securityContext:
      allowPrivilegeEscalation: false

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM