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

Adding chart for aws-for-fluent-bit #104

Merged
merged 7 commits into from
May 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions stable/aws-for-fluent-bit/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
20 changes: 20 additions & 0 deletions stable/aws-for-fluent-bit/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
name: aws-for-fluent-bit
description: A Helm chart to deploy aws-for-fluent-bit project
version: 0.1.0
appVersion: 2.2.0
home: https://github.com/aws/eks-charts
icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png
sources:
- https://github.com/aws/eks-charts
maintainers:
- name: Mohammad Forutan
url: https://github.com/mforutan
email: [email protected]
keywords:
- eks
- fluentbit
- fluent-bit
- cloudwatch
- firehose
- kinesis
74 changes: 74 additions & 0 deletions stable/aws-for-fluent-bit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# AWS for fluent bit

A helm chart for [AWS-for-fluent-bit](https://github.com/aws/aws-for-fluent-bit)

# Installing the Chart

Add the EKS repository to Helm:

```
helm repo add eks https://aws.github.io/eks-charts
```

Install or upgrading the AWS for fluent bit chart with default configuration:

```
helm upgrade --install aws-for-fluent-bit --namespace kube-system eks/aws-for-fluent-bit
```

## Uninstalling the Chart

To uninstall/delete the `aws-for-fluent-bit` release:

```
helm delete aws-for-fluent-bit --namespace kube-system
```


## Configuration

| Parameter | Description | Default | Required |
| - | - | - | -
| `global.namespaceOverride` | Override the deployment namespace | Not set (`Release.Namespace`) |
| `image.repository` | Image to deploy | `amazon/aws-for-fluent-bit` | ✔
| `image.tag` | Image tag to deploy | `2.2.0`
| `image.pullPolicy` | Pull policy for the image | `IfNotPresent` | ✔
| `serviceAccount.create` | Whether a new service account should be created | `true` |
| `service.parsersFiles` | List of available parser files | `/fluent-bit/parsers/parsers.conf` |
| `service.extraParsers` | Adding more parsers with this value | `""` |
| `input.*` | Values for Kubernetes input | |
| `extraInputs` | Adding more inputs with this value | `""` |
| `filter.*` | Values for kubernetes filter | |
| `extraFilters` | Adding more filters with value |
| `cloudWatch.enabled` | Whether this plugin should be enabled or not [details](https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit) | `true` | ✔
| `cloudWatch.match` | The log filter | `*` | ✔
| `cloudWatch.region` | The AWS region for CloudWatch. | `us-east-1` | ✔
| `cloudWatch.logGroupName` | The name of the CloudWatch Log Group that you want log records sent to. | `"/aws/eks/fluentbit-cloudwatch/logs"` | ✔
| `cloudWatch.logStreamName` | The name of the CloudWatch Log Stream that you want log records sent to. | |
| `cloudWatch.logStreamPrefix` | Prefix for the Log Stream name. The tag is appended to the prefix to construct the full log stream name. Not compatible with the log_stream_name option. | `"fluentbit-"` |
| `cloudWatch.logKey` | By default, the whole log record will be sent to CloudWatch. If you specify a key name with this option, then only the value of that key will be sent to CloudWatch. For example, if you are using the Fluentd Docker log driver, you can specify logKey log and only the log message will be sent to CloudWatch. | |
| `cloudWatch.logFormat` | An optional parameter that can be used to tell CloudWatch the format of the data. A value of json/emf enables CloudWatch to extract custom metrics embedded in a JSON payload. See the Embedded Metric Format. | |
| `cloudWatch.roleArn` | ARN of an IAM role to assume (for cross account access). | |
| `cloudWatch.autoCreateGroup` | Automatically create the log group. Valid values are "true" or "false" (case insensitive). | true |
| `cloudWatch.endpoint` | Specify a custom endpoint for the CloudWatch Logs API. | |
| `cloudWatch.credentialsEndpoint` | Specify a custom HTTP endpoint to pull credentials from. [more info](https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit) | |
| `firehose.enabled` | Whether this plugin should be enabled or not, [details](https://github.com/aws/amazon-kinesis-firehose-for-fluent-bit) | `true` | ✔
| `firehose.match` | The log filter | `"*"` | ✔
| `firehose.region` | The region which your Firehose delivery stream(s) is/are in. | `"us-east-1"` | ✔
| `firehose.deliveryStream` | The name of the delivery stream that you want log records sent to. | `"my-stream"` | ✔
| `firehose.dataKeys` | By default, the whole log record will be sent to Kinesis. If you specify a key name(s) with this option, then only those keys and values will be sent to Kinesis. For example, if you are using the Fluentd Docker log driver, you can specify data_keys log and only the log message will be sent to Kinesis. If you specify multiple keys, they should be comma delimited. | |
| `firehose.roleArn` | ARN of an IAM role to assume (for cross account access). | |
| `firehose.endpoint` | Specify a custom endpoint for the Kinesis Firehose API. | |
| `firehose.timeKey` | Add the timestamp to the record under this key. By default the timestamp from Fluent Bit will not be added to records sent to Kinesis. | |
| `firehose.timeKeyFormat` | strftime compliant format string for the timestamp; for example, `%Y-%m-%dT%H:%M:%S%z`. This option is used with `time_key`. | |
| `kinesis.enabled` | Whether this plugin should be enabled or not, [details](https://github.com/aws/amazon-kinesis-streams-for-fluent-bit) | `true` | ✔
| `kinesis.match` | The log filter | `"*"` | ✔
| `kinesis.region` | The region which your Kinesis Data Stream is in. | `"us-east-1"` | ✔
| `kinesis.stream` | The name of the Kinesis Data Stream that you want log records sent to. | `"my-kinesis-stream-name"` | ✔
| `kinesis.partitionKey` | A partition key is used to group data by shard within a stream. A Kinesis Data Stream uses the partition key that is associated with each data record to determine which shard a given data record belongs to. For example, if your logs come from Docker containers, you can use container_id as the partition key, and the logs will be grouped and stored on different shards depending upon the id of the container they were generated from. As the data within a shard are coarsely ordered, you will get all your logs from one container in one shard roughly in order. If you don't set a partition key or put an invalid one, a random key will be generated, and the logs will be directed to random shards. If the partition key is invalid, the plugin will print an warning message. | `"container_id"` | ✔
| `kinesis.appendNewline` | If you set append_newline as true, a newline will be addded after each log record. | |
| `kinesis.dataKeys` | By default, the whole log record will be sent to Kinesis. If you specify key name(s) with this option, then only those keys and values will be sent to Kinesis. For example, if you are using the Fluentd Docker log driver, you can specify data_keys log and only the log message will be sent to Kinesis. If you specify multiple keys, they should be comma delimited. | |
| `kinesis.roleArn` | ARN of an IAM role to assume (for cross account access). | |
| `kinesis.timeKey` | Add the timestamp to the record under this key. By default the timestamp from Fluent Bit will not be added to records sent to Kinesis. | |
| `kinesis.timeKeyFormat` | strftime compliant format string for the timestamp; for example, `%Y-%m-%dT%H:%M:%S%z`. This option is used with `time_key`. | |
| `extraOutputs` | Adding more outputs with value | `""` |
5 changes: 5 additions & 0 deletions stable/aws-for-fluent-bit/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ .Release.Name }} has been installed or updated. To check the status of pods, run:

kubectl get pods -n {{ include "aws-for-fluent-bit.namespace" . }}


79 changes: 79 additions & 0 deletions stable/aws-for-fluent-bit/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "aws-for-fluent-bit.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "aws-for-fluent-bit.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "aws-for-fluent-bit.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "aws-for-fluent-bit.labels" -}}
helm.sh/chart: {{ include "aws-for-fluent-bit.chart" . }}
{{ include "aws-for-fluent-bit.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Selector labels
*/}}
{{- define "aws-for-fluent-bit.selectorLabels" -}}
app.kubernetes.io/name: {{ include "aws-for-fluent-bit.name" . }}
app.kubernetes.io/instance: {{ include "aws-for-fluent-bit.namespace" . }}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
{{- define "aws-for-fluent-bit.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "aws-for-fluent-bit.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}

{{/*
Allow the release namespace to be overridden for multi-namespace deployments in combined charts.
*/}}
{{- define "aws-for-fluent-bit.namespace" -}}
{{- if .Values.global -}}
{{- if .Values.global.namespaceOverride -}}
{{- .Values.global.namespaceOverride -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}

12 changes: 12 additions & 0 deletions stable/aws-for-fluent-bit/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: {{ include "aws-for-fluent-bit.fullname" . }}
rules:
- apiGroups: [""]
resources:
- namespaces
- pods
verbs: ["get", "list", "watch"]
{{- end -}}
14 changes: 14 additions & 0 deletions stable/aws-for-fluent-bit/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: {{ include "aws-for-fluent-bit.fullname" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "aws-for-fluent-bit.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "aws-for-fluent-bit.fullname" . }}
namespace: {{ include "aws-for-fluent-bit.namespace" . }}
{{- end -}}
136 changes: 136 additions & 0 deletions stable/aws-for-fluent-bit/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "aws-for-fluent-bit.fullname" . }}
namespace: {{ include "aws-for-fluent-bit.namespace" . }}
labels:
{{- include "aws-for-fluent-bit.labels" . | nindent 4 }}
data:
fluent-bit.conf: |
[SERVICE]
{{- range .Values.service.parsersFiles }}
Parsers_File {{ . }}
{{- end }}
{{- if .Values.service.extraParsers }}
Parsers_File /fluent-bit/etc/parser_extra.conf
{{- end }}

[INPUT]
Name tail
Tag {{ .Values.input.tag }}
Path {{ .Values.input.path }}
DB {{ .Values.input.db }}
Parser {{ .Values.input.parser }}
Docker_Mode {{ .Values.input.dockerMode }}
Mem_Buf_Limit {{ .Values.input.memBufLimit }}
Skip_Long_Lines {{ .Values.input.skipLongLines }}
Refresh_Interval {{ .Values.input.refreshInterval }}

{{- if .Values.extraInputs }}
{{ .Values.extraInputs | indent 4}}
{{- end }}

[FILTER]
Name kubernetes
Match {{ .Values.filter.match }}
Kube_URL {{ .Values.filter.kubeURL }}
Merge_Log {{ .Values.filter.mergeLog }}
Merge_Log_Key {{ .Values.filter.mergeLogKey }}
K8S-Logging.Parser {{ .Values.filter.k8sLoggingParser }}
K8S-Logging.Exclude {{ .Values.filter.k8sLoggingExclude }}

{{- if .Values.extraFilters }}
{{ .Values.extraFilters | indent 4}}
{{- end }}

{{- if .Values.cloudWatch.enabled }}
[OUTPUT]
Name cloudwatch
Match {{ .Values.cloudWatch.match }}
region {{ .Values.cloudWatch.region }}
log_group_name {{ .Values.cloudWatch.logGroupName }}
{{- if .Values.cloudWatch.logStreamName }}
log_stream_name {{ .Values.cloudWatch.logStreamName }}
{{- end }}
{{- if .Values.cloudWatch.logStreamPrefix }}
log_stream_prefix {{ .Values.cloudWatch.logStreamPrefix }}
{{- end }}
{{- if .Values.cloudWatch.logKey }}
log_key {{ .Values.cloudWatch.logKey }}
{{- end }}
{{- if .Values.cloudWatch.logFormat }}
log_format {{ .Values.cloudWatch.logFormat }}
{{- end }}
{{- if .Values.cloudWatch.roleArn }}
role_arn {{ .Values.cloudWatch.roleArn }}
{{- end }}
{{- if .Values.cloudWatch.autoCreateGroup }}
auto_create_group {{ .Values.cloudWatch.autoCreateGroup }}
{{- end }}
{{- if .Values.cloudWatch.endpoint }}
endpoint {{ .Values.cloudWatch.endpoint }}
{{- end }}
{{- if .Values.cloudWatch.credentialsEndpoint }}
credentials_endpoint {{ toJson .Values.cloudWatch.credentialsEndpoint }}
{{- end }}
{{- end }}

{{- if .Values.firehose.enabled }}
[OUTPUT]
Name firehose
Match {{ .Values.firehose.match }}
region {{ .Values.firehose.region }}
delivery_stream {{ .Values.firehose.deliveryStream }}
{{- if .Values.firehose.dataKeys }}
data_keys {{ .Values.firehose.dataKeys }}
{{- end }}
{{- if .Values.firehose.roleArn }}
role_arn {{ .Values.firehose.roleArn }}
{{- end }}
{{- if .Values.firehose.endpoint }}
endpoint {{ .Values.firehose.endpoint }}
{{- end }}
{{- if .Values.firehose.timeKey }}
time_key {{ .Values.firehose.timeKey }}
{{- end }}
{{- if .Values.firehose.timeKeyFormat }}
time_key_format {{ .Values.firehose.timeKeyFormat }}
{{- end }}
{{- end }}

{{- if .Values.kinesis.enabled }}
[OUTPUT]
Name kinesis
Match {{ .Values.kinesis.match }}
region {{ .Values.kinesis.region }}
stream {{ .Values.kinesis.stream }}
partition_key {{ .Values.kinesis.partitionKey }}
{{- if .Values.kinesis.appendNewline }}
append_newline {{ .Values.kinesis.appendNewline }}
{{- end }}
{{- if .Values.kinesis.dataKeys }}
data_keys {{ .Values.kinesis.dataKeys }}
{{- end }}
{{- if .Values.kinesis.roleArn }}
role_arn {{ .Values.kinesis.roleArn }}
{{- end }}
{{- if .Values.kinesis.endpoint }}
endpoint {{ .Values.kinesis.endpoint }}
{{- end }}
{{- if .Values.kinesis.timeKey }}
time_key {{ .Values.kinesis.timeKey }}
{{- end }}
{{- if .Values.kinesis.timeKeyFormat }}
time_key_format {{ .Values.kinesis.timeKeyFormat }}
{{- end }}
{{- end }}

{{- if .Values.extraOutputs }}
{{ .Values.extraOutputs | indent 4}}
{{- end }}


{{- if .Values.service.extraParsers }}
parser_extra.conf: |-
{{ .Values.service.extraParsers | indent 4}}
{{- end }}
Loading