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

Commit

Permalink
added ability to use kustomize directly from the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
kungfuchicken committed May 1, 2020
1 parent 935ea27 commit d5cc1eb
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ $ kubectl create -f https://raw.githubusercontent.com/fluent/fluent-bit-kubernet
$ kubectl create -f https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/fluent-bit-role-binding.yaml
```

Alternatively, you can use [Kustomize](https://kustomize.io/), which is also built into newer versions of kubectl.

```
$ kustomize build github.com/fluent/fluent-bit-kubernetes-logging/output/kustomize | kubectl create -f -
```

#### Fluent Bit to Elasticsearch

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

Or, if you are using kustomize:

```
$ kustomize build github.com/fluent/fluent-bit-kubernetes-logging/output/elasticsearch/ | kubectl create -f -
```

#### Fluent Bit to Elasticsearch on Minikube

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

Or, if you are using kustomize:

```
$ kustomize build github.com/fluent/fluent-bit-kubernetes-logging/output/elasticsearch-minikube | kubectl create -f -
```

#### Fluent Bit to Kafka

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

Or, if you are using kustomize:

```
$ kustomize build github.com/fluent/fluent-bit-kubernetes-logging/output/kafka | kubectl create -f -
```

## Details

The default configuration of Fluent Bit makes sure of the following:
Expand Down
10 changes: 10 additions & 0 deletions output/elasticsearch-minikube/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: logging

bases:
- ../elasticsearch/

patchesStrategicMerge:
- fluent-bit-ds-minikube.yaml
11 changes: 11 additions & 0 deletions output/elasticsearch/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: logging

bases:
- ../kustomize

resources:
- fluent-bit-configmap.yaml
- fluent-bit-ds.yaml
11 changes: 11 additions & 0 deletions output/kafka/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: logging

bases:
- ../kustomize

resources:
- fluent-bit-configmap.yaml
- fluent-bit-ds.yaml
12 changes: 12 additions & 0 deletions output/kustomize/fluent-bit-role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: fluent-bit-read
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: fluent-bit-read
subjects:
- kind: ServiceAccount
name: fluent-bit
namespace: logging
10 changes: 10 additions & 0 deletions output/kustomize/fluent-bit-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: fluent-bit-read
rules:
- apiGroups: [""]
resources:
- namespaces
- pods
verbs: ["get", "list", "watch"]
5 changes: 5 additions & 0 deletions output/kustomize/fluent-bit-service-account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: fluent-bit
namespace: logging
9 changes: 9 additions & 0 deletions output/kustomize/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: logging

resources:
- fluent-bit-service-account.yaml
- fluent-bit-role.yaml
- fluent-bit-role-binding.yaml

0 comments on commit d5cc1eb

Please sign in to comment.