2016-10-13 49 views

回答

0

我正在使用Kubernetes 1.4,併成功創建了一個fsGroup的作業。也許你在清單中放錯了fsGroup?這是我的清單:

apiVersion: batch/v1 
kind: Job 
metadata: 
    name: hello-world 
spec: 
    template: 
    metadata: 
     name: hello-world 
    spec: 
     containers: 
     - name: hello-world-container 
      image: hello-world 
     securityContext: 
     fsGroup: 1234 
     restartPolicy: OnFailure 

輸出kubectl describe job hello-world

FirstSeen LastSeen Count From   SubobjectPath Type  Reason   Message 
    --------- -------- ----- ----   ------------- -------- ------   ------- 
    4m  4m  1 {job-controller }   Normal  SuccessfulCreate Created pod: hello-world-yzyz7 

輸出kubectl get pod hello-world-yzyz7 -o yaml | grep fsGroup

fsGroup: 1234 
+0

你是一個生命的救星!我把fsGroup標籤放在了錯誤的地方!非常感謝。這是正確的答案。 –

+0

@JeffMcCormick如果這對你有幫助,你可以標記答案有幫助嗎?我會非常感謝。 –