kais271 / pvc-exporter

Provides metrics to monitoring mounted pvc usage.
Apache License 2.0
43 stars 18 forks source link

Unable to Build Kubernetes Objects #27

Closed asafii99 closed 2 years ago

asafii99 commented 2 years ago

Hello,

I cannot install this helm chart, below is the error. My Kubernetes version is v1.17.11

image

My Kubernetes version is v1.17.11

kais271 commented 2 years ago

Hi , it caused by you don't have prometheus installed. You can try add '--set serviceMonitor.enabled=false' to helm install.

asafii99 commented 2 years ago

Hello,

I have Prometheus installed on this cluster.

kais271 commented 2 years ago

Cloud you please run kubectl api-resources|grep servicemonitor ? Maybe the apiversion doesn't match.

asafii99 commented 2 years ago

After running the command, I am getting no output

kais271 commented 2 years ago

ok, which version of prometheus are you using? run kubectl api-resources|grep monitoring to check apiversion

kais271 commented 2 years ago

kubectl get prometheus -A to get prometheus version

asafii99 commented 2 years ago

When I run these commands, I get no output, here is the info on the prometheus webpage

image

kais271 commented 2 years ago

Are you using native k8s and prometheus? It's weird if you have the Prometheus deployed within the cluster, but no CRD.

asafii99 commented 2 years ago

I believe I am, here is my prometheus deployment configuration

apiVersion: apps/v1
kind: Deployment
metadata:
  name: prometheus-deployment
  namespace: monitoring
  labels:
    app: prometheus-server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: prometheus-server
  template:
    metadata:
      labels:
        app: prometheus-server
    spec:
      initContainers:
      - name: prometheus-data-permission-fix
        image: busybox
        command:
         - /bin/chmod
         - '-R'
         - '777'
         - /prometheus/
        volumeMounts:
         - name: prometheus-storage-volume
           mountPath: /prometheus/
      containers:
        - name: prometheus
          image: prom/prometheus
          args:
            - "--storage.tsdb.retention.time=12h"
            - "--config.file=/etc/prometheus/prometheus.yml"
            - "--storage.tsdb.path=/prometheus/"
          ports:
            - containerPort: 9090
          resources:
            requests:
              cpu: 500m
              memory: 500M
            limits:
              cpu: 1
              memory: 1Gi
          volumeMounts:
            - name: prometheus-config-volume
              mountPath: /etc/prometheus/
            - name: prometheus-storage-volume
              mountPath: /prometheus/
      volumes:
        - name: prometheus-config-volume
          configMap:
            defaultMode: 420
            name: prometheus-server-conf
        - name: prometheus-storage-volume
          persistentVolumeClaim:
               claimName: prometheus-pvc
asafii99 commented 2 years ago

I figured it out, I didn't have the CRDs for Prometheus objects installed