# How to manually assign pvcs in the node wise pods in kubernets?

**URL:** <https://discuss.kubernetes.io/t/how-to-manually-assign-pvcs-in-the-node-wise-pods-in-kubernets/31924>\
**Category:** General Discussions\
**Tags:** minikube\
**Created:** [March 21, 2025, 6:32am UTC](https://discuss.kubernetes.io/t/how-to-manually-assign-pvcs-in-the-node-wise-pods-in-kubernets/31924 "2025-03-21T06:32:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![om\_makwana1](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/om_makwana1/32/17061_2.png) [@om\_makwana1](https://discuss.kubernetes.io/u/om_makwana1)\
**Post date:** [March 21, 2025, 6:32am UTC](https://discuss.kubernetes.io/t/how-to-manually-assign-pvcs-in-the-node-wise-pods-in-kubernets/31924/1 "2025-03-21T06:32:10Z")

</div>

So i try to set the manually assign Pvcs in the node wise Pods in kubernets So i have one Statefulset with 2 replicas and 2 PVCs The code is like this

```auto
      apiVersion: v1
      kind: PersistentVolumeClaim
      metadata:
        name: busybox-pvc-0
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi
        storageClassName: standard # Change this if needed

      ---
      apiVersion: v1
      kind: PersistentVolumeClaim
      metadata:
        name: busybox-pvc-1
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi
        storageClassName: standard # Change this if needed
      ---
      apiVersion: apps/v1
      kind: StatefulSet
      metadata:
        name: busybox
      spec:
        serviceName: "busybox"
        replicas: 2
        selector:
          matchLabels:
            app: busybox
        template:
          metadata:
            labels:
              app: busybox
          spec:
            containers:
              - name: busybox
                image: busybox
                command: ["/bin/sh", "-c", "sleep 3600"]
                volumeMounts:
                  - name: busybox-storage-0
                    mountPath: /data0
                  - name: busybox-storage-1
                    mountPath: /data1
            affinity:
              nodeAffinity:
                requiredDuringSchedulingIgnoredDuringExecution:
                  nodeSelectorTerms:
                    - matchExpressions:
                        - key: kubernetes.io/hostname
                          operator: In
                          values:
                            - minikube
                            - minikube-m02
            volumes:
              - name: busybox-storage-0
                persistentVolumeClaim:
                  claimName: busybox-pvc-0
              - name: busybox-storage-1
                persistentVolumeClaim:
                  claimName: busybox-pvc-1

```

So i try to do this code and see the reaction of this code the Output is

busybox-0 → minikube → busybox-pvc-0 , busybox-pvc-1 ,  
busybox-1 → minikube-m02 → busybox-pvc-0 , busybox-pvc-1

but i want to this Output :

busybox-0 → minikube → busybox-pvc-0 ,  
busybox-1 → minikube-m02 → busybox-pvc-1

in this outputs

Pods is busybox-0 , busybox-1 and Nodes is minikube , minikube-m02 and PVCs is busybox-pvc-0 , busybox-pvc-1

### Cluster information:

Kubernetes version:  
Client Version: v1.31.0  
Kustomize Version: v5.4.2  
Server Version: v1.31.0
