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

[aws-for-fluent-bit] Support extra Configuration to the pods #669

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

Conversation

Kaawin1
Copy link

@Kaawin1 Kaawin1 commented Jan 11, 2022

Issue

This PR depends on this PR. (I cherry-picked the commit.)

Description of changes

This PR allow to add extra configuration to the pod. This will allow, for example, the pod to expose a port.

I need to access the HTTP server from outside the pods to retrieve fluentbit metrics. To do it I need the port to be exposed.

Checklist

  • Added/modified documentation as required (such as the README.md for modified charts)
  • Incremented the chart version in Chart.yaml for the modified chart(s)
  • Manually tested. Describe what testing was done in the testing section below
  • Make sure the title of the PR is a good description that can go into the release notes

Testing

  1. No changes to values.yaml. Helm apply produced no change to the configmap or daemonset.
  2. Updated values.yaml with extraKeys and extraContainerConfig to activate HTTP server and expose the port
service:
  extraKeys: |
     HTTP_Server  On

extraContainerConfig:
  ports:
  - containerPort: 2020
    name: metrics
    protocol: TCP

Helm apply added the following parts (+)

apiVersion: v1
kind: ConfigMap
metadata:
  name: RELEASE-NAME-aws-for-fluent-bit
  namespace: logging
  labels:
    helm.sh/chart: aws-for-fluent-bit-0.1.13
    app.kubernetes.io/name: aws-for-fluent-bit
    app.kubernetes.io/instance: logging
    app.kubernetes.io/version: "2.13.0"
    app.kubernetes.io/managed-by: Helm
data:
  fluent-bit.conf: |
    [SERVICE]
        Parsers_File /fluent-bit/parsers/parsers.conf
+       HTTP_Server  On
+       

    [INPUT]
        Name              tail
        Tag               kube.*
        Path              /var/log/containers/*.log
        DB                /var/log/flb_kube.db
        Parser            docker
        Docker_Mode       On
        Mem_Buf_Limit     5MB
        Skip_Long_Lines   On
        Refresh_Interval  10

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: RELEASE-NAME-aws-for-fluent-bit
  namespace: logging
  labels:
    helm.sh/chart: aws-for-fluent-bit-0.1.13
    app.kubernetes.io/name: aws-for-fluent-bit
    app.kubernetes.io/instance: logging
    app.kubernetes.io/version: "2.13.0"
    app.kubernetes.io/managed-by: Helm
spec:
  updateStrategy:
    type: RollingUpdate
  selector:
    matchLabels:
      app.kubernetes.io/name: aws-for-fluent-bit
      app.kubernetes.io/instance: logging
  template:
    metadata:
      labels:
        app.kubernetes.io/name: aws-for-fluent-bit
        app.kubernetes.io/instance: logging
    spec:
      serviceAccountName: RELEASE-NAME-aws-for-fluent-bit
      containers:
        - name: aws-for-fluent-bit
          imagePullPolicy: IfNotPresent
          image: "amazon/aws-for-fluent-bit:2.13.0"
+         ports:
+         - containerPort: 2020
+           name: metrics
+           protocol: TCP

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

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