This topic explains how to deploy Fluent Bit to Tanzu Kubernetes Grid (TKG) workload clusters deployed to vSphere by a vSphere with Tanzu Supervisor.
Fluent Bit is a fast, lightweight log processor and forwarder that lets you collect application data and logs from different sources, unify them, and send them to multiple destinations.
You can install Fluent Bit on a workload cluster in two ways:
Adhere to the following prerequisites.
Refer to the following topic as needed.
Complete these steps to install the Fluent Bit package.
Create the namespace for Fluent Bit.
kubectl create ns tanzu-system-logging
Get the latest Fluent Bit version available in the package repository.
kubectl -n tkg-system get packages
The latest version is 1.9.5+vmware.1-tkg.2 which is what we will install. Adjust the version as necessary to meet your requirements.
Create the fluent-bit-data-values.yaml
file using either of the following methods.
Or you can generate a fluent-bit-default-values.yaml
file.
tanzu package available get fluent-bit.tanzu.vmware.com/1.9.5+vmware.1-tkg.2 --default-values-file-output fluent-bit-data-values.yaml
Edit the fluent-bit-data-values.yaml
file and configure the values.
See Fluent Bit Configuration Parameters (Supervisor) for a full list of available parameters.
Install the Fluent Bit package using the Tanzu CLI.
tanzu package install fluent-bit -p fluent-bit.tanzu.vmware.com -v 1.9.5+vmware.1-tkg.2 --values-file fluent-bit-data-values.yaml -n tanzu-system-logging
Verify Fluent Bit installation using the Tanzu CLI.
tanzu package installed list -n tanzu-system-logging
NAME PACKAGE-NAME PACKAGE-VERSION STATUS
fluent-bit fluent-bit.tanzu.vmware.com 1.9.5+vmware.1-tkg.2 Reconcile succeeded
tanzu package installed get fluent-bit -n tanzu-system-logging
NAME: fluent-bit
PACKAGE-NAME: fluent-bit.tanzu.vmware.com
PACKAGE-VERSION: 1.9.5+vmware.1-tkg.2
STATUS: Reconcile succeeded
Verify Fluent Bit installation using Kubectl.
kubectl -n tanzu-system-logging get all
Install the Fluent Bit pacakge to collect and forward TKG cluster logs to a supported destination, including Syslog, HTTP, Elastic Search, Kafka, and Splunk.
Adhere to the following prerequisites to install the Fluent Bit package.
Refer to the following topic as needed.
Install the Fluent Bit package.
List the available Fluent Bit versions in the repository.
kubectl get packages -n tkg-system
The most current version is fluent-bit.tanzu.vmware.com.1.9.5+vmware.1-tkg.2
.
Create the fluent-bit.yaml
specification.
The following example can be used for a Syslog endpoint.
Refer to Fluent Bit Components, Configuration, Data Values for additional examples.
apiVersion: v1
kind: ServiceAccount
metadata:
name: fluentbit-sa
namespace: tkg-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: fluentbit-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: fluentbit-sa
namespace: tkg-system
---
apiVersion: packaging.carvel.dev/v1alpha1
kind: PackageInstall
metadata:
name: fluentbit
namespace: tkg-system
spec:
serviceAccountName: fluentbit-sa
packageRef:
refName: fluentbit.tanzu.vmware.com
versionSelection:
constraints: 1.9.5+vmware.1-tkg.2
values:
- secretRef:
name: fluentbit-data-values
---
apiVersion: v1
kind: Secret
metadata:
name: fluentbit-data-values
namespace: tkg-system
stringData:
values.yml: |
---
namespace: fluentbit-logging
tkg:
instance_name: "<TKG_INSTANCE_NAME>"
cluster_name: "<CLUSTER_NAME>"
fluentbit:
pspNames: "vmware-system-restricted"
output_plugin: "syslog"
syslog:
host: "<SYSLOG_HOST>"
port: "<SYSLOG_PORT>"
mode: "<SYSLOG_MODE>"
format: "<SYSLOG_FORMAT>"
Customize the fluentbit-data-values
section of the fluent-bit.yaml
specification with appropriate values for your environment. For example:
...
---
namespace: fluentbit-logging
tkg:
instance_name: "tkg-2.2"
cluster_name: "tkgs-cluster-9"
fluentbit:
pspNames: "vmware-system-restricted"
output_plugin: "syslog"
syslog:
host: "10.182.176.50"
port: "514"
mode: "tcp"
format: "rfc5424"
See Fluent Bit Configuration Parameters (Supervisor) for a full list of available parameters.
Install the Fluent Bit package.
kubectl apply -f fluentbit.yaml
Verify Fluent Bit installation.
kubectl get all -n fluentbit-logging