Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.

Commit d5cc1eb

Browse files
committed
added ability to use kustomize directly from the repo
1 parent 935ea27 commit d5cc1eb

File tree

9 files changed

+92
-0
lines changed

9 files changed

+92
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ $ kubectl create -f https://raw.githubusercontent.com/fluent/fluent-bit-kubernet
2121
$ kubectl create -f https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/fluent-bit-role-binding.yaml
2222
```
2323

24+
Alternatively, you can use [Kustomize](https://kustomize.io/), which is also built into newer versions of kubectl.
25+
26+
```
27+
$ kustomize build github.com/fluent/fluent-bit-kubernetes-logging/output/kustomize | kubectl create -f -
28+
```
29+
2430
#### Fluent Bit to Elasticsearch
2531

2632
The next step is to create a ConfigMap that will be used by our Fluent Bit DaemonSet:
@@ -35,6 +41,12 @@ Fluent Bit DaemonSet ready to be used with Elasticsearch on a normal Kubernetes
3541
$ kubectl create -f https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/output/elasticsearch/fluent-bit-ds.yaml
3642
```
3743

44+
Or, if you are using kustomize:
45+
46+
```
47+
$ kustomize build github.com/fluent/fluent-bit-kubernetes-logging/output/elasticsearch/ | kubectl create -f -
48+
```
49+
3850
#### Fluent Bit to Elasticsearch on Minikube
3951

4052
If you are using Minikube for testing purposes, use the following alternative DaemonSet manifest:
@@ -43,6 +55,12 @@ If you are using Minikube for testing purposes, use the following alternative Da
4355
$ kubectl create -f https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/output/elasticsearch/fluent-bit-ds-minikube.yaml
4456
```
4557

58+
Or, if you are using kustomize:
59+
60+
```
61+
$ kustomize build github.com/fluent/fluent-bit-kubernetes-logging/output/elasticsearch-minikube | kubectl create -f -
62+
```
63+
4664
#### Fluent Bit to Kafka
4765

4866
Create a ConfigMap that will be used by our Fluent Bit DaemonSet:
@@ -57,6 +75,12 @@ Fluent Bit DaemonSet ready to be used with Kafka on a normal Kubernetes Cluster:
5775
$ kubectl create -f https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/output/kafka/fluent-bit-ds.yaml
5876
```
5977

78+
Or, if you are using kustomize:
79+
80+
```
81+
$ kustomize build github.com/fluent/fluent-bit-kubernetes-logging/output/kafka | kubectl create -f -
82+
```
83+
6084
## Details
6185

6286
The default configuration of Fluent Bit makes sure of the following:
File renamed without changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
namespace: logging
5+
6+
bases:
7+
- ../elasticsearch/
8+
9+
patchesStrategicMerge:
10+
- fluent-bit-ds-minikube.yaml
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
namespace: logging
5+
6+
bases:
7+
- ../kustomize
8+
9+
resources:
10+
- fluent-bit-configmap.yaml
11+
- fluent-bit-ds.yaml

output/kafka/kustomization.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
namespace: logging
5+
6+
bases:
7+
- ../kustomize
8+
9+
resources:
10+
- fluent-bit-configmap.yaml
11+
- fluent-bit-ds.yaml
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: rbac.authorization.k8s.io/v1beta1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
name: fluent-bit-read
5+
roleRef:
6+
apiGroup: rbac.authorization.k8s.io
7+
kind: ClusterRole
8+
name: fluent-bit-read
9+
subjects:
10+
- kind: ServiceAccount
11+
name: fluent-bit
12+
namespace: logging
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: rbac.authorization.k8s.io/v1beta1
2+
kind: ClusterRole
3+
metadata:
4+
name: fluent-bit-read
5+
rules:
6+
- apiGroups: [""]
7+
resources:
8+
- namespaces
9+
- pods
10+
verbs: ["get", "list", "watch"]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: fluent-bit
5+
namespace: logging
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
namespace: logging
5+
6+
resources:
7+
- fluent-bit-service-account.yaml
8+
- fluent-bit-role.yaml
9+
- fluent-bit-role-binding.yaml

0 commit comments

Comments
 (0)