您好,登錄后才能下訂單哦!
1、環境介紹
2、安裝nexus
helm search repo nexus
helm? pull? stable/sonatype-nexus
tar? xvf? sonatype-nexus-1.21.2.tgz
helm? install? nexus? ./sonatype-nexus
kubectl? get? pod
kubectl describe pod nexus-sonatype-nexus-79b5865bbc-4lb49
從而得知在請求pvc,所以創建pv
vim??pv.yaml????#這里采用的hostpath apiVersion:?v1 kind:?PersistentVolume metadata: ??name:?nexus-pv spec: ??capacity: ????storage:?10Gi ??volumeMode:?Filesystem ??accessModes: ??-??ReadWriteOnce ??persistentVolumeReclaimPolicy:?Retain ??hostPath: ????path:?/helm/nexus
mkdir??-p??/helm/nexus???#在worker節點創建相應的目錄 kubecel??apply??-f?pv.yaml
查看pod狀態
kubectl get pod
kubectl?logs?nexus-sonatype-nexus-79b5865bbc-4lb49 #會報錯,是因為容器的名字重復“nexus?nexus-proxy” Error?from?server?(BadRequest):?a?container?name?must?be?specified?for?pod?nexus-sonatype-nexus-79b5865bbc-4lb49,?choose?one?of:?[nexus?nexus-proxy]
kubectl edit deploy nexus-sonatype-nexus? ?
修改nexus-proxy為nexus
再次查看pod狀態,還是有問題
kubectl?logs?nexus-sonatype-nexus-64c75f5786-gtvlg? Java?HotSpot(TM)?64-Bit?Server?VM?warning:?Cannot?open?file?/nexus-data/log/jvm.log?due?to?No?such?file?or?directory Warning:??Cannot?open?log?file:?/nexus-data/log/jvm.log Warning:??Forcing?option?-XX:LogFile=/tmp/jvm.log Unable?to?update?instance?pid:?Unable?to?create?directory?/nexus-data/instances /nexus-data/log/karaf.log?(No?such?file?or?directory) Unable?to?update?instance?pid:?Unable?to?create?directory?/nexus-data/instances
從而得知是目錄/nexus-data/instances沒有權限
kubectl get deploy nexus-sonatype-nexus -oyaml
是因為我們創建的pv沒有權限,在worker節點給與剛才創建pv的目錄777權限
chmod 777 /helm/nexus/
kubectl delete pod nexus-sonatype-nexus-64c75f5786-gtvlg?? #刪掉原來的pod
完美起來了。
kubectl get svc
然后會發現端口不通
telnet?192.18.10.12?30070 Trying?192.18.10.12... telnet:?connect?to?address?192.18.10.12:?Connection?refused
vim /root/nexus/sonatype-nexus/values.yaml
可以看到8080并不是nexus的真正端口,而真正的端口是
所以又要修改service文件
kubectl edit svc nexus-sonatype-nexus
再訪問即可進入
用戶名是admin,密碼是admin123
完美結束!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。