<p>bare in mind that I'm new to Kubernetes.</p>
<p>I'm trying to integrate our existing K8 cluster in GitLab. I have added the cluster to gitlab and I can see projects are fetched. However under Health tab I see that I need to install Prometheus.
<a href="https://i.stack.imgur.com/C0FEw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C0FEw.png" alt="enter image description here" /></a></p>
<p>After trying to install I get
<a href="https://i.stack.imgur.com/CAq5e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CAq5e.png" alt="enter image description here" /></a></p>
<p>On the cluster this is the error I get</p>
<pre><code>[user]$ kubectl describe pvc prometheus-prometheus-server -ngitlab-managed-apps
Name:          prometheus-prometheus-server
Namespace:     gitlab-managed-apps
StorageClass:  
Status:        Pending
Volume:        
Labels:        app=prometheus
               chart=prometheus-9.5.2
               component=server
               heritage=Tiller
               release=prometheus
Annotations:   &lt;none&gt;
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
Mounted By:    prometheus-prometheus-server-78bdf8f5b7-dkctg
Events:
  Type    Reason         Age              From                         Message
  ----    ------         ----             ----                         -------
  Normal  FailedBinding  6s (x2 over 6s)  persistentvolume-controller  no persistent volumes available for this claim and no storage class is set
</code></pre>
<p>I tried both, specifying storage class and adding persistent volume to no avail, the error remains the same. I can't understand why the volume is not claimed.</p>
<p>This is how the added volume looks like</p>
<pre><code>[user]$ kubectl get pv
NAME                           CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM                                   STORAGECLASS   REASON   AGE
prometheus-prometheus-server   2Gi        RWX            Retain           Available                                           manual                  17m
</code></pre>
<pre><code>kubectl describe pv prometheus-prometheus-server
Name:            prometheus-prometheus-server
Labels:          app=prometheus
                 chart=prometheus-9.5.2
                 component=server
                 heritage=Tiller
                 release=prometheus
Annotations:     kubectl.kubernetes.io/last-applied-configuration:
                   {&quot;apiVersion&quot;:&quot;v1&quot;,&quot;kind&quot;:&quot;PersistentVolume&quot;,&quot;metadata&quot;:{&quot;annotations&quot;:{},&quot;labels&quot;:{&quot;app&quot;:&quot;prometheus&quot;,&quot;chart&quot;:&quot;prometheus-9.5.2&quot;,&quot;compone...
Finalizers:      [kubernetes.io/pv-protection]
StorageClass:    manual
Status:          Available
Claim:           
Reclaim Policy:  Retain
Access Modes:    RWX
VolumeMode:      Filesystem
Capacity:        2Gi
Node Affinity:   &lt;none&gt;
Message:         
Source:
    Type:          HostPath (bare host directory volume)
    Path:          /var/prometheus-server
    HostPathType:  
Events:            &lt;none&gt;
</code></pre>

CyberProdigy
<p>I'm not quite sure where i found the exact PVC definition for the GitLab managed Prometheus but i am sure that the PVC wants to claim a PV with a capacity of at least 8Gi and an Access Mode of <code>RWO</code>. You need to create a Persistence Volume that meets this criteria (currently you provide 2Gi and RWX).</p>
<p>As far as i experienced it a PVC with RWO does not get assigned to an RWX PV.</p>
