2017-10-25 20 views
0

Google 컨테이너 엔진에서 nexus3을 실행하고 싶습니다. GKE : Nexus 디스크에 쓸 수 없음

은 내가 영구 디스크를 만든 다음 배포 파일을 구성 : 배포는이 문제와 함께 실패

apiVersion: apps/v1beta1 
kind: Deployment 
metadata: 
    name: nexus3 
    labels: 
    app: nexus3 
spec: 
    replicas: 1 
    selector: 
    matchLabels: 
     app: nexus3 
    template: 
    metadata: 
     labels: 
     app: nexus3 
     tier: web 
    spec: 
     containers: 
     - image: gcr.io/nexustest-182520/nexus3:3.6.0 
     name: nexus3 
     volumeMounts: 
     - mountPath: /nexus-data 
      name: nexus3-persistent-storage 
     ports: 
     - containerPort: 8081 
     volumes: 
     - name: nexus3-persistent-storage 
     gcePersistentDisk: 
      pdName: nexus3-disk 
      fsType: ext4 

:

kubectl get pods -o=wide 
NAME      READY  STATUS RESTARTS AGE  IP   NODE 
nexus3-1260341461-mj7rf 0/1  Error  2   36s  x.x.x.x gke-nexus-cluster-default-pool-9a58e4f2-p1t9 


kubectl describe po/nexus3-1260341461-mj7rf 
[...] 
Events: 
    FirstSeen LastSeen Count From       SubObjectPath  Type  Reason   Message 
    --------- -------- ----- ----       -------------  -------- ------   ------- 
    1m  1m  1 default-scheduler        Normal  Scheduled  Successfully assigned nexus3-1260341461-mj7rf to gke-nexus-cluster-default-pool-9a58e4f2-p1t9 
    1m  1m  1 kubelet, gke-nexus-cluster-default-pool-9a58e4f2-p1t9    Normal  SuccessfulMountVolume MountVolume.SetUp succeeded for volume "default-token-gsnbn" 
    1m  1m  1 kubelet, gke-nexus-cluster-default-pool-9a58e4f2-p1t9    Normal  SuccessfulMountVolume MountVolume.SetUp succeeded for volume "nexus3-persistent-storage" 
    1m  12s  4 kubelet, gke-nexus-cluster-default-pool-9a58e4f2-p1t9 spec.containers{nexus3} Normal  Pulled   Container image "gcr.io/nexustest-182520/nexus3:3.6.0" already present on machine 
    1m  12s  4 kubelet, gke-nexus-cluster-default-pool-9a58e4f2-p1t9 spec.containers{nexus3} Normal  Created   Created container 
    1m  12s  4 kubelet, gke-nexus-cluster-default-pool-9a58e4f2-p1t9 spec.containers{nexus3} Normal  Started   Started container 
    56s  8s  4 kubelet, gke-nexus-cluster-default-pool-9a58e4f2-p1t9 spec.containers{nexus3} Warning  BackOff   Back-off restarting failed container 
    56s  8s  4 kubelet, gke-nexus-cluster-default-pool-9a58e4f2-p1t9    Warning  FailedSync  Error syncing pod 

나는 넥서스 자체가 시작할 수 없기 때문에 다시 시작이 생기는 일이라고 생각 . 나는 로그이 발견 :

mkdir: cannot create directory '../sonatype-work/nexus3/log': Permission denied 

Unable to update instance pid: Unable to create directory /nexus-data/instances 

내 실수 어디에 있습니까? 넥서스가 디스크와 폴더에 쓸 수있게하려면 무엇을해야합니까?

최저

, 라스

답변

2

글쎄, 내가 직접 질문을 만든 후 그것을 자신을 해결했다. :)

https://github.com/sonatype/docker-nexus3에 대해서는 응용 프로그램이 다른 pid에서 루트로 실행됩니다.

spec: 
    securityContext: 
    fsGroup: 200 
+0

이 영구 볼륨과 같은 오류 메시지와 함께 AWS에 nexus3를 설치 나를 도와 : 배포 파일이 추가

트릭을했다. – monty0