Skip to content

Commit

Permalink
Add kubectl contributing guide
Browse files Browse the repository at this point in the history
  • Loading branch information
pwittrock committed Nov 11, 2020
1 parent 1546d3b commit eabe0f6
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion site/content/en/contributing/kubectl/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,53 @@ weight: 1
description: >
Contribute to Kubectl
---
***Coming Soon***

## Attend a sig-cli meeting

The best way to get started is to attend [sig-cli](https://github.com/kubernetes/community/tree/master/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](https://golang.org)

### Get a copy of the code

Fork and clone the [kubernetes](https://github.com/kubernetes/kubernetes) repository

```sh
git clone [email protected]/USER/kubernetes
cd kubernetes
```

### Build the binary

Build the binary using `go build`

```sh
cd cmd/kubectl
go build -v
./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](https://github.com/spf13/cobra) -- a golang framework for CLIs
- [client-go](https://github.com/kubernetes/client-go) -- libraries for talking to the Kubernetes apiserver
- [api](https://github.com/kubernetes/api) -- Kubernetes types
- [apimachinery](https://github.com/kubernetes/apimachinery) -- Kubernetes apimachinery libraries

## Additional resources

- [Everything You Always Wanted to Know About SIG-CLI but Were Afraid to Ask](https://www.youtube.com/watch?v=QVYQUQd7prE)

0 comments on commit eabe0f6

Please sign in to comment.