apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nexus-pvc
namespace: nexus
labels:
pvc: nexus-pvc
spec:
storageClassName: nfs-client
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: nexus3
labels:
app: nexus3
namespace: nexus
spec:
replicas: 1
selector:
matchLabels:
app: nexus3
template:
metadata:
labels:
app: nexus3
spec:
containers:
- name: nexus3
image: sonatype/nexus3:3.42.0
ports:
- name: nexus3-8081
containerPort: 8081
protocol: TCP
resources:
limits:
memory: 6G
cpu: 1000m
imagePullPolicy: IfNotPresent
volumeMounts:
- name: data
mountPath: /nexus-data
restartPolicy: Always
volumes:
- name: data
persistentVolumeClaim:
claimName: nexus-pvc
readOnly: false
---
kind: Service
apiVersion: v1
metadata:
name: nexus3
namespace: nexus
labels:
app: nexus3
spec:
type: NodePort
ports:
- port: 8081
targetPort: 8081
nodePort: 30520
selector:
app: nexus3