kuzilala 2020-01-24
nexus3是一个统一的仓库系统,可以作为nuget、docker、maven、npm等的仓库,可以使用一个平台管理。
apiVersion: v1 kind: PersistentVolume metadata: name: nexus-data spec: capacity: storage: 5Gi volumeMode: Filesystem accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain storageClassName: nfs nfs: path: /var/nfs/nexus-data server: 192.168.0.250 --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: nexus-data-pvc spec: accessModes: - ReadWriteOnce volumeMode: Filesystem resources: requests: storage: 5Gi storageClassName: nfs --- apiVersion: apps/v1 kind: Deployment metadata: name: nexus-deployment spec: replicas: 1 selector: matchLabels: app: nexus template: metadata: labels: app: nexus spec: containers: - name: nexus image: sonatype/nexus3 ports: - containerPort: 8081 - containerPort: 8082 - containerPort: 8083 volumeMounts: - mountPath: /nexus-data name: nexus-data volumes: - name: nexus-data persistentVolumeClaim: claimName: nexus-data-pvc --- apiVersion: v1 kind: Service metadata: name: nexus-svc spec: selector: app: nexus type: NodePort ports: - name: web protocol: TCP port: 8081 targetPort: 8081 nodePort: 30081 - name: docker protocol: TCP port: 8082 targetPort: 8082 nodePort: 30082 - name: maven protocol: TCP port: 8083 targetPort: 8083 nodePort: 30083