<p>I am trying to do a fairly simple red/green setup using Minikube where I want 1 pod running a red container and 1 pod running a green container and a service to hit each. To do this my k82 file is like...</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: main-volume
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 2Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: &quot;/Users/jackiegleason/data&quot;
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: main-volume-claim
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: express-app
  name: express-service-red
spec:
  type: LoadBalancer
  ports:
    - port: 3000
  selector:
    app: express-app-red
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: express-app
  name: express-service-green
spec:
  type: LoadBalancer
  ports:
    - port: 3000
  selector:
    app: express-app-green
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: express-app-deployment-red
  labels:
    app: express-app-red
    tier: app
spec:
  replicas: 1
  selector:
    matchLabels:
      tier: app
  template:
    metadata:
      labels:
        app: express-app-red
        tier: app
    spec:
      volumes:
        - name: express-app-storage
          persistentVolumeClaim:
            claimName: main-volume-claim
      containers:
        - name: express-app-container
          image: partyk1d24/hello-express:latest
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - mountPath: &quot;/var/external&quot;
              name: express-app-storage
          ports:
            - containerPort: 3000
              protocol: TCP
              name: express-endpnt
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: express-app-deployment-green
  labels:
    app: express-app-green
    tier: app
spec:
  replicas: 1
  selector:
    matchLabels:
      tier: app
  template:
    metadata:
      labels:
        app: express-app-green
        tier: app
    spec:
      volumes:
        - name: express-app-storage
          persistentVolumeClaim:
            claimName: main-volume-claim
      containers:
        - name: express-app-container
          image: partyk1d24/hello-express:latest
          imagePullPolicy: IfNotPresent
          env:
            - name: DEPLOY_TYPE
              value: &quot;Green&quot;
          volumeMounts:
            - mountPath: &quot;/var/external&quot;
              name: express-app-storage
          ports:
              - containerPort: 3000
                protocol: TCP
                name: express-endpnt
</code></pre>
<p>But when I run I get...</p>
<blockquote>
<p>0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.</p>
</blockquote>
<p>What am I missing? It worked fine without the second deployment so what am I missing?</p>
<p>Thank you!</p>

Jackie
<p>You cannot use the same a PV with <code>accessMode: ReadWriteOnce</code> multiple times.</p>
<p>To do this you would need to use a volume that supports ReadWriteMany access mode.
Check out k8s documentation for <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes" rel="nofollow noreferrer">the list of Volume Plugins</a> that support this feature.</p>
<p>Additionally, as David already menioned, it's much better to log to the STDOUT.</p>
<p>You can also check solutions like <a href="https://fluentbit.io/" rel="nofollow noreferrer">FluentBit</a>/<a href="https://www.fluentd.org/" rel="nofollow noreferrer">fluentd</a> or <a href="https://www.elastic.co/what-is/elk-stack" rel="nofollow noreferrer">ELK stack</a>.</p>
