volumeMounts reversing


#1

I have an interesting problem or not… The below manifest works when I deploy it except for an intermittent issue which I cannot explain. The same issue is also happening intermittently with similar manifests I have for other applications. I have two volumeMounts, media and config. You can see below media maps to /media and config maps to /config. When I deploy this, the config mountPath winds up being /movies and the media mountPath winds up being /config which is totally reversed from what I specify in manifest. Since mountPaths are incorrect, the pods have mixed up mounts and cannot use the data designed for that mount. My workaround has been to delete the deployment, and intentionally make the manifest incorrect by switching volumeMount names so /config = media and /movies = config. Am I doing something stupid here that I’m not picking up on? As I said, it’s intermittent and there are times the volumeMounts are working exactly as written in the manifest which leads me to believe that it may be a problem outside manifest and with kubernetes itself. I’m running v1.11.2. Any insight would be welcomed.

apiVersion: apps/v1
kind: Deployment
metadata:
    name: radarr
    labels:
      app: radarr
spec:
  replicas: 1
  selector:
    matchLabels:
      app: radarr
  template:
    metadata:
      name: radarr
      labels:
        app: radarr
    spec:
      containers:
      - image: linuxserver/radarr:latest
        name: radarr
        env:
        - name: TZ
          value: "America/New York"
        - name: PUID
          value: "65534"
        - name: PGID
          value: "65534"
        ports:
          - containerPort: 7878
            protocol: TCP
        volumeMounts:
          - mountPath: "/config"
            name: config
          - mountPath: "/movies"
            name: media
      volumes:
        - name: media
          persistentVolumeClaim:
            claimName: nfs-mercury-media-radarr
        - name: config
          persistentVolumeClaim:
            claimName: nfs-mercury-config-radarr
      restartPolicy: Always
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: nfs-mercury-config-radarr
spec:
  capacity:
    storage: 1000Gi
  accessModes:
    - ReadOnlyMany
  mountOptions:
    - hard
    - vers=3
  nfs:
    server: 192.168.1.111
    path: "/volume1/nas_share/docker/images/media/radarr/config"
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: nfs-mercury-media-radarr
spec:
  capacity:
    storage: 1000Gi
  accessModes:
    - ReadOnlyMany
  mountOptions:
    - hard
    - vers=3
  nfs:
    server: 192.168.1.149
    path: "/volume1/media/movies"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: nfs-mercury-media-radarr
spec:
  accessModes:
    - ReadOnlyMany
  storageClassName: ""
  resources:
    requests:
      storage: 1000Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: nfs-mercury-config-radarr
spec:
  accessModes:
    - ReadOnlyMany
  storageClassName: ""
  resources:
    requests:
      storage: 1000Gi
---
apiVersion: v1
kind: Service
metadata:
  name: radarr-service
spec:
  selector:
    app: radarr
  type: NodePort
  ports:
  - name: radarr
    port: 7878
    targetPort: 7878
    nodePort: 32402
    protocol: TCP