posh-providers/kubernets/kubectl
Kevin Franklin Kim 4588a19b45
feat: add schema
2025-04-04 16:44:08 +02:00
..
cluster.go feat: update tools 2023-05-25 10:03:43 +02:00
config_test.go feat: add schema 2025-04-04 16:44:08 +02:00
config.go feat: add initial providers 2023-01-27 11:15:32 +01:00
config.schema.json feat: add schema 2025-04-04 16:44:08 +02:00
kubectl.go feat(kubernetes/kubectl): add config getter 2024-07-30 15:38:33 +02:00
README.md docs: update READMEs 2025-02-21 11:44:54 +01:00

POSH kubectl provider

Usage

Plugin

package main

type Plugin struct {
  l        log.Logger
  cache    cache.Cache
  kubectl  *kubectl.Kubectl
  commands command.Commands
}

func New(l log.Logger) (plugin.Plugin, error) {
  var err error
  inst := &Plugin{
    l:        l,
    cache:    &cache.MemoryCache{},
    commands: command.Commands{},
  }

  // ...

  inst.kubectl, err = kubectl.New(l, inst.c)
  if err != nil {
    return nil, errors.Wrap(err, "failed to create kubectl")
  }

  // ...

  return inst, nil
}

Config

## kubectl
kubectl:
  configPath: .posh/config/kubectl

Ownbrew

To install binary locally, add:

ownbrew:
  packages:
    ## https://kubernetes.io/releases/
    - name: kubectl
      tap: foomo/tap/kubernetes/kubectl
      version: 1.28.4