Skip to content

Commit 9f36542

Browse files
committed
Updated fluentd-cloudwatch code from PR 211
The configuration is now inside the container (from PR comment: helm#211 (comment)), I then removed the configMap holding the config. The AWS keys are added as secrets from files, using Files.Glob (from PR comment helm#211 (comment))
1 parent 1b6ba0e commit 9f36542

File tree

9 files changed

+49
-305
lines changed

9 files changed

+49
-305
lines changed

incubator/fluentd-cloudwatch/Chart.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ keywords:
77
- logging
88
sources:
99
- https://github.com/kubernetes/charts
10-
- https://github.com/18F/cg-deploy-kubernetes
10+
- https://github.com/fluent/fluentd-kubernetes-daemonset
1111
maintainers:
1212
- name: Josh Carp
1313
email: jm.carp@gmail.com
1414
- name: Michael Haselton
1515
email: michael.haselton@gmail.com
16+
- name: Quentin Nerden
17+
email: quentin.nerden@stylight.com
1618
engine: gotpl

incubator/fluentd-cloudwatch/README.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ This chart bootstraps a [Fluentd](https://www.fluentd.org/) [Cloudwatch](https:/
2121
To install the chart with the release name `my-release`:
2222

2323
```console
24+
$ # edit secrets/aws_access_key_id and secrets/aws_access_key_id with the key/password of a AWS user with a policy to access Cloudwatch
2425
$ helm install --name my-release incubator/fluentd-cloudwatch
2526
```
2627

@@ -42,15 +43,15 @@ The following tables lists the configurable parameters of the Fluentd Cloudwatch
4243

4344
| Parameter | Description | Default |
4445
| -------------------------- | ------------------------------------------ | ---------------------------------------------------------- |
45-
| `image` | Image | `18fgsa/fluentd-cloudwatch` |
46-
| `imageTag` | Image tag | `0.1.0` |
47-
| `imagePullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` |
46+
| `image` | Image | `fluent/fluentd-kubernetes-daemonset` |
47+
| `imageTag` | Image tag | `v0.12.33-cloudwatch` |
48+
| `imagePullPolicy` | Image pull policy | `Always` if `imageTag` is `imagePullPolicy` |
4849
| `resources.limits.cpu` | CPU limit | `100m` |
4950
| `resources.limits.memory` | Memory limit | `200Mi` |
5051
| `resources.requests.cpu` | CPU request | `100m` |
5152
| `resources.requests.memory`| Memory request | `200Mi` |
5253
| `hostNetwork` | Host network | `false` |
53-
| `annotations` | Annotations | `nil` |
54+
| `annotations` (removed for now) | Annotations | `nil` |
5455
| `awsRegion` | AWS Cloudwatch region | `us-east-1` |
5556
| `logGroupName` | AWS Cloudwatch log group | `kubernetes` |
5657

@@ -67,6 +68,3 @@ Alternatively, a YAML file that specifies the values for the above parameters ca
6768
```console
6869
$ helm install --name my-release -f values.yaml stable/fluentd-cloudwatch
6970
```
70-
71-
### ConfigMap Files
72-
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.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<AWS_ACCESS_KEY_ID>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<AWS_SECRET_ACCESS_KEY>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
To verify that Fluentd Cloudwatch has started, run:
22

3-
kubectl --namespace={{ .Release.Namespace }} get pods -l "app={{ template "fullname" . }}"
3+
kubectl --namespace={{ .Release.Namespace }} get pods -l "app={{ template "name" . }},release={{ .Release.Name }}"
44

55
THIS APPLICATION CAPTURES ALL CONSOLE OUTPUT AND FORWARDS IT TO AWS CLOUDWATCH. Anything that might be identifying,
66
including things like IP addresses, container images, and object names will NOT be anonymized.

incubator/fluentd-cloudwatch/templates/configmap.yaml

-11
This file was deleted.

incubator/fluentd-cloudwatch/templates/daemonset.yaml

+17-13
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,51 @@ kind: DaemonSet
33
metadata:
44
name: {{ template "fullname" . }}
55
labels:
6-
app: {{ template "fullname" . }}
6+
app: {{ template "name" . }}
77
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
88
heritage: "{{ .Release.Service }}"
99
release: "{{ .Release.Name }}"
1010
spec:
11-
selector:
12-
matchLabels:
13-
app: {{ template "fullname" . }}
1411
template:
1512
metadata:
1613
labels:
17-
app: {{ template "fullname" . }}
14+
app: {{ template "name" . }}
1815
release: "{{ .Release.Name }}"
1916
annotations:
2017
{{ toYaml .Values.annotations | indent 8 }}
2118
spec:
2219
containers:
23-
- name: fluentd-cloudwatch
20+
- name: {{ template "fullname" . }}
2421
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
25-
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
26-
hostNetwork: {{ default false .Values.hostNetwork }}
22+
imagePullPolicy: {{ .Values.imagePullPolicy | quote }}
23+
#hostNetwork: {{ default false .Values.hostNetwork }}
2724
env:
2825
- name: AWS_REGION
2926
value: {{ .Values.awsRegion }}
3027
- name: LOG_GROUP_NAME
3128
value: {{ .Values.logGroupName }}
29+
30+
- name: AWS_ACCESS_KEY_ID
31+
valueFrom:
32+
secretKeyRef:
33+
key: aws_access_key_id
34+
name: {{ template "fullname" . }}
35+
- name: AWS_SECRET_ACCESS_KEY
36+
valueFrom:
37+
secretKeyRef:
38+
key: aws_secret_access_key
39+
name: {{ template "fullname" . }}
40+
3241
resources:
3342
{{ toYaml .Values.resources | indent 10 }}
3443
volumeMounts:
35-
- name: config-volume
36-
mountPath: /etc/td-agent
3744
- name: varlog
3845
mountPath: /var/log
3946
- name: varlibdockercontainers
4047
mountPath: /var/lib/docker/containers
4148
readOnly: true
4249
terminationGracePeriodSeconds: 30
4350
volumes:
44-
- name: config-volume
45-
configMap:
46-
name: {{ template "fullname" . }}
4751
- name: varlog
4852
hostPath:
4953
path: /var/log
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: {{ template "fullname" . }}
5+
labels:
6+
app: {{ template "name" . }}
7+
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
8+
heritage: {{ .Release.Service }}
9+
release: {{ .Release.Name }}
10+
type: Opaque
11+
data:
12+
{{ (.Files.Glob "secrets/*").AsSecrets | indent 2 }}

0 commit comments

Comments
 (0)