nats-io / k8s

NATS on Kubernetes with Helm Charts
Apache License 2.0
445 stars 301 forks source link

Nats installation on a fresh K8s cluster errors : no matches for kind "PodMonitor" #786

Closed ksingh-scogo closed 1 year ago

ksingh-scogo commented 1 year ago
  monitor:
    enabled: true
    port: 8222
    tls:
      # config.nats.tls must be enabled also
      # when enabled, monitoring port will use HTTPS with the options from config.nats.tls
      enabled: true
$ helm install nats nats/nats --namespace=nats --create-namespace --version 1.0.2 --values=values_20082023.yaml

Release "nats" does not exist. Installing it now.
Error: unable to build kubernetes objects from release manifest: resource mapping not found for name: "nats-jetstream" namespace: "" from "": no matches for kind "PodMonitor" in version "monitoring.coreos.com/v1"
ensure CRDs are installed first

Temporary workaround is to install PodMonitor CRD on the k8s cluster and then install NATS using Helm

kubectl create -f https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/setup/0podmonitorCustomResourceDefinition.yaml
caleblloyd commented 1 year ago

This is the expected behavior, you need Prometheus CRDs to use the PodMonitor