diff --git a/monitoring/logging/fluentd/kubernetes/README.md b/monitoring/logging/fluentd/kubernetes/README.md new file mode 100644 index 0000000..bbe6422 --- /dev/null +++ b/monitoring/logging/fluentd/kubernetes/README.md @@ -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)
+ +The manifests found here are purely for demo purpose.
+ +In this example I will use the most common use case and we'll break it down to get an understanding of each component. \ No newline at end of file diff --git a/monitoring/logging/fluentd/kubernetes/elastic-demo.yaml b/monitoring/logging/fluentd/kubernetes/elastic-demo.yaml new file mode 100644 index 0000000..d4cc2b2 --- /dev/null +++ b/monitoring/logging/fluentd/kubernetes/elastic-demo.yaml @@ -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 \ No newline at end of file diff --git a/monitoring/logging/fluentd/kubernetes/kibana-demo.yaml b/monitoring/logging/fluentd/kubernetes/kibana-demo.yaml new file mode 100644 index 0000000..8f63c9d --- /dev/null +++ b/monitoring/logging/fluentd/kubernetes/kibana-demo.yaml @@ -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 \ No newline at end of file