minio / operator

Simple Kubernetes Operator for MinIO clusters :computer:
https://min.io/docs/minio/kubernetes/upstream/index.html
GNU Affero General Public License v3.0
1.22k stars 455 forks source link

MINIO_PROMETHEUS_URL env var is missing from tenant StatefulSet #2152

Closed macrokernel closed 5 months ago

macrokernel commented 5 months ago

MinIO monitoring data is collected by kube-prometheus-stack and displayed in Grafana, however MinIO cosnole is unable to retrieve advanced metrics from Prometheus. I think this might be caused by the MINIO_PROMETHEUS_URL environment variable not being set in the tenant StatefulSet and pods regardless of it being specified under env section in the operator and tenant values.yaml - see below.

Expected Behavior

MinIO cosnole is able to display advanced metrics from Prometheus.

Current Behavior

MinIO cosnole is unable to display advanced metrics from Prometheus. The operator Deplyment has these environment variables defined:

    Environment:
      PROMETHEUS_NAMESPACE:  monitoring
      MINIO_PROMETHEUS_URL:  http://monitoring-kube-prometheus-prometheus.monitoring.svc.cluster.local:9090

The tenant StatefulSet has only these environment variables defined:

Environment:
      MINIO_CONFIG_ENV_FILE:         /tmp/minio/config.env
      MINIO_OPERATOR_VERSION:        5.0.15
      MINIO_PROMETHEUS_JOB_ID:       cdr-minio-job
      MINIO_SERVER_URL:              https://minio.minio-cdr.svc.cluster.local:443
      MINIO_UPDATE:                  on
      MINIO_UPDATE_MINISIGN_PUBKEY:  [redacted]

Possible Solution

Make sure MINIO_PROMETHEUS_URL environment variable is present in tenant's StatefulSet.

Steps to Reproduce (for bugs)

  1. Deploy kube-prometheus-stack helm chart vesion 60.0.0 with default values.
  2. Deploy MinIO operator chart version 5.0.15 with the following values.yaml:
    operator:
    env:
    - name: PROMETHEUS_NAMESPACE
      value: "monitoring"
    - name: MINIO_PROMETHEUS_URL
      value: "http://monitoring-kube-prometheus-prometheus.monitoring.svc.cluster.local:9090"
    ingress:
    enabled: true
    ingressClassName: "nginx"
    labels: { }
    annotations: { }
    tls: [ ]
    host: minio-operator-console.example.com
    path: /
    pathType: Prefix
  3. Deploy MinIO tenant chart version 5.0.15 with the following values.yaml:
    existingSecret:
    name: minio-cdr-secret
    tenant:
    name: cdr
    configuration:
    name: minio-cdr-secret
    pools:
    - servers: 1
      name: pool-0
      volumesPerServer: 1
      size: 10Gi
      storageClassName: standard
    metrics:
    enabled: true
    port: 9000
    protocol: http
    prometheusOperator: true  
    logging: {
    json
    }
    env:
    - name: PROMETHEUS_NAMESPACE
    value: "monitoring"
    - name: MINIO_PROMETHEUS_URL
    value: "http://monitoring-kube-prometheus-prometheus.monitoring.svc.cluster.local:9090"
    ingress:
    api:
    enabled: true
    ingressClassName: ""
    labels: { }
    annotations: {
      nginx.ingress.kubernetes.io/backend-protocol: "HTTPS",
      nginx.ingress.kubernetes.io/ssl-passthrough: "true"
    }
    tls: [ ]
    host: minio.example.com
    path: /
    pathType: Prefix
    console:
    enabled: true
    ingressClassName: ""
    labels: { }
    annotations: {
      nginx.ingress.kubernetes.io/backend-protocol: "HTTPS",
      nginx.ingress.kubernetes.io/ssl-passthrough: "true"
    }
    tls: [ ]
    host: minio-console.example.com
    path: /
    pathType: Prefix

Context

I am trying to get advanced metrics displayed in MinIO tenant console.

Your Environment

macrokernel commented 5 months ago

The issue was caused by incorrect indentation of the env section in my tenant values.yaml. The env section should go under the tenant section.