kubesphere / kube-events

K8s Event Exporting, Filtering and Alerting in Multi-Tenant Environment
Apache License 2.0
180 stars 31 forks source link

exporter 404 and ruler sinks alert manager #44

Open Shuimo03 opened 1 year ago

Shuimo03 commented 1 year ago

When I created the ruler about alertmanager sinks, I intentionally filled in some wrong information, but the ruler-alertmanager-pod logs still show rule cache succeeded,Here is my ruler.yaml

apiVersion: events.kubesphere.io/v1alpha1
kind: Ruler
metadata:
  name: kube-events-alertmanager-ruler
  namespace: kubesphere-logging-system
spec:
  image: kubesphere/kube-events-ruler:0.5.0
  replicas: 1
  resources: {} #985
  ruleNamespaceSelector: {} #1012
  ruleSelector: {}
  sinks:
    alertmanagers: 
      - namespace: monitoring
        name: alertmanager-main
        port: 9093
        targetPort: 9093

And my exporter component prompts a 404 when using the k8s service, but the url doesn't.

apiVersion: events.kubesphere.io/v1alpha1
kind: Exporter
metadata:
  name: kube-events-exporter
  namespace: kubesphere-logging-system
spec:
  image: kubesphere/kube-events-exporter:0.5.0
  resources: {}
  sinks:
    stdout: {}
    webhooks:
          name: kube-events-alertmanager-ruler
         namespace: kubesphere-logging-system
          path: events/meteics
          port: 8443

K8S is minikube, version is v1.25.3 CNI: cilium

junotx commented 1 year ago

@Shuimo03 If you fill invalid configuration into Ruler, you may find the error from the operator log. If you configure the ruler service as a webhook sink in Exporter, you should set the path to /events instead of your events/meteics

Shuimo03 commented 1 year ago

@junotx Thanks, I have found a solution to this 404, because the path and port in exporter.yaml are not custom, but fixed in the code: cmd/ruler/main.go 71 line, but not declared

Shuimo03 commented 1 year ago

I have new question currently encountering is how does the ruler component send the rules to the alert manager? And how to verify if it is successful?

junotx commented 1 year ago

I have new question currently encountering is how does the ruler component send the rules to the alert manager? And how to verify if it is successful?

The ruler sent alerts rather than rules to the alertmanager.