CNCF
  • README.md
  • Cloud Native
    • All
      • CNCF Graduated Projects(Updated: Mar 01, 2024)
    • Kubernetes (*k8s)
      • Certifications
        • CKA, CKAD, CKS - Jan 03 2022
        • Check Badge
        • LF Certification Verify tool
        • Renew policy (Aug 2, 2021)
      • Versions
        • Native-k8s(Ubuntu) - Dec 12 2023
        • Native-k8s(CentOS) - Dec 12 2023
        • Kubernetes version graph view
        • GKE (Google Kuberntes Engine) - Jun 14 2021
      • Volumes
        • GKE PVC Resize
        • Storageclassses Performace on Managed k8s
      • Registry
        • GCR Performance
      • Observability
        • Pixie
      • Architecture
        • kubectl get componentstatuses
        • Feature Gate
        • CNCF 플랫폼 백서(White Paper)
      • Plugins
        • krew
          • custom-index
    • Service Mesh
      • Linkerd
      • Istio
        • Ambient Mesh
          • 이스티오(Istio)의 앰비언트 메시 소개
    • Security
      • Resources
        • kubesec
      • Node
        • AppArmor (under construction)
        • falco (under contruction)
        • docker-bench
      • Cluster
        • OPA / Gatekeeper (under cstrc)
        • Audit Policy
        • kube-bench
      • Container
        • trivy
    • Sustainability
      • 클라우드 네이티브의 지속가능성 랜드스케이프(Cloud Native Sustainability Landscape, v0.1)
  • Trouble Shooting
    • Cluster Build
      • kubelet is not properly working on 1.22 version
  • BLOG & NEWS (Ko, 한국어 기계 번역)
    • Blog
      • None
        • 4개의 쿠버네티스 정책(Policy) 타입(2023.03.23)
      • Member
        • Kubernetes 규정 준수를 위한 필수 가이드(2023.03.24)
        • 클라우드 네이티브 가드레일이 개발 팀에 도움이 되는 5가지 이유(2023.03.20)
        • OpenTelemetry를 이용한 Kafka 기반의 비동기 워크플로우 테스트(2023.04.04)
        • 링커드(Linkerd) 서비스 메시(Service Mesh) 소개(2023.04.06)
        • 쿠버네티스 앱의 분산 추적에 관해서 지금 알면 좋은 사항(2023.03.29)
        • CI/CD 파이프라인에 관측 가능성(observability)을 확보하는 방법(2023.05.05)
      • Community
        • 클라우드 네이티브 컴퓨팅을 위한 플랫폼 백서(White Paper) 소개(2023.04.11)
      • Project
        • KubeVela: 클라우드 네이티브 애플리케이션 및 플랫폼 엔지니어링으로 가는 길(2023.03.31)
        • Volcano Engine: Dragonfly를 통한 효과적인 이미지 배포 가속 방법(2023.04.13)
        • Weave GitOps를 Flux UI로 구현하는 법(2023.04.24)
        • 이스티오(Istio) 앰비언트(Ambient) 웨이포인트 프록시를 통한 사용 간편화(2023.04.26)
      • Ambassador
        • 오픈소스 프로젝트를 위한 ChatGPT 기반 코드 리뷰어 봇(Bot) (2023.06.06)
        • 입문자를 위한 MLOps: MLOps 시작하기 (2023.06.22)
    • News
Powered by GitBook
On this page
  • 0.Pre-requirement
  • 1.Build your own plugin files
  • 1-1.Executable file
  • 1-2.LICENSE
  • 1-3.Achieving files
  • 1-4.Upload achieved file your repo's releases
  • 1-5.make manifest file
  • 1-6.Check Validation
  • 2.Publish your files
  • 2-1.Create REPO like this tree structure.
  • 2-2.Check your upload files to your system :)

Was this helpful?

  1. Cloud Native
  2. Kubernetes (*k8s)
  3. Plugins
  4. krew

custom-index

https://github.com/sysnet4admin/custom-index

PreviouskrewNextService Mesh

Last updated 4 years ago

Was this helpful?

0.Pre-requirement

krew installed on your system and make permanent export to avoid your bothering.

If you have any kind of issue you would be destroy it. uninstall is best solution most of times.

