T4K Log Collector Plugin
This page describes how to setup the T4K log collector and collect logs for support analysis
Last updated
Was this helpful?
Was this helpful?
kubectl krew index add tvk-plugins https://github.com/trilioData/tvk-plugins.gitkubectl krew install tvk-plugins/tvk-log-collectorkubectl krew upgrade tvk-log-collectorkubectl krew uninstall tvk-log-collector(
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
)kubectl tvk-log-collector [flags] kubectl tvk-log-collector --namespaces "<ns1>,<ns2>" --log-level info kubectl tvk-log-collector --log-level info kubectl tvk-log-collector --keep-source-folder --log-level error kubectl tvk-log-collector --gvks "/v1/pod","apps//Deployment" kubectl tvk-log-collector --labels "app=frontend,custom=label","app=backend" kubectl tvk-log-collector --config-file <path/to/config/file.yaml>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
wget https://raw.githubusercontent.com/trilioData/tvk-plugins/main/docs/log-collector/sample_input.yamlcurl https://raw.githubusercontent.com/trilioData/tvk-plugins/main/docs/log-collector/sample_input.yaml -o sample_input.yamlCustomResourceDefinition
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
IngressClassClusterServiceVersion
CatalogSource
InstallPlan
OperatorCondition
Route
Subscription