mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
wip
This commit is contained in:
parent
992d78042f
commit
eaec3a66c3
@ -92,10 +92,17 @@ kubectl apply -f .\monitoring\logging\fluentd\kubernetes\fluentd-configmap.yaml
|
|||||||
Let's deploy our `daemonset`:
|
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 apply -f .\monitoring\logging\fluentd\kubernetes\fluentd.yaml
|
||||||
|
|
||||||
kubectl -n fluentd get pods
|
kubectl -n fluentd get pods
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Let's deploy our example app that writes logs to `stdout`
|
||||||
|
|
||||||
|
```
|
||||||
|
kubectl apply -f .\monitoring\logging\fluentd\kubernetes\counter.yaml
|
||||||
|
kubectl get pods
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Demo ElasticSearch and Kibana
|
## Demo ElasticSearch and Kibana
|
||||||
|
@ -11,8 +11,8 @@ data:
|
|||||||
# This source gets all logs from local docker host
|
# This source gets all logs from local docker host
|
||||||
@include pods-kind-fluent.conf
|
@include pods-kind-fluent.conf
|
||||||
#@include pods-fluent.conf
|
#@include pods-fluent.conf
|
||||||
#@include file-fluent.conf
|
@include file-fluent.conf
|
||||||
@include elastic-fluent.conf
|
#@include elastic-fluent.conf
|
||||||
pods-kind-fluent.conf: |-
|
pods-kind-fluent.conf: |-
|
||||||
<source>
|
<source>
|
||||||
@type tail
|
@type tail
|
||||||
@ -54,6 +54,18 @@ data:
|
|||||||
time_format %Y-%m-%dT%H:%M:%S.%NZ
|
time_format %Y-%m-%dT%H:%M:%S.%NZ
|
||||||
</parse>
|
</parse>
|
||||||
</source>
|
</source>
|
||||||
|
|
||||||
|
<filter kubernetes.**>
|
||||||
|
@type kubernetes_metadata
|
||||||
|
@id filter_kube_metadata
|
||||||
|
kubernetes_url "#{ENV['FLUENT_FILTER_KUBERNETES_URL'] || 'https://' + ENV.fetch('KUBERNETES_SERVICE_HOST') + ':' + ENV.fetch('KUBERNETES_SERVICE_PORT') + '/api'}"
|
||||||
|
verify_ssl "#{ENV['KUBERNETES_VERIFY_SSL'] || true}"
|
||||||
|
ca_file "#{ENV['KUBERNETES_CA_FILE']}"
|
||||||
|
skip_labels "#{ENV['FLUENT_KUBERNETES_METADATA_SKIP_LABELS'] || 'false'}"
|
||||||
|
skip_container_metadata "#{ENV['FLUENT_KUBERNETES_METADATA_SKIP_CONTAINER_METADATA'] || 'false'}"
|
||||||
|
skip_master_url "#{ENV['FLUENT_KUBERNETES_METADATA_SKIP_MASTER_URL'] || 'false'}"
|
||||||
|
skip_namespace_metadata "#{ENV['FLUENT_KUBERNETES_METADATA_SKIP_NAMESPACE_METADATA'] || 'false'}"
|
||||||
|
</filter>
|
||||||
file-fluent.conf: |-
|
file-fluent.conf: |-
|
||||||
<match **>
|
<match **>
|
||||||
@type file
|
@type file
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
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
|
|
@ -17,8 +17,6 @@ spec:
|
|||||||
k8s-app: fluentd-logging
|
k8s-app: fluentd-logging
|
||||||
version: v1
|
version: v1
|
||||||
spec:
|
spec:
|
||||||
serviceAccount: fluentd
|
|
||||||
serviceAccountName: fluentd
|
|
||||||
tolerations:
|
tolerations:
|
||||||
- key: node-role.kubernetes.io/master
|
- key: node-role.kubernetes.io/master
|
||||||
effect: NoSchedule
|
effect: NoSchedule
|
||||||
|
Loading…
x
Reference in New Issue
Block a user