Install Fluent Bit in Workload Clusters Deployed by a Standalone Management Cluster

This topic explains how to deploy Fluent Bit into a standalone management or workload cluster in Tanzu Kubernetes Grid.

Fluent Bit is a lightweight log processor and forwarder. The Fluent Bit implementation provided in this release of Tanzu Kubernetes Grid allows you to collect logs from clusters running on vSphere 8, Amazon Web Services (AWS), and Azure. You can then forward them to a log storage provider such as Elastic Search, Kafka, Splunk, or an HTTP endpoint.

You can deploy Fluent Bit on any standalone management cluster or workload cluster from which you want to collect logs. First, you configure an output plugin on the cluster from which you want to gather logs, depending on the endpoint that you use. Then, you deploy Fluent Bit on the cluster.

Prerequisites

Note

As of v2.5, TKG does not support clusters on AWS or Azure. See the End of Support for TKG Management and Workload Clusters on AWS and Azure in the Tanzu Kubernetes Grid v2.5 Release Notes.

Prepare the Cluster for Fluent Bit Deployment

Note

You must deploy Fluent Bit on each cluster from which you want to collect logs.

To prepare the cluster:

  1. Get the admin credentials of the cluster into which you want to deploy Fluent Bit. For example:

    tanzu cluster kubeconfig get my-cluster --admin
    
  2. Set the context of kubectl to the cluster. For example:

    kubectl config use-context my-cluster-admin@my-cluster
    

Deploy Fluent Bit on a Cluster

Follow the procedure below to deploy Fluent Bit on a cluster:

  1. If the cluster does not have a package repository with the Fluent Bit package installed, such as the tanzu-standard repository, install one:

    tanzu package repository add PACKAGE-REPO-NAME --url PACKAGE-REPO-ENDPOINT --namespace tkg-system
    

    Where:

    • PACKAGE-REPO-NAME is the name of the package repository, such as tanzu-standard or the name of a private image registry configured with ADDITIONAL_IMAGE_REGISTRY variables.
    • PACKAGE-REPO-ENDPOINT is the URL of the package repository.

      • For TKG v2.5.1 release, the tanzu-standard URL is projects.registry.vmware.com/tkg/packages/standard/repo:v2024.4.12. See List Package Repositories to obtain this value from the Tanzu CLI, or in Tanzu Mission Control see the Addons > Repositories list in the Cluster pane.
  2. If you have not already done so, install cert-manager in the cluster. For instructions, see Install Cert Manager for Certificate Management.

  3. Confirm that the Fluent Bit package is available in your cluster:

    tanzu package available list -A
    
  4. Retrieve the version of the available package:

    tanzu package available list fluent-bit.tanzu.vmware.com -A
    
  5. Prepare a configuration file for the Fluent Bit package:

    1. Retrieve the default configuration of the package:

      tanzu package available get fluent-bit.tanzu.vmware.com/PACKAGE-VERSION --default-values-file-output FILE-PATH
      

      Where PACKAGE-VERSION is the version of the Fluent Bit package that you want to install and FILE-PATH is the location to which you want to save the configuration file, for example, fluent-bit-data-values.yaml.

    2. Based on the log management backend you want to configure, add one or more [Output] configurations to the fluent_bit.config.outputs key in the fluent-bit-data-values.yaml file.

    3. Review and if needed, modify other configuration parameters. See Fluent Bit Configuration Parameters (Standalone MC) for a full list of available parameters.

  6. After you prepare your fluent-bit-data-values.yaml file, remove all comments in the file:

    yq -i eval '... comments=""' fluent-bit-data-values.yaml
    
  7. Run tanzu package install to deploy the package:

    tanzu package install fluent-bit \
    --package fluent-bit.tanzu.vmware.com \
    --version AVAILABLE-PACKAGE-VERSION \
    --values-file fluent-bit-data-values.yaml \
    --namespace TARGET-NAMESPACE
    

    Where:

    • TARGET-NAMESPACE is the namespace in which you want to install the Fluent Bit package. For example, the my-packages namespace.

      • If the --namespace flag is not specified, the Tanzu CLI uses the default namespace. The Fluent Bit pods and any other resources associated with the Fluent Bit component are created in the namespace that you provided in fluent-bit-data-values.yaml; do not install the Fluent Bit package into this namespace.
      • The specified namespace must already exist, for example from running kubectl create namespace my-packages.
    • AVAILABLE-PACKAGE-VERSION is the version that you retrieved by running tanzu package available above.

    For example:

    tanzu package install fluent-bit --package fluent-bit.tanzu.vmware.com --namespace my-packages --version 2.1.6+vmware.1-tkg.1
    

Verify Fluent Bit Deployment

After you deploy Fluent Bit, you can verify that the deployment is successful:

  1. Confirm that the fluent-bit package is installed. For example:

    tanzu package installed list -A
    

    The fluent-bit package and the fluent-bit app are installed in the namespace that you specify when running the tanzu package install command.

  2. Confirm that the fluent-bit app is successfully reconciled in your AVAILABLE-PACKAGE-NAMESPACE:

    kubectl get apps -A
    

    If the status is not Reconcile succeeded, view the full status details of the fluent-bit app. Viewing the full status can help you troubleshoot the problem:

    kubectl get app fluent-bit --namespace AVAILABLE-PACKAGE-NAMESPACE -o yaml
    

    Where AVAILABLE-PACKAGE-NAMESPACE is the namespace in which you installed the package.

  3. Confirm that the new services are running by listing all of the pods that are running in the cluster:

    kubectl get pods -A
    

    In the tanzu-system-logging namespace, you should see the fluent-bit service running in a pod:

    NAMESPACE               NAME                     READY   STATUS    RESTARTS   AGE
    [...]
    tanzu-system-logging    fluent-bit-zd2tn         1/1     Running   0          6m23s
    [...]
    

    The Fluent Bit pods and any other resources associated with the Fluent Bit component are created in the namespace you provided in the fluent-bit-data-values.yaml file. If you are using the default namespace, these are created in the tanzu-system-logging namespace.

Update a Running Fluent Bit Deployment

To make changes to the configuration of the Fluent Bit package after deployment, update your deployed Fluent Bit package:

  1. Update the Fluent Bit configuration in the fluent-bit-data-values.yaml file.

  2. Update the installed package:

    tanzu package installed update fluent-bit \
    --version 2.1.6+vmware.1-tkg.1 \
    --values-file fluent-bit-data-values.yaml \
    --namespace my-packages
    

    Expected output:

    | Updating package 'fluent-bit'
    - Getting package install for 'fluent-bit'
    | Updating secret 'fluent-bit-my-packages-values'
    | Updating package install for 'fluent-bit'
    
     Updated package install 'fluent-bit' in namespace 'my-packages'
    

The Fluent Bit package is reconciled using the new value or values that you added. It can take up to five minutes for kapp-controller to apply the changes.

For information about updating, see Update a Package.

Delete a Fluent Bit Deployment

To remove the Fluent Bit package on your cluster, run:

tanzu package installed delete fluent-bit --namespace my-packages

For information about deleting, see Delete a Package.

check-circle-line exclamation-circle-line close-line
Scroll to top icon