<p>While installing influxdb2 using k8s manifest from the link  <a href="https://docs.influxdata.com/influxdb/v2.6/install/?t=Kubernetes" rel="nofollow noreferrer">influxdb2 installation on k8s</a>
I get below &quot;<code>pod has unbound immediate PersistentVolumeClaims</code>&quot; error.</p>
<p>The instruction is given for minikube but I am installing it as a normal k8s cluster.
Any idea about the issue and how to fix.</p>
<pre><code>/home/ravi#kubectl describe pod influxdb-0 -n influxdb
Name:           influxdb-0
Namespace:      influxdb
Priority:       0
Node:           &lt;none&gt;
Labels:         app=influxdb
                controller-revision-hash=influxdb-78bc684b99
                statefulset.kubernetes.io/pod-name=influxdb-0
Annotations:    &lt;none&gt;
Status:         Pending
IP:             
IPs:            &lt;none&gt;
Controlled By:  StatefulSet/influxdb
Containers:
  influxdb:
    Image:        influxdb:2.0.6
    Port:         8086/TCP
    Host Port:    0/TCP
    Environment:  &lt;none&gt;
    Mounts:
      /var/lib/influxdb2 from data (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-k9d8t (ro)
Conditions:
  Type           Status
  PodScheduled   False 
Volumes:
  data:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  data-influxdb-0
    ReadOnly:   false
  default-token-k9d8t:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-k9d8t
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  &lt;none&gt;
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason            Age        From               Message
  ----     ------            ----       ----               -------
  Warning  FailedScheduling  &lt;unknown&gt;  default-scheduler  pod has unbound immediate PersistentVolumeClaims
  Warning  FailedScheduling  &lt;unknown&gt;  default-scheduler  pod has unbound immediate PersistentVolumeClaims
/home/ravi#
</code></pre>
<p>influx db2 yaml file</p>
<pre><code>---
apiVersion: v1
kind: Namespace
metadata:
    name: influxdb
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
    labels:
        app: influxdb
    name: influxdb
    namespace: influxdb
spec:
    replicas: 1
    selector:
        matchLabels:
            app: influxdb
    serviceName: influxdb
    template:
        metadata:
            labels:
                app: influxdb
        spec:
            containers:
              - image: influxdb:2.0.6
                name: influxdb
                ports:
                  - containerPort: 8086
                    name: influxdb
                volumeMounts:
                  - mountPath: /var/lib/influxdb2
                    name: data
    volumeClaimTemplates:
      - metadata:
            name: data
            namespace: influxdb
        spec:
            accessModes:
              - ReadWriteOnce
            resources:
                requests:
                    storage: 10G
---
apiVersion: v1
kind: Service
metadata:
    name: influxdb
    namespace: influxdb
spec:
    ports:
      - name: influxdb
        port: 8086
        targetPort: 8086
    selector:
        app: influxdb
    type: ClusterIP
</code></pre>
<p>k8s version</p>
<pre><code>/home/ravi#kubectl  version
Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;16&quot;, GitVersion:&quot;v1.16.0&quot;, GitCommit:&quot;2bd9643cee5b3b3a5ecbd3af49d09018f0773c77&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2019-09-18T14:36:53Z&quot;, GoVersion:&quot;go1.12.9&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;16&quot;, GitVersion:&quot;v1.16.0&quot;, GitCommit:&quot;2bd9643cee5b3b3a5ecbd3af49d09018f0773c77&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2019-09-18T14:27:17Z&quot;, GoVersion:&quot;go1.12.9&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}


/home/ravi&gt;sudo kubectl get pvc -A
NAMESPACE   NAME                      STATUS    VOLUME                   CAPACITY   ACCESS MODES   STORAGECLASS    AGE
influxdb    data-influxdb-0           Pending                                                                      4h41m
ricplt      pvc-ricplt-alarmmanager   Bound     pv-ricplt-alarmmanager   100Mi      RWO            local-storage   5h17m
ricplt      pvc-ricplt-e2term-alpha   Bound     pv-ricplt-e2term-alpha   100Mi      RWO            local-storage   5h18m
ricplt      r4-influxdb-influxdb2     Pending                                                                      32m
/home/ravi&gt;
/home/ravi&gt;
/home/ravi&gt;

/home/ravi&gt;sudo kubectl describe pvc data-influxdb-0 -n influxdb
Name:          data-influxdb-0
Namespace:     influxdb
StorageClass:  
Status:        Pending
Volume:        
Labels:        app=influxdb
Annotations:   &lt;none&gt;
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
Mounted By:    influxdb-0
Events:
  Type    Reason         Age                       From                         Message
  ----    ------         ----                      ----                         -------
  Normal  FailedBinding  2m12s (x1021 over 4h17m)  persistentvolume-controller  no persistent volumes available for this claim and no storage class is set
/home/ravi&gt;
</code></pre>

<p><strong>Looks like there is no auto-provisioning of k8s cluster you are running. You need to create Persistent Volume &amp; Storage classes on <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/#local" rel="nofollow noreferrer">local</a> clusters manually by cluster admin.</strong></p>
<p>Create one provisioner and pass that to your storage class and give that storage class to a persistence volume template to create automatic PVC and PV.</p>
<p>Refer to official kubernetes documentation on <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/" rel="nofollow noreferrer">Configure a Pod to Use a PersistentVolume for Storage</a>, which may help to resolve your issue.</p>
<blockquote>
<p><strong>To configure a Pod to use a PersistentVolumeClaim for storage. Here is a summary of the process:</strong></p>
<ol>
<li><p>You, as a cluster administrator, create a PersistentVolume backed by physical storage. You do not associate the volume with any Pod.</p>
</li>
<li><p>You, now taking the role of a developer / cluster user, create a PersistentVolumeClaim that is automatically bound to a suitable
PersistentVolume.</p>
</li>
<li><p>You create a Pod that uses the above PersistentVolumeClaim for storage.</p>
</li>
</ol>
</blockquote>
<p>Also try changing <code>accessModes: ReadWriteMany</code> to volume accessed by all your pods. A <code>subPath</code> needs to be used, If each pod wants to have its own directory. Refer to official Kubernetes document on <a href="https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath" rel="nofollow noreferrer">Using subPath</a>, like below :</p>
<pre><code>volumeMounts:
-  name: data
mountPath: /var/lib/influxdb2
subPath: $(POD_NAME)
</code></pre>
