fluent-k8s-wip

This commit is contained in:
marcel-dempers 2020-11-08 09:10:40 +11:00 committed by Marcel Dempers
parent bbf9ee299d
commit 2b4df899b1
3 changed files with 107 additions and 0 deletions

View 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.

View 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

View 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