Kubectl

Contribute to Kubectl

Attend a sig-cli meeting

The best way to get started is to attend sig-cli meetings. The bug scrub is a great place to pick up an issue to work on.

Checking out the code

Install golang

Install the latest version of go

Get a copy of the code

Fork and clone the kubernetes repository

  1. git clone git@github.com/USER/kubernetes
  2. cd kubernetes

Build the binary

Build the binary using go build

  1. cd cmd/kubectl
  2. go build -v
  3. ./kubectl version

Edit the code

The kubectl code is under staging/src/k8s.io/kubectl.

  • Libraries are under staging/src/k8s.io/kubectl/pkg
  • Command implementations are under staging/src/k8s.io/kubectl/pkg/cmd

Learning about libraries

Kubectl uses a number of common libraries

  • cobra – a golang framework for CLIs
  • client-go – libraries for talking to the Kubernetes apiserver
  • api – Kubernetes types
  • apimachinery – Kubernetes apimachinery libraries

Additional resources