Skip to content

Commit

Permalink
Merge commit '5392413df2fc6963ea1f80a6cc88970c73abcda2' into ensure-l…
Browse files Browse the repository at this point in the history
…abeled

* commit '5392413df2fc6963ea1f80a6cc88970c73abcda2':
  Updated developer guide with additional guidance (aws#929)
  docs: use site params to reference latest release (aws#925)
  fix toolchain install for arm64 mac (aws#918)
  • Loading branch information
bdwyertech committed Dec 7, 2021
2 parents 435055b + 5392413 commit 64527ec
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 21 deletions.
7 changes: 6 additions & 1 deletion hack/toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ kubebuilder() {
KUBEBUILDER_ASSETS="/usr/local/kubebuilder"
sudo rm -rf $KUBEBUILDER_ASSETS
sudo mkdir -p $KUBEBUILDER_ASSETS
sudo mv "$(setup-envtest use -p path 1.19.x)" $KUBEBUILDER_ASSETS/bin
arch=$(go env GOARCH)
## Kubebuilder does not support darwin/arm64, so use amd64 through Rosetta instead
if [[ $(go env GOOS) == "darwin" ]] && [[ $(go env GOARCH) == "arm64" ]]; then
arch="amd64"
fi
sudo mv "$(setup-envtest use -p path 1.21.x --arch=${arch})" $KUBEBUILDER_ASSETS/bin
find $KUBEBUILDER_ASSETS
}

Expand Down
3 changes: 3 additions & 0 deletions website/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ anchor = "smart"

## Site Params
[params]

latest_release_version = "0.5.1"

copyright = "Amazon.com, Inc. or its affiliates."
# Repository configuration (URLs for in-page links to opening issues and suggesting changes)
github_repo = "https://github.com/aws/karpenter"
Expand Down
36 changes: 18 additions & 18 deletions website/content/en/docs/development-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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=<YOUR_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
```

Expand All @@ -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 \
Expand All @@ -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
```
2 changes: 1 addition & 1 deletion website/content/en/docs/getting-started/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ eksctl. Thus, we don't need the helm chart to do that.
helm repo add karpenter https://charts.karpenter.sh
helm repo update
helm upgrade --install karpenter karpenter/karpenter --namespace karpenter \
--create-namespace --set serviceAccount.create=false --version 0.5.0 \
--create-namespace --set serviceAccount.create=false --version {{< param "latest_release_version" >}} \
--set controller.clusterName=${CLUSTER_NAME} \
--set controller.clusterEndpoint=$(aws eks describe-cluster --name ${CLUSTER_NAME} --query "cluster.endpoint" --output json) \
--wait # for the defaulting webhook to install before creating a Provisioner
Expand Down
2 changes: 1 addition & 1 deletion website/content/en/docs/reinvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Happy Building 🔨!
helm repo add karpenter https://charts.karpenter.sh
helm repo update
helm upgrade --install karpenter karpenter/karpenter --namespace karpenter \
--create-namespace --set serviceAccount.create=false --version 0.5.0 \
--create-namespace --set serviceAccount.create=false --version {{< param "latest_release_version" >}} \
--set controller.clusterName=karpenter-demo \
--set controller.clusterEndpoint=$(aws eks describe-cluster --name karpenter-demo --query "cluster.endpoint" --output json) \
--wait # for the defaulting webhook to install before creating a Provisioner
Expand Down

0 comments on commit 64527ec

Please sign in to comment.