diff --git a/website/content/en/docs/development-guide.md b/website/content/en/docs/development-guide.md index 85976f54ee78..921661900f91 100644 --- a/website/content/en/docs/development-guide.md +++ b/website/content/en/docs/development-guide.md @@ -8,12 +8,12 @@ weight: 80 The following tools are required for contributing to the Karpenter project. -| Package | Version | Install | -| ------------------------------------------------------------------ | -------- | ---------------------- | -| [go](https://golang.org/dl/) | v1.15.3+ | [Instructions](https://golang.org/doc/install) | -| [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) | | `brew install kubectl` | -| [helm](https://helm.sh/docs/intro/install/) | | `brew install helm` | -| Other tools | | `make toolchain` | +| Package | Version | Install | +| ------------------------------------------------------------------ | -------- | ---------------------------------------------- | +| [go](https://golang.org/dl/) | v1.15.3+ | [Instructions](https://golang.org/doc/install) | +| [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) | | `brew install kubectl` | +| [helm](https://helm.sh/docs/intro/install/) | | `brew install helm` | +| Other tools | | `make toolchain` | ## Developing @@ -38,38 +38,38 @@ make delete # Uninstall Karpenter * It's also a good idea to persist `$CLOUD_PROVIDER` in your environment variables to simplify the `make apply` command. ### Build and Deploy -``` -make dev # build and test code -kubectl create namespace karpenter # create target namespace for deployment -CLOUD_PROVIDER= make apply # deploy for your cloud provider +*Note: these commands do not rely on each other and may be executed independently* +```sh +make apply # quickly deploy changes to your cluster +make dev # run codegen, lint, and tests ``` ### Testing -``` +```sh make test # E2e correctness tests make battletest # More rigorous tests run in CI environment ``` ### Verbose Logging -```bash +```sh kubectl patch configmap config-logging -n karpenter --patch '{"data":{"loglevel.controller":"debug"}}' ``` ### Debugging Metrics OSX: -```bash +```sh open http://localhost:8080/metrics && kubectl port-forward service/karpenter-metrics -n karpenter 8080 ``` Linux: -```bash +```sh gio open http://localhost:8080/metrics && kubectl port-forward service/karpenter-metrics -n karpenter 8080 ``` ### Tailing Logs While you can tail Karpenter's logs with kubectl, there's a number of tools out there that enhance the experience. We recommend [Stern](https://pkg.go.dev/github.com/planetscale/stern#section-readme): -```bash +```sh stern -l karpenter=controller -n karpenter ``` @@ -78,13 +78,13 @@ stern -l karpenter=controller -n karpenter ### AWS Set the CLOUD_PROVIDER environment variable to build cloud provider specific packages of Karpenter. -``` +```sh export CLOUD_PROVIDER=aws ``` For local development on Karpenter you will need a Docker repo which can manage your images for Karpenter components. You can use the following command to provision an ECR repository. -``` +```sh aws ecr create-repository \ --repository-name karpenter/controller \ --image-scanning-configuration scanOnPush=true \ @@ -97,7 +97,7 @@ aws ecr create-repository \ Once you have your ECR repository provisioned, configure your Docker daemon to authenticate with your newly created repository. -``` +```sh export KO_DOCKER_REPO="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/karpenter" aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin $KO_DOCKER_REPO ```