LogoLogo
5.0.X
5.0.X
  • About Trilio for Kubernetes
    • Welcome to Trilio For Kubernetes
    • Version 5.0.X Release Highlights
    • Compatibility Matrix
    • Marketplace Support
    • Features
    • Use Cases
  • Getting Started
    • Getting Started with Trilio on Red Hat OpenShift (OCP)
    • Getting Started with Trilio for Upstream Kubernetes (K8S)
    • Getting Started with Trilio for AWS Elastic Kubernetes Service (EKS)
    • Getting Started with Trilio on Google Kubernetes Engine (GKE)
    • Getting Started with Trilio on VMware Tanzu Kubernetes Grid (TKG)
    • More Trilio Supported Kubernetes Distributions
      • General Installation Prerequisites
      • Rancher Deployments
      • Azure Cloud AKS
      • Digital Ocean Cloud
      • Mirantis Kubernetes Engine
      • IBM Cloud
    • Licensing
    • Using Trilio
      • Overview
      • Post-Install Configuration
      • Management Console
        • About the UI
        • Navigating the UI
          • UI Login
          • Cluster Management (Home)
          • Backup & Recovery
            • Namespaces
              • Namespaces - Actions
              • Namespaces - Bulk Actions
            • Applications
              • Applications - Actions
              • Applications - Bulk Actions
            • Virtual Machines
              • Virtual Machine -Actions
              • Virtual Machine - Bulk Actions
            • Backup Plans
              • Create Backup Plans
              • Backup Plans - Actions
            • Targets
              • Create New Target
              • Targets - Actions
            • Hooks
              • Create Hook
              • Hooks - Actions
            • Policies
              • Create Policies
              • Policies - Actions
          • Monitoring
          • Guided Tours
        • UI How-to Guides
          • Multi-Cluster Management
          • Creating Backups
            • Pause Schedule Backups and Snapshots
            • Cancel InProgress Backups
            • Cleanup Failed Backups
          • Restoring Backups & Snapshots
            • Cross-Cluster Restores
            • Namespace & application scoped
            • Cluster scoped
          • Disaster Recovery Plan
          • Continuous Restore
      • Command-Line Interface
        • YAML Examples
        • Trilio Helm Operator Values
    • Upgrade
    • Air-Gapped Installations
    • Uninstall
  • Reference Guides
    • T4K Pod/Job Capabilities
      • Resource Quotas
    • Trilio Operator API Specifications
    • Custom Resource Definition - Application
  • Advanced Configuration
    • AWS S3 Target Permissions
    • Management Console
      • KubeConfig Authenticaton
      • Authentication Methods Via Dex
      • UI Authentication
      • RBAC Authentication
      • Configuring the UI
    • Resource Request Requirements
      • Fine Tuning Resource Requests and Limits
    • Observability
      • Observability of Trilio with Prometheus and Grafana
      • Exported Prometheus Metrics
      • Observability of Trilio with Openshift Monitoring
      • T4K Integration with Observability Stack
    • Modifying Default T4K Configuration
  • T4K Concepts
    • Supported Application Types
    • Support for Helm Releases
    • Support for OpenShift Operators
    • T4K Components
    • Backup and Restore Details
      • Immutable Backups
      • Application Centric Backups
    • Retention Process
      • Retention Use Case
    • Continuous Restore
      • Architecture and Concepts
  • Performance
    • S3 as Backup Target
      • T4K S3 Fuse Plugin performance
    • Measuring Backup Performance
  • Ecosystem
    • T4K Integration with Slack using BotKube
    • Monitoring T4K Logs using ELK Stack
    • Rancher Navigation Links for Trilio Management Console
    • Optimize T4K Backups with StormForge
    • T4K GitHub Runner
    • AWS RDS snapshots using T4K hooks
    • Deploying Trilio For Kubernetes with Openshift ACM Policies
  • Krew Plugins
    • T4K QuickStart Plugin
    • Trilio for Kubernetes Preflight Checks Plugin
    • T4K Log Collector Plugin
    • T4K Cleanup Plugin
  • Support
    • Troubleshooting Guide
    • Known Issues and Workarounds
    • Contacting Support
  • Appendix
    • Ignored Resources
    • OpenSource Software Disclosure
    • CSI Drivers
      • Installing VolumeSnapshot CRDs
      • Install AWS EBS CSI Driver
    • T4K Product Quickview
    • OpenShift OperatorHub Custom CatalogSource
      • Custom CatalogSource in a restricted environment
    • Configure OVH Object Storage as a Target
    • Connect T4K UI hosted with HTTPS to another cluster hosted with HTTP or vice versa
    • Fetch DigitalOcean Kubernetes Cluster kubeconfig for T4K UI Authentication
    • Force Update T4K Operator in Rancher Marketplace
    • Backup and Restore Virtual Machines running on OpenShift
    • T4K For Volumes with Generic Storage
    • T4K Best Practices
Powered by GitBook
On this page
  • Pre-requisites:
  • Supported OS and Architectures:
  • Installation, Upgrade, Removal of Plugins :
  • With krew:
  • Without krew:
  • Linux/macOS
  • Usage:
  • Output
  • Resources Considered for Log Collection:
  • OCP Specific Resources Considered for Log Collection:

Was this helpful?

  1. Krew Plugins

T4K Log Collector Plugin

This page describes how to setup the T4K log collector and collect logs for support analysis

PreviousTrilio for Kubernetes Preflight Checks PluginNextT4K Cleanup Plugin

Last updated 1 month ago

Was this helpful?

