Log Collection

The log collection script is designed to collect logs in a managed kubernetes setup. It is compatible with all mk8s environments, regardless of the cloud provider, and also retrieves logs from the backup folder.

Prerequisites: The bastion host should have kubectl and have access to the compute cluster to collect the logs.

  1. Login to bastion host.
  2. Download the helper tarball from the release portal.
  3. Execute the following command:
    ./mk8s_collect_logs.sh
    Note: The script can be run anywhere in the bastion host.
  4. Fill the interactive questions as follows:
    1. Do you want to collect logs for all plugins?
      • Answer no to collect logs for specific plugins. You will then be prompted to enter the names of the desired plugins.
      • Answer yes to collect logs for all enabled plugins.
        Note: To view all the enabled plugins in the setup, run:
        ./mk8s_collect_logs.sh -operation get-enabled-plugins
    2. Do you want to collect mongo logs?
      • Answer yes to include MongoDB logs in the collection.
      • Answer no to exclude MongoDB logs.
    3. Enter the directory to save logs:
      • The collected logs will be saved in the provided directory. If no directory is specified, the default path will be the directory where the script is executed.
    4. Enter the start date to fetch logs:
      • Enter the date from which you'd like to begin collecting logs.
    5. Enter the end date to fetch logs:
      • Enter the date until which you want to collect logs.

Alternative options: Passing Parameters via Command Line

Alternatively, you can provide the inputs as parameters instead of entering them interactively. To view the available parameters, run the command below.
./mk8s_collect_logs.sh --help