summaryrefslogtreecommitdiffstats
path: root/fluent-bit/examples/windows/kubernetes
diff options
context:
space:
mode:
Diffstat (limited to 'fluent-bit/examples/windows/kubernetes')
-rw-r--r--fluent-bit/examples/windows/kubernetes/README.md27
-rw-r--r--fluent-bit/examples/windows/kubernetes/configmap.yaml24
-rw-r--r--fluent-bit/examples/windows/kubernetes/deployment.yaml55
3 files changed, 106 insertions, 0 deletions
diff --git a/fluent-bit/examples/windows/kubernetes/README.md b/fluent-bit/examples/windows/kubernetes/README.md
new file mode 100644
index 000000000..f750a5d11
--- /dev/null
+++ b/fluent-bit/examples/windows/kubernetes/README.md
@@ -0,0 +1,27 @@
+# Fluent Bit running as a sidecar on Kubernetes Windows node
+
+You can test the Fluent Bit image as a sidecar on a Kubernetes Windows node as follows:
+
+```
+kubectl create namespace fluentbit
+kubectl apply -n fluentbit -f $SAMPLE_DIR\kubernetes\configmap.yaml
+kubectl apply -n fluentbit -f $SAMPLE_DIR\kubernetes\deployment.yaml
+```
+
+Ensure that the resources have been correctly deployed.
+
+```
+kubectl get pod -n fluentbit
+NAME READY STATUS RESTARTS AGE
+logging-fluentbit-sidecar-6ff8c84494-zt4ft 2/2 Running 0 31m
+
+kubectl get svc -n fluentbit
+NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
+logging-fluentbit-sidecar LoadBalancer 10.0.27.172 52.237.212.148 80:30172/TCP 126m
+```
+
+If you tail the logs on the Fluent Bit sidecar, and then explore the website running in the external ip and port 80, you should see generated logs ...
+
+```
+kubectl logs logging-fluentbit-sidecar-6ff8c84494-zt4ft -n fluentbit -c fluentbit-logger -f
+``` \ No newline at end of file
diff --git a/fluent-bit/examples/windows/kubernetes/configmap.yaml b/fluent-bit/examples/windows/kubernetes/configmap.yaml
new file mode 100644
index 000000000..18ee0b99d
--- /dev/null
+++ b/fluent-bit/examples/windows/kubernetes/configmap.yaml
@@ -0,0 +1,24 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: fluentbit-config
+data:
+ fluent-bit.conf: |-
+ [SERVICE]
+ Flush 5
+ Daemon off
+ Log_Level info
+
+ [INPUT]
+ Name tail
+ Path c:\\logs\\*.log
+ Refresh_Interval 60
+ Ignore_Older 10s
+ Rotate_Wait 5
+ DB c:\\state\\logs.db
+
+ [OUTPUT]
+ Name stdout
+ Match *
+ Format json_lines
+ json_date_format iso8601
diff --git a/fluent-bit/examples/windows/kubernetes/deployment.yaml b/fluent-bit/examples/windows/kubernetes/deployment.yaml
new file mode 100644
index 000000000..7bbf2996f
--- /dev/null
+++ b/fluent-bit/examples/windows/kubernetes/deployment.yaml
@@ -0,0 +1,55 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: logging-fluentbit-sidecar
+ labels:
+ app: logging-fluentbit-sidecar
+spec:
+ ports:
+ - name: http
+ port: 80
+ targetPort: 80
+ selector:
+ app: website
+ type: LoadBalancer
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: logging-fluentbit-sidecar
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: website
+ template:
+ metadata:
+ labels:
+ app: website
+ spec:
+ containers:
+ - name: aspnet-web
+ image: mcr.microsoft.com/dotnet/framework/samples:aspnetapp
+ volumeMounts:
+ - mountPath: c:\inetpub\logs\LogFiles\W3SVC1\
+ name: log-volume
+ - name: fluentbit-logger
+ image: fluent/fluent-bit:1.3.7-nanoserver
+ imagePullPolicy: Always
+ volumeMounts:
+ - mountPath: c:\config
+ name: config
+ - mountPath: c:\logs
+ name: log-volume
+ - mountPath: c:\state
+ name: log-state
+ volumes:
+ - name: config
+ configMap:
+ name: fluentbit-config
+ - name: log-volume
+ emptyDir: {}
+ - name: log-state
+ emptyDir: {}
+ nodeSelector:
+ beta.kubernetes.io/os: windows \ No newline at end of file