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
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.
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
To use the plugin, simply replace get subcommand with getyo in your regular kubectl get commands. For example:
kubectl getyo pods
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"