CB9F63BADB92017733C80DE1808370DC.jpg

PersistentVolumeClaim

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: nexus-pvc
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: "100Gi"
  volumeName: 
  storageClassName: nfs

deployment

kind: Deployment
apiVersion: apps/v1
metadata:
  labels:
    app: repo-nexus
  name: repo-nexus
  namespace: test
spec:
  replicas: 1
  selector:
    matchLabels:
      app: repo-nexus
  template:
    metadata:
      labels:
        app: repo-nexus
    spec:
      containers:
        - name: repo-nexus
          image: sonatype/nexus3:latest
          imagePullPolicy: IfNotPresent
          resources:
            limits:
              memory: "4Gi"
              cpu: "1000m"
            requests:
              memory: "2Gi"
              cpu: "500m"
          ports:
          - containerPort: 8081
            protocol: TCP
          volumeMounts:
          - name: repo-nexus-data
            mountPath: /nexus-data
      volumes:
        - name: repo-nexus-data
          persistentVolumeClaim:
            claimName: nexus-pvc

Service

kind: Service
apiVersion: v1
metadata:
  name: repo-nexus
spec:
  type: NodePort
  ports:
  - name: repo-nexus
    port: 8081
    nodePort: 30002
    targetPort: 8081
    protocol: TCP
  selector:
    app: repo-nexus

默认用户名admin 密码 admin123

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code