I am running OpenShift Local on Windows 11 and am trying to mount the "/nexus-data" container folder to the "C:/_Data/nexus" folder on my host machine. I am still new to OpenShift and the closest I get are no errors inside my pvc or pv but I am still getting permission denied errors when the containers try to write data into the "/nexus-data" folder:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nexus-deployment
namespace: john-local
labels:
app: nexus
spec:
replicas: 1
selector:
matchLabels:
app: nexus
template:
metadata:
labels:
app: nexus
deployment: nexus-deployment
spec:
containers:
- name: nexus-server
image: sonatype/nexus3
ports:
- containerPort: 8081
volumeMounts:
- name: nexus-storage
mountPath: /nexus-data
volumes:
- name: nexus-storage
persistentVolumeClaim:
claimName: nexus-persistent-volume-claim
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: nexus-persistent-volume
spec:
capacity:
storage: 10Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
storageClassName: local-storage-class
local:
path: 'C:\_Data\nexus'
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- worker-0
- worker-1
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nexus-persistent-volume-claim
namespace: john-local
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-storage-class
resources:
requests:
storage: 10Gi
apiVersion: v1
kind: Service
metadata:
name: nexus-service
namespace: john-local
labels:
app: nexus
spec:
ports:
- name: nexus-port
port: 8081
targetPort: 8081
internalTrafficPolicy: Cluster
type: ClusterIP
ipFamilyPolicy: SingleStack
selector:
app: nexus
deployment: nexus-deployment
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: nexus-route
namespace: john-local
labels:
app: nexus
spec:
host: nexus-john-local.apps-crc.testing
to:
kind: Service
name: nexus-service
weight: 100
port:
targetPort: nexus-port
wildcardPolicy: None
What am I missing?