Note: This document based on this document. So I recommend to read both.

1.Build your own plugin files

1-1.Executable file

<snipped> <snipped> 

main() {
  # avoid chaos history 
  unset HISTFILE
  
  # create ctxon working directory & kubectxon as well 
  set_env

  # backup history forcely 
  \cp -rf $historyPATH $HOME/.ctxon/.backup_history	

  pass_kubectl
  ARGS=${@:1}

  if [[ "$#" -eq 0 ]]; then
    ARG1="default" 
    toggle_ctxon
    exit 0
  elif [[ "$1" == "-h" || "$1" == "--help" ]]; then
    usage
    exit 0
  elif [[ "$1" == "uninstall" ]]; then
    unset_env
    exit 0
  elif (( $1 >= 30 && $1 <= 37 || $1 >=40 && $1 <=47 )); then
    ARG1="$1"	  
    toggle_ctxon
    exit 0 
  else
    echo "$ARGS Option Not Supported"	 
    exit 1  
  fi

  # history recovery and up all 
  echo $historyPATH
  mv $HOME/.ctxon/.backup_history $historyPATH
  history -c; history -r $historyPATH
  set HISTFILE
}

main "$@"

1-2.LICENSE

1-3.Achieving files

Both tar.gz or zip are okay. so you could use as your preference.

$ tar cvfz kubectxon_v0.0.3_linux_arm64.tar.gz kubectxon LICENSE

1-4.Upload achieved file your repo's releases

1-5.make manifest file

apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
  name: ctxon
spec:
  platforms:
  - sha256: 64e336dca2d0d152687b6d837ae5d1d05b59ca409064056f4cb2598ca00fe764
    uri: https://github.com/sysnet4admin/kubectxon/releases/download/v0.0.3/kubectxon_v0.0.3_linux_arm64.tar.gz
    bin: kubectxon
    files:
    - from: "kubectxon"
      to: "."
    - from: "LICENSE"
      to: "."
    selector:
      matchExpressions:
      - {key: os, operator: In, values: [darwin,linux]}
  version: "v0.0.3"
  homepage: https://github.com/sysnet4admin/kubectxon
  shortDescription: Easy to check active-context in kubernetes thru the prompt

1-6.Check Validation

It can check automatically (especially sha256), so you could verify and modify as this guideline.

$ kubectl krew install --manifest=ctxon.yaml --archive=kubectxon_v0.0.3_linux_arm64.tar.gz
Installing plugin: ctxon
W0512 14:12:58.127870   48774 install.go:164] failed to install plugin "ctxon": install failed: failed to unpack into staging dir: failed to unpack the plugin archive: checksum does not match, want: 48ff5e51920b76506f99e18ff927a6b79a354d306e3cb0063af6517b53c605cb, got 64e336dca2d0d152687b6d837ae5d1d05b59ca409064056f4cb2598ca00fe764
F0512 14:12:58.127999   48774 root.go:79] failed to install some plugins: [ctxon]: install failed: failed to unpack into staging dir: failed to unpack the plugin archive: checksum does not match, want: 48ff5e51920b76506f99e18ff927a6b79a354d306e3cb0063af6517b53c605cb, got 64e336dca2d0d152687b6d837ae5d1d05b59ca409064056f4cb2598ca00fe764

2.Publish your files

2-1.Create REPO like this tree structure.

i.e. manifest files should locate in plugins folder from main.

plugins folder have actual manifests. so upload your manifest in plugins folder

2-2.Check your upload files to your system :)

Here is the procedure of installation. it should work if you have no issue until here.

See ya!!!

Here is file. it has this code as a bash.

Here is file. it is MIT.

Here is ctxon.yaml file. it needs to create in LOCAL first

Here is some error on sha256, so I changed as this guideline. or you could make it before showing this error. link.

it is same methodology from default ()

SAMPLE
SAMPLE
SAMPLE
online-sha256
krew-index
Installing · Krew
Logo
Uninstalling Krew · Krew
Logo
Using Custom Plugin Indexes · Krew
Testing plugin installation locally · Krew
GitHub - sysnet4admin/custom-index: custom-index for kubernetes's krewGitHub
custom-index/plugins at master · sysnet4admin/custom-indexGitHub
Logo
Logo
Logo
Logo