Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ServiceMonitor/Prometheus Operator support as like in the original fluent-bit package #99

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

szwed
Copy link

@szwed szwed commented Jun 14, 2020

We are using Prometheus Operator for monitoring all the middleware components (including fluent-bit/humio-fluentbit) therefore we need built in support for ServiceMonitor CRDs as like it was done in the original chart:
https://github.com/helm/charts/blob/master/stable/fluent-bit/templates/servicemonitor.yaml

This is community wide standard and most of the community driven stable charts provide the functionality.

Changes:

If both the attributes are set to true:

metrics:
  enabled: true
    serviceMonitor:
      enabled: true

The following new objects are being created:

# Source: humio-fluentbit/templates/fluent-bit-servicemonitor.yaml
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: RELEASE-NAME-humio-fluentbit
  labels:
    app: humio-fluentbit
    chart: humio-fluentbit-0.1.0
    heritage: Helm
    release: RELEASE-NAME
spec:
  endpoints:
    - port: metrics
      path: /api/v1/metrics/prometheus
  namespaceSelector:
    matchNames:
      - default
  selector:
    matchLabels:
      app: humio-fluentbit
      release: RELEASE-NAME

# Source: humio-fluentbit/templates/fluent-bit-service.yaml
apiVersion: v1
kind: Service
metadata:
  name: RELEASE-NAME-humio-fluentbit-metrics
  labels:
    app: humio-fluentbit
    chart: humio-fluentbit-0.1.0
    heritage: Helm
    release: RELEASE-NAME
spec:
  type: ClusterIP
  sessionAffinity: None
  ports:
  - port: 2020
    targetPort: metrics
    name: metrics
  selector:
    app: humio-fluentbit
    release: RELEASE-NAME

and fluent-bit config gets extended with:

  fluent-bit-service.conf:  |-
    [SERVICE]
        Flush        1
        Daemon       Off
        Log_Level    info
        Parsers_File parsers.conf
        HTTP_Server  On                    # new !!!!
        HTTP_Listen  0.0.0.0              # new !!!!
        HTTP_Port    2020                  # new !!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant