apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: nexus
  name: nexus
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nexus
  strategy:
    type: Recreate 
  template:
    metadata:
      labels:
        app: nexus 
    spec:
      containers:
      - image: sonatype/nexus3
        imagePullPolicy: Always
        name: nexus
        ports:
        - containerPort: 8081
          name: nexus-port
          protocol: TCP
        - containerPort: 5000
          name: docker-port
          protocol: TCP
        stdin: true
        tty: true
        volumeMounts:
        - mountPath: /nexus-data
          name: nexus-data
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      securityContext:
        runAsUser: 1000
        fsGroup: 1000
      terminationGracePeriodSeconds: 30
      volumes:
      - name: nexus-data
        persistentVolumeClaim:
          claimName: nexus-data

