Skip to content

Commit

Permalink
docs - fluentd k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
marcel-dempers committed Nov 26, 2020
1 parent eaec3a6 commit d39ea77
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ __pycache__/
.terraform
*.tfstate
*.tfstate.*
security/letsencrypt/introduction/certs/**
security/letsencrypt/introduction/certs/**
kubernetes/shipa/installs/shipa-helm-chart-1.1.1/
3 changes: 2 additions & 1 deletion monitoring/logging/fluentd/kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ This helps us prevent having a large complex file.

<br/>

We have 3 files in our `fluentd-configmap.yaml` :
We have 5 files in our `fluentd-configmap.yaml` :
* fluent.conf: Our main config which includes all other configurations
* pods-kind-fluent.conf: `tail` config that sources all pod logs on the `kind` cluster.
Note: `kind` cluster writes its log in a different format
Expand All @@ -92,6 +92,7 @@ kubectl apply -f .\monitoring\logging\fluentd\kubernetes\fluentd-configmap.yaml
Let's deploy our `daemonset`:

```
kubectl apply -f .\monitoring\logging\fluentd\kubernetes\fluentd-rbac.yaml
kubectl apply -f .\monitoring\logging\fluentd\kubernetes\fluentd.yaml
kubectl -n fluentd get pods
Expand Down
4 changes: 2 additions & 2 deletions monitoring/logging/fluentd/kubernetes/fluentd-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ data:
# This source gets all logs from local docker host
@include pods-kind-fluent.conf
#@include pods-fluent.conf
@include file-fluent.conf
#@include elastic-fluent.conf
#@include file-fluent.conf
@include elastic-fluent.conf
pods-kind-fluent.conf: |-
<source>
@type tail
Expand Down
34 changes: 34 additions & 0 deletions monitoring/logging/fluentd/kubernetes/fluentd-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: fluentd
namespace: fluentd
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: fluentd
namespace: fluentd
rules:
- apiGroups:
- ""
resources:
- pods
- namespaces
verbs:
- get
- list
- watch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: fluentd
roleRef:
kind: ClusterRole
name: fluentd
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: fluentd
namespace: fluentd
2 changes: 2 additions & 0 deletions monitoring/logging/fluentd/kubernetes/fluentd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ spec:
k8s-app: fluentd-logging
version: v1
spec:
serviceAccount: fluentd
serviceAccountName: fluentd
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
Expand Down

0 comments on commit d39ea77

Please sign in to comment.