<p>My deployment for InfluxDB can’t find the PVC. The following is how I set up my deployment.</p>
<p>First, I set up a namespace <code>services</code> with commands:</p>
<pre><code>kubectl create namespace services
kubectl config set-context --current --namespace=services
</code></pre>
<p>Second, I set up a deplyment, service, volume, and secret with each <code>.yaml</code> files.</p>
<pre><code>kubectl apply -f srcs/influxdb/
</code></pre>
<p>influxdb-deployment.yaml:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: influxdb
  labels:
    app: influxdb
spec:
  replicas: 1
  selector:
    matchLabels:
      app: influxdb
  template:
    metadata:
      labels:
        app: influxdb
    spec:
      containers:
      - name: influxdb
        image: service_influxdb
        imagePullPolicy: Never
        ports:
        - containerPort: 8086
        envFrom:
        - secretRef:
            name: influxdb-secret
        volumeMounts:
        - mountPath: /var/lib/influxdb
          name: var-lib-influxdb
      volumes:
      - name: var-lib-influxdb
        persistentVolumeClaim:
          claimName: influxdb-pvc
      restartPolicy: Always
</code></pre>
<p>influxdb-volume.yaml:</p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: influxdb-pvc
  labels:
    app: influxdb
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
</code></pre>
<p>Then, finally, I check the deployment’s status with <code>minikube dashboard</code> and run into the message <code>persistentvolumeclaim &quot;influxdb-pvc&quot; not found</code>.</p>
<p>Is there anything I need to check? I google it and check the namespace, the volume name and I think everything is perfect!! Please help me.. 😢</p>

seheon
<p>if you are using the single node clusters , in the pv  (influxdb-volume.yaml) you missed two things</p>
<ol>
<li>storage class (which type of storage it should eg: manual)</li>
<li>hostpath (the path from the host machine to use it as a PV)</li>
</ol>
<p><a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/</a></p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: task-pv-volume
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: &quot;/mnt/data&quot;
</code></pre>
<p>we should define where does the PV getting memory to crated PV and then allow PVC to consume them.
in a Real production Environment, we should use the storage that we have available for all pods like NFS share, GCP cloud persistent disk, or AKS storage .please go through the above link for further details as we have many possibilities.</p>
