Kubectl-explore - A kubectl plugin for fuzzy-find fields to explain.

kubectl-explore

This command is a better kubectl explain with the fuzzy-finder.

What

kubectl-explore finds fields associated with each supported API resource to explain.

Motivation

kubectl explain is already helpful, but typing the accurate path to the filed to explain is a tedious and typo-prone.

Comments
  • Unable to compile

    Unable to compile

    /usr/lib/golang/pkg/tool/linux_amd64/compile -o $WORK/b001/_pkg_.a -trimpath "$WORK/b001=>" -shared -p main -complete -installsuffix shared -buildid rMzng1wxnKdfx0-b_Hcb/rMzng1wxnKdfx0-b_Hcb -goversion go1.16.12 -D "" -importcfg $WORK/b001/importcfg -pack ./_build/src/github.com/kei6u/kubectl-explore/explorer.go ./_build/src/github.com/kei6u/kubectl-explore/main.go ./_build/src/github.com/kei6u/kubectl-explore/options.go
    # github.com/kei6u/kubectl-explore
    _build/src/github.com/kei6u/kubectl-explore/options.go:62:112: genericclioptions.NewConfigFlags(true).WithDeprecatedPasswordFlag().WithDiscoveryBurst(300).WithDiscoveryQPS undefined (type *genericclioptions.ConfigFlags has no field or method WithDiscoveryQPS)
    
  • Sorting order is unstable?

    Sorting order is unstable?

    Hi 👋 . It's a very nice tool.

    Description

    It might be a minor issue, but I just realized that the order of the results seems unstable (the order of the APIGroups is consistent, but the Resources within the APIGroup change every time). I have tested with the AKS cluster (1.22.6).

    I could only test in my local environment, but does this behavior happen in other settings? (If so, how do you think about adding sorting?)

    Try1

    $ kubectl explore
    ...
      secret
      configmap
      replicationcontroller
    > namespace
      62/62
    

    Try2

    $ kubectl explore
    ...
      limitrange
      componentstatus
      serviceaccount
    > replicationcontroller
      62/62
    

    Notes

    • The order of kubectl api-resources result is stable in my environment. The default behavior of api-resources seems to sort APIGroup and Name, as the logic sorts the results explicitly.

      • https://github.com/kubernetes/kubectl/blob/77a7b65409fc364fa3ff37060cc9342dc0527292/pkg/cmd/apiresources/apiresources.go#L202
      • https://github.com/kubernetes/kubectl/blob/77a7b65409fc364fa3ff37060cc9342dc0527292/pkg/cmd/apiresources/apiresources.go#L264
    • I just briefly tested with the following patch for sorting behavior (making the order as similar as kubectl api-resources, though the displayed order is reversed).

    diff --git a/options.go b/options.go
    index 9ac4627..2be1974 100644
    --- a/options.go
    +++ b/options.go
    @@ -3,6 +3,7 @@ package main
     import (
            "fmt"
            "os"
    +       "sort"
            "strings"
    
            "github.com/ktr0731/go-fuzzyfinder"
    @@ -164,6 +165,12 @@ func (o *Options) listGVKs() ([]schema.GroupVersionKind, error) {
                    if err != nil {
                            continue
                    }
    +
    +               sort.Slice(list.APIResources,
    +                       func(i, j int) bool {
    +                               return list.APIResources[i].Name < list.APIResources[j].Name
    +                       },
    +               )
                    for _, r := range list.APIResources {
                            gvks = append(gvks, schema.GroupVersionKind{
                                    Group:   gv.Group,
    
  • Sort a slice of GroupVersionKind in alphabetical order

    Sort a slice of GroupVersionKind in alphabetical order

    What:

    After this PR, displaying sorted kinds in alphabetical order when running kubectl explore. Screen Shot 2022-05-29 at 22 50 23

    Motivation:

    Solves https://github.com/keisku/kubectl-explore/issues/9

  • Add preview when fuzzy-finding resources

    Add preview when fuzzy-finding resources

    Motivation

    When fuzzy-finding of a resource, I couldn't tell if it was the same kind.

    What to change

    • Add preview to show Group, Version, Kind of a resource during fuzzy-finding.
    • Update demo.gif according to this change.

    Additional notes Add motivation why I created this plugin.

  • Krew Support

    Krew Support

    This pr is blocked by https://github.com/kubernetes-sigs/krew-index/pull/1891 and solves https://github.com/kei6u/kubectl-explore/issues/2

    I updated as follows.

    • Added krew-release-bot to GitHub Actions according to this yaml.
    • Added .krew.yaml for the bot above according to this .krew.yaml.
    • Edited README to add the krew installation guide.
  • Update goreleaser configuration

    Update goreleaser configuration

    I have updated goreleaser config and related with reference to the following.

    • https://github.com/ahmetb/kubectl-tree/blob/master/.github/workflows/release.yml
    • https://github.com/ahmetb/kubectl-tree/blob/master/.goreleaser.yml

    After merging this PR, I will create v0.3.2 tag.

  • fix library installation command using go install

    fix library installation command using go install

    go install can install an executable binary, but if the version suffix is missing, it tries to install the given package with module-aware mode. (ref: New module changes in Go 1.16 - The Go Programming Language)

    As a result, if the command is run outside of any Go module, it shows the below error:

    $ cd $HOME # not inside of any module
    $ go install github.com/kei6u/kubectl-explore
    go install: version is required when current directory is not in a module
    	Try 'go install github.com/kei6u/kubectl-explore@latest' to install the latest version
    

    By appending the suffix ( @0.1.0 or even @latest should be OK), it successfully installs the command.

    Another reference: Deprecation of 'go get' for installing executables - The Go Programming Language

Jun 6, 2022
The plugin serves as a starting point for writing a Mattermost plugin

Plugin Starter Template This plugin serves as a starting point for writing a Mattermost plugin. Feel free to base your own plugin off this repository.

Dec 10, 2021
Feb 10, 2022
Twitter-plugin - Falco Plugin for Twitter Stream

Twitter Plugin This repository contains the twittter plugin for Falco, which fol

Mar 17, 2022
netscanner - TCP/UDP scanner to find open or closed ports

netscanner netscanner - TCP/UDP scanner to find open or closed ports installation you have to run this command to install the program $ go get github.

Dec 19, 2022
Helps to find available slots on zh.vacme.ch corona vaccination service
Helps to find available slots on zh.vacme.ch corona vaccination service

vacme-zurich-parser https://zh.vacme.ch provides a way to register for vaccination in Zurich. Since there is not much free slots - its quite tedious t

Jan 8, 2022
red-tldr is a lightweight text search tool, which is used to help red team staff quickly find the commands and key points they want to execute, so it is more suitable for use by red team personnel with certain experience.
red-tldr is a lightweight text search tool, which is used to help red team staff quickly find the commands and key points they want to execute, so it is more suitable for use by red team personnel with certain experience.

Red Team TL;DR English | 中文简体 What is Red Team TL;DR ? red-tldr is a lightweight text search tool, which is used to help red team staff quickly find t

Jan 5, 2023
Ffind - A tool to find files of interest on a compromised host during a penetration test
Ffind - A tool to find files of interest on a compromised host during a penetration test

ffind ffind is a tool to find files of interest on a compromised host during a p

Jul 25, 2022
Quickly find all IPv6 and IPv4 hosts in a LAN.

invaentory Quickly find all IPv6 and IPv4 hosts in a LAN. Overview ?? This project is a work-in-progress! Instructions will be added as soon as it is

May 17, 2022
Commonwords - Simple cli to find words in text that are not in the 1000 most common English words

Thousand common words Find words in a text that are not in the 1000 most common

Feb 1, 2022
A Go library for connecting to HandlerSocket (github.com/ahiguti/HandlerSocket-Plugin-for-MySQL)

handlersocket-go Go library for connecting to HandlerSocket Mysql plugin. See github.com/ahiguti/HandlerSocket-Plugin-for-MySQL/ Installation $ go get

Jan 19, 2021
Yet another SIP003 plugin for shadowsocks, based on Xray-core

Yet another SIP003 plugin for shadowsocks, based on Xray-core Build go build Usage See command line args for advanced usages.

Jan 8, 2023
DipDup plugin for selective metadata indexing

DipDup metadata indexer DipDup service for indexing contract and token metadata. Based on TzKT indexer. For start synchronization of DipDup state TzKT

Nov 25, 2022
Tool for monitoring network devices (mainly using SNMP) - monitoring check plugin
Tool for monitoring network devices (mainly using SNMP) - monitoring check plugin

Thola Description A tool for monitoring network devices written in Go. It features a check mode which complies with the monitoring plugins development

Dec 29, 2022
Protoc plugin to generate contract tests for gRPC in Go

Deal - Go Introduction WE DO NOT SUPPORT THE SERVER SIDE YET This plugin allows us to write Consumer-Driver Contracts tests! Usage example Proto servi

Sep 3, 2022
This plugin allows you to start a local server with hot reloading with Esbuild

esbuild-dev-server This plugin allows you to start a local server with hot reloading with Esbuild Installation npm npm i esbuild-dev-server -D yarn y

Nov 4, 2022
A Caddy v2 plugin to track requests in Pirsch analytics

caddy-pirsch-plugin A Caddy v2 plugin to track requests in Pirsch Analytics. Usage pirsch [<matcher>] { client_id <pirsch-client-id> client_se

Sep 15, 2022
Yet another SIP003 plugin for shadowsocks, based on v2ray

Yet another SIP003 plugin for shadowsocks, based on v2ray Build go build Alternatively, you can grab the latest nightly from Circle CI by logging into

Oct 20, 2021
Naive LEGO helper for SberCloud DNS to be used with the EXEC plugin

Naive LEGO helper for SberCloud DNS Very basic, no any checks performed To be used with the exec plugin as described here Environment variables SBC_AC

Nov 3, 2021