[Yandex Cloud documentation](../../../index.md) > [Yandex Managed Service for Kubernetes](../../index.md) > [Step-by-step guides](../index.md) > Installing applications from Cloud Marketplace > Installing Fluent Bit

# Installing Fluent Bit with the plugin for Yandex Cloud Logging

[Fluent Bit](https://www.fluentbit.io/) is an open-source multi-platform tool for collecting and processing logs. Fluent Bit collects, parses, and filters messages from a variety of inputs and saves them to a storage. Messages then go to the router that defines the output to send them to. Plugins are used to work with various inputs and outputs.

[The plugin for Cloud Logging](https://yandex.cloud/en/marketplace/products/yc/fluent-bit) enables you to export logs generated in a Managed Service for Kubernetes cluster, including at the [pod](../../concepts/index.md#pod) level, to [Yandex Cloud Logging](../../../logging/index.md).

## Getting started {#before-you-begin}

1. If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

   The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

1. [Create a service account](../../../iam/operations/sa/create.md) required for Fluent Bit.
1. Assign the `logging.writer` and `monitoring.editor` [roles](../../../iam/operations/sa/assign-role-for-sa.md) to the service account.
1. [Create an authorized key](../../../iam/operations/authentication/manage-access-keys.md#create-access-key) for the service account and save it to the `sa-key.json` file.

1. [Make sure](../connect/security-groups.md) the security groups for the Managed Service for Kubernetes cluster and its node groups are configured correctly. If a rule is missing, [add it](../../../vpc/operations/security-group-add-rule.md).

    {% note warning %}
    
    The configuration of security groups determines performance and availability of the cluster and the services and applications running in it.
    
    {% endnote %}

## Installation from Yandex Cloud Marketplace {#marketplace-install}

1. In the [management console](https://console.yandex.cloud), select a folder.
1. Navigate to **Managed Service for&nbsp;Kubernetes**.
1. Click the name of the Managed Service for Kubernetes cluster you need and select the ![image](../../../_assets/console-icons/shopping-cart.svg) **Marketplace** tab.
1. Under **Application available for installation**, select [Fluent Bit with the plugin for Cloud Logging](https://yandex.cloud/en/marketplace/products/yc/fluent-bit) and click **Go to install**.
1. Configure the application:
   * **Namespace**: Create a new [namespace](../../concepts/index.md#namespace), e.g., `fluent-bit-space`. If you leave the default namespace, Fluent Bit may work incorrectly.
   * **Application name**: Specify the application name.
   * **Target log group ID**: Specify the [ID of the log group](../../../logging/operations/list.md) to save Fluent Bit logs to.
   * **Cluster ID**: Specify the [Managed Service for Kubernetes cluster ID](../kubernetes-cluster/kubernetes-cluster-list.md).
   * **Service account key for Cloud Logging**: Paste the contents of the `sa-key.json` file.
1. Click **Install**.
1. Wait for the application status to change to `Deployed`.

## Installation using a Helm chart {#helm-install}

1. [Install Helm](https://helm.sh/docs/intro/install/) v3.8.0 or higher.
1. [Install kubect](https://kubernetes.io/docs/tasks/tools/install-kubectl) and [configure it to work with the new cluster](../connect/index.md#kubectl-connect).
1. To install a [Helm chart](https://helm.sh/docs/topics/charts/) with Fluent Bit, run this command:

   ```bash
   cat sa-key.json | helm registry login cr.yandex --username 'json_key' --password-stdin && \
   helm pull oci://cr.yandex/yc-marketplace/yandex-cloud/fluent-bit/charts/fluent-bit \
     --version 5.0.0 \
     --untar && \
   helm install \
     --namespace <namespace> \
     --create-namespace \
     --set loggingGroupId=<log_group_ID> \
     --set loggingFilter=<cluster_ID> \
     --set-file auth.json=sa-key.json \
     fluentbit ./fluent-bit/
   ```

   This command will also create a new namespace required for Fluent Bit.

   If you set `namespace` to the default namespace, Fluent Bit may work incorrectly. We recommend specifying a value different from all the existing namespaces, e.g., `fluent-bit-space`.

   {% note info %}
   
   If you are using a Helm version below 3.8.0, add the `export HELM_EXPERIMENTAL_OCI=1 && \` string at the beginning of the command to enable [Open Container Initiative](https://opencontainers.org/) (OCI) support in the Helm client.
   
   {% endnote %}

## Use cases {#examples}

* [Configuring Fluent Bit for Yandex Cloud Logging](../../tutorials/fluent-bit-logging.md).

## Useful links {#see-also}

* [Fluent Bit guides](https://docs.fluentbit.io/manual)
* [Cloud Logging guides](../../../logging/index.md)