tvk-log-collector collects the logs, config and events of resources. Pod Logs can help you understand what is happening inside your application. The logs are particularly useful for debugging problems and monitoring cluster activity, alongside the metadata of all resources related to Trilio as either namespaced by providing namespaces name separated by comma or clustered if no namespace provided from k8s cluster for debugging k8s-triliovault application. It also collects the CRDs yaml related to T4K and zip them.

Pre-requisites:

  1. krew - kubectl-plugin manager. Install from

  2. kubectl - kubernetes command-line tool. Install from

Supported OS and Architectures:

  • linux/amd64

  • linux/x86

  • linux/arm

  • linux/arm64

  • darwin/amd64

  • darwin/arm64

  • windows/amd64

Installation, Upgrade, Removal of Plugins :

With krew:

  • Add T4K custom plugin index of krew:

    kubectl krew index add tvk-plugins https://github.com/trilioData/tvk-plugins.git
  • Installation:

    kubectl krew install tvk-plugins/tvk-log-collector
  • Upgrade:

    kubectl krew upgrade tvk-log-collector
  • Removal:

    kubectl krew uninstall tvk-log-collector

Without krew:

  1. Choose a version of log-collector plugin to install and check if release assets have log-collector plugin's package [log-collector_${version}${OS}${ARCH}.tar.gz] for your desired OS & Architecture.

    • To check OS & Architecture, execute command uname -a on linux/macOS and systeminfo on windows

  2. Set env variable version=v1.x.x [update with your desired version]. If version is not exported, latest tagged version will be considered.

Linux/macOS

  • Bash or ZSH shells

(
  set -ex; cd "$(mktemp -d)" &&
  OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
  ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
  if [[ -z ${version} ]]; then version=$(curl -s https://api.github.com/repos/trilioData/tvk-plugins/releases/latest | grep 'tag_name' | awk '{print $2}' | tr -d '",'); fi &&
  echo "Installing version=${version}" &&
  package_name="log-collector_${version}_${OS}_${ARCH}.tar.gz" &&
  curl -fsSLO "https://github.com/trilioData/tvk-plugins/releases/download/"${version}"/${package_name}" &&
  tar zxvf ${package_name} && sudo mv log-collector /usr/local/bin/kubectl-tvk_log_collector
)

Verify installation with kubectl tvk-log-collector --help

Windows

  1. Download log-collector_${version}_windows_${ARCH}.zip from the Releases page to a directory and unzip the package.

  2. Launch a command prompt (log-collector.exe).

Note for Dark Site Installation

Krew plugin installation is not required, as it is a part of Dark Site Installer Package.

Usage:

kubectl tvk-log-collector [flags]

Flags:

Parameter
Default
Description

--namespaces

[]

list of namespaces to look for resources separated by commas

--kubeconfig

~/.kube/config

path to the kubernetes config

--keep-source-folder

false

Keep source directory and Zip both

--log-level

INFO

log level for debugging ( INFO ERROR DEBUG WARNING DEBUG )

--config-file

path to config file for log collector inputs

--gvk

json string to give list of GVKs that want be collected other than log collector handles

--label-selector

json string to give list of all label selector for resources to be collected other than log collector collects

Examples

  • To collect logs & YAML from multiple namespaces (separated by commas in double quotes):

      kubectl tvk-log-collector --namespaces "<ns1>,<ns2>" --log-level info
  • To collect logs & YAML from all over the cluster:

      kubectl tvk-log-collector --log-level info
  • To collect logs with log level error and to keep the folder with & without zip:

      kubectl tvk-log-collector --keep-source-folder --log-level error
  • To collect logs by providing object gvk which log collector doesn't collect by default :

      kubectl tvk-log-collector --gvks "/v1/pod","apps//Deployment"
  • To collect object logs by providing labels which log collector doesn't collect by default :

      kubectl tvk-log-collector --labels "app=frontend,custom=label","app=backend"
  • To collect logs by providing config file :

      kubectl tvk-log-collector --config-file <path/to/config/file.yaml>

The format of data in a file should be according to the below example:

keep-source-folder: true
namespaces:
  - default
  - tvk
logLevel: INFO
kubeConfig: path/to/config
labels:
  - matchLabels:
      "app": "frontend"
      "custom": "label"
  - matchLabels:
      "app": "backend"
gvks:
  - group: ""
    version: ""
    kind: pod
  - group: apps
    version: ""
    kind: Deployment

Run a log collector with predefined values using a sample file. Download the file using below commands:

By wget

wget https://raw.githubusercontent.com/trilioData/tvk-plugins/main/docs/log-collector/sample_input.yaml

By curl

curl https://raw.githubusercontent.com/trilioData/tvk-plugins/main/docs/log-collector/sample_input.yaml -o sample_input.yaml

Output

This command will create triliovault-<date-time>.zip zip file containing cluster debugging information.

Resources Considered for Log Collection:

CustomResourceDefinition  
VolumeSnapshots  
VolumeSnapshotClass  
StorageClass  
Jobs  
Pods  
DaemonSets  
Deployments  
ReplicaSets  
StatefulSet  
PersistentVolumeClaims  
PersistentVolumes  
Services  
ServiceAccounts
Endpoints
Ingress
Events
ConfigMap
LimitRange
ResourceQuota
Role
RoleBinding
Namespaces
Nodes
ClusterRole
ClusterRoleBinding
MutatingWebhookConfiguration
ValidatingWebhookConfiguration
PersistentVolume
IngressClass

and Trilio Resources

OCP Specific Resources Considered for Log Collection:

ClusterServiceVersion  
CatalogSource
InstallPlan
OperatorCondition
Route
Subscription

List of available releases:

here
here
https://github.com/trilioData/tvk-plugins/releases