Git Product home page Git Product logo

crashd-cli-plugin's Introduction

TKG Diagnostics Plugin

The Tanzu Diagnostics Plugin allows operators to collect cluster diagnostics data. The plugin uses the Crashd API to run internal script that automates the collection of diagnostics information for cluster troubleshooting.

Building and installing

make plugin-build-local: builds plugin make plugin-install-local : Installs plugin

Collecting diagnostics

By default, the diagnostics plugin will attempt to collect information from:

  • Any bootstrap cluster (with name tkg-kind-*) in kind
  • The current Tanzu management cluster
  • Any specified workload cluster
  • Any specified unmanaged cluster

For instance, the following command will collect logs, API objects, and other API server info:

tanzu diagnostics collect
2021/09/02 08:01:02 Collecting bootstrap cluster diagnostics
2021/09/02 08:01:03 Info: Found bootstrap cluster(s): ["tkg-kind-b4o9sn5948199qbgca8d"]
2021/09/02 08:01:03 Info: Bootstrap cluster: tkg-kind-b4o9sn5948199qbgca8d: capturing node logs
2021/09/02 08:01:10 Info: Capturing pod logs: cluster=tkg-kind-b4o9sn5948199qbgca8d
2021/09/02 08:01:10 Info: Capturing API objects: cluster=tkg-kind-b4o9sn5948199qbgca8d
2021/09/02 08:01:13 Info: Archiving: bootstrap.tkg-kind-b4o9sn5948199qbgca8d.diagnostics.tar.gz
2021/09/02 08:01:13 Info: Capturing management cluster diagnostics
...

The collect command collects diagnostics data and creates tarball file for each cluster type.

Collecting workload cluster diagnostics

To include diagnostics data from a managed workload cluster, simply provide its cluster name:

tanzu diagnostics collect --workload-cluster-name=wc-webtier-1

Specify the workload cluster's namespace if needed:

tanzu diagnostics collect --workload-cluster-name=wc-webtier-1 --workload-cluster-namespace="ns-webtier"

Collecting unmanaged cluster diagnostics

To get diagnostics data from a unmanaged-cluster, use the flag, the name of the cluster, and the context:

tanzu diagnostics collect --unmanaged-cluster-name kind-my-unmanaged-cluster --unmanaged-cluster-context kind-my-unmanaged-cluster

Note: The name of unmanaged-clusters provisioned with Kind (the default) will have kind- prefixed to its name.

Skipping bootstrap and management clusters

In certain instances, it may be useful to skip collection of the either the bootstrap or the management cluster. This can be done as follows:

tanzu diagnostics collect --bootstrap-cluster-skip=true --management-cluster-skip=true --workload-cluster-name=wc-webtier-1

The command above will collect diagnostics only for the specified workload cluster.

Command arguments

The following shows a list of command arguments that can be used to override default values when collecting diagnostics.

tanzu diagnostics collect --help
Collect cluster diagnostics for the specified cluster

Usage:
  tanzu diagnostics collect [flags]

Flags:
      --bootstrap-cluster-name string          A specific bootstrap cluster to diagnose
      --bootstrap-cluster-skip                 If true, skips bootstrap cluster diagnostics
  -h, --help                                   help for collect
      --management-cluster-context string      The context name of the management cluster
      --management-cluster-kubeconfig string   The management cluster config file (required)
      --management-cluster-name string         The name of the management cluster (required)
      --management-cluster-skip                If true, skips management cluster diagnostics
      --output-dir string                      Output directory for collected bundle (default "./")
      --unmanaged-cluster-context string       The context name of the unmanaged cluster
      --unmanaged-cluster-kubeconfig string    The unmanaged cluster config file (required) (default "${HOME}/.kube/config")
      --unmanaged-cluster-name string          The name for the unmanaged cluster (required)
      --work-dir string                        Working directory for collected data (default "${HOME}.config/tanzu/diagnostics")
      --workload-cluster-context string        The context name of the workload cluster
      --workload-cluster-infra string          Overrides the infrastructure type for the managed cluster (i.e. aws, azure, vsphere, etc) (default "docker")
      --workload-cluster-kubeconfig string     The workload cluster config file
      --workload-cluster-name string           The name of the managed cluster for which to collect diagnostics (required)
      --workload-cluster-namespace string      The namespace where managed workload resources are stored (default "default")

crashd-cli-plugin's People

Contributors

adisky avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.