This repository was archived by the owner on Feb 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
Add fluentd-cloudwatch log forwarder #211
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b7aad98
fluentd cloudwatch incubator
icereval f6563fe
rename deployment -> daemonset
icereval d3cbb6d
annotations as value
icereval e130cd7
reorder values
icereval 0455357
use helm namespace
icereval 3a83304
address code review
icereval 83dd8cd
move td-agent.conf into values.yaml
icereval File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: fluentd-cloudwatch | ||
version: 0.1.0 | ||
description: A Fluentd CloudWatch Helm chart for Kubernetes. | ||
keywords: | ||
- fluentd | ||
- cloudwatch | ||
- logging | ||
sources: | ||
- https://github.com/kubernetes/charts | ||
- https://github.com/18F/cg-deploy-kubernetes | ||
maintainers: | ||
- name: Josh Carp | ||
email: jm.carp@gmail.com | ||
- name: Michael Haselton | ||
email: michael.haselton@gmail.com | ||
engine: gotpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Fluentd CloudWatch | ||
|
||
* Installs [Fluentd](https://www.fluentd.org/) [Cloudwatch](https://aws.amazon.com/cloudwatch/) log forwarder. | ||
|
||
## TL;DR; | ||
|
||
```console | ||
$ helm install incubator/fluentd-cloudwatch | ||
``` | ||
|
||
## Introduction | ||
|
||
This chart bootstraps a [Fluentd](https://www.fluentd.org/) [Cloudwatch](https://aws.amazon.com/cloudwatch/) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. | ||
|
||
## Prerequisites | ||
|
||
- Kubernetes 1.4+ with Beta APIs enabled | ||
|
||
## Installing the Chart | ||
|
||
To install the chart with the release name `my-release`: | ||
|
||
```console | ||
$ helm install --name my-release incubator/fluentd-cloudwatch | ||
``` | ||
|
||
The command deploys Fluentd Cloudwatch on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. | ||
|
||
## Uninstalling the Chart | ||
|
||
To uninstall/delete the `my-release` deployment: | ||
|
||
```console | ||
$ helm delete my-release | ||
``` | ||
|
||
The command removes all the Kubernetes components associated with the chart and deletes the release. | ||
|
||
## Configuration | ||
|
||
The following tables lists the configurable parameters of the Fluentd Cloudwatch chart and their default values. | ||
|
||
| Parameter | Description | Default | | ||
| -------------------------- | ------------------------------------------ | ---------------------------------------------------------- | | ||
| `image` | Image | `18fgsa/fluentd-cloudwatch` | | ||
| `imageTag` | Image tag | `0.1.0` | | ||
| `imagePullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | | ||
| `resources.limits.cpu` | CPU limit | `100m` | | ||
| `resources.limits.memory` | Memory limit | `200Mi` | | ||
| `resources.requests.cpu` | CPU request | `100m` | | ||
| `resources.requests.memory`| Memory request | `200Mi` | | ||
| `hostNetwork` | Host network | `false` | | ||
| `annotations` | Annotations | `nil` | | ||
| `awsRegion` | AWS Cloudwatch region | `us-east-1` | | ||
| `logGroupName` | AWS Cloudwatch log group | `kubernetes` | | ||
|
||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, | ||
|
||
```console | ||
$ helm install --name my-release \ | ||
--set awsRegion=us-east-1 \ | ||
incubator/fluentd-cloudwatch | ||
``` | ||
|
||
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, | ||
|
||
```console | ||
$ helm install --name my-release -f values.yaml stable/fluentd-cloudwatch | ||
``` | ||
|
||
### ConfigMap Files | ||
FluentD is configured through [td-agent.conf](http://docs.fluentd.org/articles/config-file). This file (and any others listed in `tdAgentFiles`) will be mounted into the `fluentd` pod. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
To verify that Fluentd Cloudwatch has started, run: | ||
|
||
kubectl --namespace={{ .Release.Namespace }} get pods -l "app={{ template "fullname" . }}" | ||
|
||
THIS APPLICATION CAPTURES ALL CONSOLE OUTPUT AND FORWARDS IT TO AWS CLOUDWATCH. Anything that might be identifying, | ||
including things like IP addresses, container images, and object names will NOT be anonymized. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 24 -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
*/}} | ||
{{- define "fullname" -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ template "fullname" . }} | ||
labels: | ||
app: {{ template "fullname" . }} | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
heritage: {{ .Release.Service | quote }} | ||
release: {{ .Release.Name | quote }} | ||
data: | ||
{{ toYaml .Values.tdAgentFiles | indent 2 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: DaemonSet | ||
metadata: | ||
name: {{ template "fullname" . }} | ||
labels: | ||
app: {{ template "fullname" . }} | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
heritage: "{{ .Release.Service }}" | ||
release: "{{ .Release.Name }}" | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: {{ template "fullname" . }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ template "fullname" . }} | ||
release: "{{ .Release.Name }}" | ||
annotations: | ||
{{ toYaml .Values.annotations | indent 8 }} | ||
spec: | ||
containers: | ||
- name: fluentd-cloudwatch | ||
image: "{{ .Values.image }}:{{ .Values.imageTag }}" | ||
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }} | ||
hostNetwork: {{ default false .Values.hostNetwork }} | ||
env: | ||
- name: AWS_REGION | ||
value: {{ .Values.awsRegion }} | ||
- name: LOG_GROUP_NAME | ||
value: {{ .Values.logGroupName }} | ||
resources: | ||
{{ toYaml .Values.resources | indent 10 }} | ||
volumeMounts: | ||
- name: config-volume | ||
mountPath: /etc/td-agent | ||
- name: varlog | ||
mountPath: /var/log | ||
- name: varlibdockercontainers | ||
mountPath: /var/lib/docker/containers | ||
readOnly: true | ||
terminationGracePeriodSeconds: 30 | ||
volumes: | ||
- name: config-volume | ||
configMap: | ||
name: {{ template "fullname" . }} | ||
- name: varlog | ||
hostPath: | ||
path: /var/log | ||
- name: varlibdockercontainers | ||
hostPath: | ||
path: /var/lib/docker/containers |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you consider adding
hostNetwork: {{ default false .Values.hostNetwork }}
here? We rely on it to create journald log streams using the hostname.