mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
fluent-k8s-wip
This commit is contained in:
parent
bbf9ee299d
commit
2b4df899b1
17
monitoring/logging/fluentd/kubernetes/README.md
Normal file
17
monitoring/logging/fluentd/kubernetes/README.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Introduction to Fluentd on Kubernetes
|
||||||
|
|
||||||
|
## We need a Kubernetes cluster
|
||||||
|
|
||||||
|
Lets create a Kubernetes cluster to play with using [kind](https://kind.sigs.k8s.io/docs/user/quick-start/)
|
||||||
|
|
||||||
|
```
|
||||||
|
kind create cluster --name fluentd --image kindest/node:v1.19.1
|
||||||
|
```
|
||||||
|
|
||||||
|
## Fluentd Manifests
|
||||||
|
|
||||||
|
I would highly recommend to use manifests from the official fluentd [github repo](https://github.com/fluent/fluentd-kubernetes-daemonset) <br/>
|
||||||
|
|
||||||
|
The manifests found here are purely for demo purpose. <br/>
|
||||||
|
|
||||||
|
In this example I will use the most common use case and we'll break it down to get an understanding of each component.
|
47
monitoring/logging/fluentd/kubernetes/elastic-demo.yaml
Normal file
47
monitoring/logging/fluentd/kubernetes/elastic-demo.yaml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: elasticsearch
|
||||||
|
labels:
|
||||||
|
app: elasticsearch
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: elasticsearch
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: elasticsearch
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: elasticsearch
|
||||||
|
image: elasticsearch:7.9.1
|
||||||
|
imagePullPolicy: IfNotExists
|
||||||
|
ports:
|
||||||
|
- containerPort: 9200
|
||||||
|
env:
|
||||||
|
- name: node.name
|
||||||
|
value: "elasticsearch"
|
||||||
|
- name: cluster.initial_master_nodes
|
||||||
|
value: "elasticsearch"
|
||||||
|
- name: bootstrap.memory_lock
|
||||||
|
value: "true"
|
||||||
|
- name: ES_JAVA_OPTS
|
||||||
|
value: "-Xms512m -Xmx512m"
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: elasticsearch
|
||||||
|
labels:
|
||||||
|
app: elasticsearch
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: elasticsearch
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
name: http
|
||||||
|
port: 9200
|
||||||
|
targetPort: 9200
|
43
monitoring/logging/fluentd/kubernetes/kibana-demo.yaml
Normal file
43
monitoring/logging/fluentd/kubernetes/kibana-demo.yaml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: kibana
|
||||||
|
labels:
|
||||||
|
app: kibana
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: kibana
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: kibana
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: kibana
|
||||||
|
image: kibana:7.9.1
|
||||||
|
imagePullPolicy: IfNotExists
|
||||||
|
ports:
|
||||||
|
- containerPort: 5601
|
||||||
|
env:
|
||||||
|
- name: ELASTICSEARCH_URL
|
||||||
|
value: "http://elasticsearch:9200"
|
||||||
|
- name: ELASTICSEARCH_HOSTS
|
||||||
|
value: "http://elasticsearch:9200"
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: kibana
|
||||||
|
labels:
|
||||||
|
app: kibana
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: kibana
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
name: http
|
||||||
|
port: 5601
|
||||||
|
targetPort: 5601
|
Loading…
x
Reference in New Issue
Block a user