Skip to content

A simple kubectl plugin that orders fields in status condition

License

Notifications You must be signed in to change notification settings

raghavendra-talur/kubectl-getyo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

kubectl-getyo

A simple kubectl plugin that provides alternative get command that shows the yaml formatted output with some modifications. Modifications:

  • type as the first field in the status condition

Prerequisites

Before you begin, ensure you have the following installed on your system:

  • kubectl - Kubernetes command-line tool that allows you to run commands against Kubernetes clusters.
  • yq (version 4.x or higher) - A portable command-line YAML, JSON, and XML processor.

Installation

To install the kubectl-getyo plugin, follow these steps:

Clone the repository:

git clone https://github.com/raghavendra-talur/kubectl-getyo.git

Copy the script to a directory in your PATH:

sudo cp kubectl-getyo/kubectl-getyo /usr/local/bin

Usage

To use the plugin, simply replace get subcommand with getyo in your regular kubectl get commands. For example:

kubectl getyo pods

Sample output

Status condition with the get subcommand

  status:
    conditions:
    - lastProbeTime: null
      lastTransitionTime: "2024-04-10T01:30:36Z"
      status: "True"
      type: Initialized
    - lastProbeTime: null
      lastTransitionTime: "2024-04-10T01:30:43Z"
      status: "True"
      type: Ready
    - lastProbeTime: null
      lastTransitionTime: "2024-04-10T01:30:43Z"
      status: "True"
      type: ContainersReady
    - lastProbeTime: null
      lastTransitionTime: "2024-04-10T01:30:36Z"
      status: "True"
      type: PodScheduled

Status condition with the getyo subcommand

  status:
    conditions:
    - type: Initialized
      lastProbeTime: null
      lastTransitionTime: "2024-04-10T01:30:36Z"
      status: "True"
    - type: Ready
      lastProbeTime: null
      lastTransitionTime: "2024-04-10T01:30:43Z"
      status: "True"
    - type: ContainersReady
      lastProbeTime: null
      lastTransitionTime: "2024-04-10T01:30:43Z"
      status: "True"
    - type: PodScheduled
      lastProbeTime: null
      lastTransitionTime: "2024-04-10T01:30:36Z"
      status: "True"

About

A simple kubectl plugin that orders fields in status condition

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages