-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) |