Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add website #1

Merged
merged 15 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ go.work.sum
/logs
# Project Specific
*.csv

# Local Netlify folder
.netlify
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing
# Contributing Legal Notices

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SYSTEM_NAMESPACE ?= karpenter

# Common Directories
# TODO: revisit testing tools (temporarily excluded here, for make verify)
MOD_DIRS = $(shell find . -name go.mod -type f ! -path "./test/*" | xargs dirname)
MOD_DIRS = $(shell find . -path "./website" -prune -o -name go.mod -type f -print | xargs dirname)
KARPENTER_CORE_DIR = $(shell go list -m -f '{{ .Dir }}' github.com/aws/karpenter-core)

# TEST_SUITE enables you to select a specific test suite directory to run "make e2etests" or "make test" against
Expand Down Expand Up @@ -96,6 +96,9 @@ codegen: ## Auto generate files based on Azure API responses
toolchain: ## Install developer toolchain
./hack/toolchain.sh

website: ## Serve the docs website locally
cd website && npm install && hugo mod tidy && hugo server

tidy: ## Recursively "go mod tidy" on all directories where go.mod exists
$(foreach dir,$(MOD_DIRS),cd $(dir) && go mod tidy $(newline))

Expand Down
52 changes: 11 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,25 @@

The AKS Karpenter Provider enables node autoprovisioning using [Karpenter](https://karpenter.sh/) on your AKS cluster.

## Status of Project:

The API for AKS Karpenter Provider is currently alpha (`v1alpha2`).

## Development

A [GitHub Codespaces]((https://github.com/features/codespaces)) development flow is described below, which you can use to test karpenter functionality on your own cluster, and to aid rapid development of this project.

1. **Install VSCode**: Go [here](https://code.visualstudio.com/download) to download VSCode for your platform. After installation, in your VSCode app install the "GitHub Codespaces" Extension. See [here](https://code.visualstudio.com/docs/remote/codespaces) for more information about this extension.

2. **Create Codespace** (~2min): In browser, click Code / "Create a codespace on main" (for better experience customize to use 4cores/8GB), wait for codespace to be created. It is created with everything needed for development (Go, Azure CLI, kubectl, skaffold, useful plugins, etc.) Now you can open up the Codespace in VSCode: Click on Codespaces in the lower left corner in the browser status bar region, choose "Open in VSCode Desktop". (Pretty much everything except for `az login` and some `az role assignment` works in browser; but VSCode is a better experience anyway.)

More information on GitHub Codespaces is [here](https://github.com/features/codespaces).

3. **Provision cluster, build and deploy Karpenter** (~5min): Set `AZURE_SUBSCRIPTION_ID` to your subscription (and customize region in `Makefile-az.mk` if desired). Then at the VSCode command line run `make az-all`. This logs into Azure (follow the prompts), provisions AKS and ACR (using resource group `$CODESPACE_NAME`, so everything is unique / scoped to codespace), builds and deploys Karpenter, deploys sample `default` Provisioner and `inflate` Deployment workload.
See the local development guide [website](#) or [local repo link](./website/content/en/docs/contributing/development-guide.md).

Manually scale the `inflate` Deployment workload, watch Karpenter controller log and Nodes in the cluster. Explore further with `make help` (mostly `az-*` targets).
Karpenter is an open-source node provisioning project built for Kubernetes.
Karpenter improves the efficiency and cost of running workloads on Kubernetes clusters by:

To debug Karpenter in-cluster, use `make az-debug`, wait for it to deploy, and attach from VSCode using Start Debugging (F5). After that you should be able to set breakpoints, examine variables, single step, etc. (Behind the scenes, besides building and deploying Karpenter, `skaffold debug` automatically and transparently applies the necessary flags during build, instruments the deployment with Delve, adjusts health probe timeouts - to allow for delays introduced by breakpoints, sets up port-forwarding, etc.; more on how this works is [here](https://skaffold.dev/docs/workflows/debug/).
* **Watching** for pods that the Kubernetes scheduler has marked as unschedulable
* **Evaluating** scheduling constraints (resource requests, nodeselectors, affinities, tolerations, and topology spread constraints) requested by the pods
* **Provisioning** nodes that meet the requirements of the pods
* **Removing** the nodes when the nodes are no longer needed

Once done, you can delete all infra with `make az-rmrg` (it deletes the resource group), and can delete the codespace (though it will be automatically suspended when not used, and deleted after 30 days.)
To learn more about karpenter generally, visit the [website](https://karpenter.sh/).

#### Developer notes
- During step 1 you will observe `Running postCreateCommand...` which takes ~10+ minutes. You don't have to wait for it to finish to proceed to step 2.
- The following errors can be ignored during step 2:
### Community

```
ERRO[0007] gcloud binary not found
...
ERRO[0003] gcloud binary not found
...
ERRO[0187] walk.go:74: found symbolic link in path: /workspaces/karpenter/charts/karpenter/crds resolves to /workspaces/karpenter/pkg/apis/crds. Contents of linked file included and used  subtask=0 task=Render
```
- If you see platform architecture error during `skaffold debug`, adjust (or comment out) `--platform` argument.
- If you are not able to set/hit breakpoints, it could be an issue with source paths mapping; see comments in debug launch configuration (`launch.json`)
Come discuss Karpenter in the [#karpenter](https://kubernetes.slack.com/archives/C02SFFZSA2K) channel in the [Kubernetes slack](https://slack.k8s.io/)!

#### FAQs
### FAQs

Q: I was able to trigger Karpenter to execute scaling up nodes as expected, using my own customized deployment of pods. However, scaling down was not handled automatically when I removed the deployment. The two new nodes created by Karpenter were left around. What is going on?

Expand All @@ -59,14 +41,6 @@ A: Oftentimes, especially for pre-existing tests, running `make toolchain` will

---

Karpenter is an open-source node provisioning project built for Kubernetes.
Karpenter improves the efficiency and cost of running workloads on Kubernetes clusters by:

* **Watching** for pods that the Kubernetes scheduler has marked as unschedulable
* **Evaluating** scheduling constraints (resource requests, nodeselectors, affinities, tolerations, and topology spread constraints) requested by the pods
* **Provisioning** nodes that meet the requirements of the pods
* **Removing** the nodes when the nodes are no longer needed

### Source Attribution

Notice: Files in this source code originated from a fork of https://github.com/aws/karpenter
Expand All @@ -81,7 +55,3 @@ Many thanks to @Bryce-Soghigian, @rakechill, @charliedmcb, @jackfrancis, @comtal
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

Come discuss Karpenter in the [#karpenter](https://kubernetes.slack.com/archives/C02SFFZSA2K) channel in the [Kubernetes slack](https://slack.k8s.io/)!

Check out the [Docs](https://karpenter.sh/) to learn more.
7 changes: 0 additions & 7 deletions designs/README.md

This file was deleted.

4 changes: 4 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.hugo_build.lock
node_modules
resources
public
1 change: 1 addition & 0 deletions website/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
6 changes: 6 additions & 0 deletions website/assets/icons/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions website/assets/js/search.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
Copyright 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

(function ($) {
"use strict";

var Search = {
init: function () {
$(document).ready(function () {
// Fill the search input form with the current search keywords
const searchKeywords = new URLSearchParams(location.search).get('q');
if (searchKeywords !== null && searchKeywords !== '') {
const searchInput = document.querySelector('.td-search-input');
searchInput.focus();
searchInput.value = searchKeywords;
}

// Set a keydown event
$(document).on("keypress", ".td-search-input", function (e) {
if (e.keyCode !== 13) {
return;
}

var query = $(this).val();
document.location = "{{ 'Search/' | absURL }}?q=" + query;

return false;
});
});
},
};

Search.init();
})(jQuery);
10 changes: 10 additions & 0 deletions website/assets/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"*": [
"*"
]
}
}
}
122 changes: 122 additions & 0 deletions website/assets/scss/_search.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
// Search
// This file is a copy of https://github.com/google/docsy/blob/v0.6.0/assets/scss/_search.scss
// with an edit to the width of the "td-search" class to ensure that the search bar is rendered correctly

.td-search {
background: transparent;
position: relative;
width: 100%; // This line was overriden from Docsy v0.6.0 to make sure text isn't truncated

// Search icon
&__icon {
// Vertically center the content.
display: flex;
align-items: center;
height: 100%;

// Position this on the left of the input.
position: absolute;
left: 0.75em;

// Click-through to the underlying input.
pointer-events: none;

&:before {
@extend .fa;
content: fa-content($fa-var-search);
}

// Styling adjustments for the navbar
@at-root {
.td-navbar & {
color: $navbar-dark-color;
}
}
}

// Search input element
&__input {
width: 100%;
text-indent: 1.25em;

@if $enable-rounded {
border-radius: 1rem;
}

&:not(:focus) {
background: transparent;
}

&.form-control:focus {
border-color: lighten($primary, 60%);
box-shadow: 0 0 0 2px lighten($primary, 30%);
color: inherit;
}

// Styling adjustments for the navbar
@at-root {
.td-navbar & {
border: none;
color: $navbar-dark-color;

@include placeholder {
color: $navbar-dark-color;
}
}
}

}

// Hide icon on focus
&:focus-within {

.td-search__icon {
display: none;
}

.td-search-input {
text-indent: 0px;
}
}

&:not(:focus-within) {
color: $input-placeholder-color;
}
}

// Offline search

.td-search--offline {

&:focus-within {
// Don't hide the search icon on focus: this gives better UX when user
// explores content of search-results popup and focus is lost.

.td-search__icon {
display: flex;
color: $input-placeholder-color;
}
}
}

.td-offline-search-results {
max-width: 90%;

.card {
margin-bottom: $spacer * .5;

.card-header {
font-weight: bold;
}
}

&__close-button {
// cursor: pointer;
float: right;

&:after {
@extend .fas;
content: fa-content($fa-var-times);
}
}
}
67 changes: 67 additions & 0 deletions website/assets/scss/_variables_project.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*

Add styles or override variables from the theme here.

*/

// Color palette
$primary: #5c64ab;

$dark: #232F3E;
$light: #f8f9fa;

// Global styles
$enable-gradients: false;
$enable-rounded: false;
$enable-shadows: false;
$enable-responsive-font-sizes: true;

// Typography
// Primary font
$google_font_name: "Poppins";
$google_font_family: "Poppins:300,300i,400,400i,600,600i";
$font-weight-body-text: 300 !default;

// Landing page styles
// Navigation
nav.navbar-dark {
a.navbar-brand span {
text-transform: none !important;
}

.navbar-nav a.nav-link {
color: white;
text-shadow: none;

&:hover,
&:active {
color: rgba(255, 255, 255, 0.8)
}
}
}

// Hero
.hero {
.display-1 {
font-weight: 700;
font-size: 3.5rem;
@media (min-width: 768px) {
font-size: 6rem;
}
}
}

// Features
.feature {
.h1 {
font-size: 8rem;
}

.h3 {
font-weight: bold;
}

code.provisioner {
color: $light;
}
}
Loading