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

Add documentation for VPA and sig-autoscaling #7532

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 8 additions & 0 deletions .github/actions/mkdocs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM squidfunk/mkdocs-material:9.5

COPY action.sh /action.sh

RUN apk add --no-cache bash \
&& chmod +x /action.sh

ENTRYPOINT ["/action.sh"]
57 changes: 57 additions & 0 deletions .github/actions/mkdocs/action.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash

# Copyright 2024 The Kubernetes Authors.
#
# 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
#
# http://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.

set -ex

REQUIREMENTS="${GITHUB_WORKSPACE}/docs/requirements.txt"

if [ -f "${REQUIREMENTS}" ]; then
pip install -r "${REQUIREMENTS}"
fi

if [ -n "${GITHUB_TOKEN}" ]; then
remote_repo="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
elif [ -n "${PERSONAL_TOKEN}" ]; then
remote_repo="https://x-access-token:${PERSONAL_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
fi

git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "[email protected]"

mkdocs build --config-file "${GITHUB_WORKSPACE}/docs/mkdocs-root.yml"
mkdocs build --config-file "${GITHUB_WORKSPACE}/docs/mkdocs-vertical-pod-autoscaler.yml"

git clone --branch=gh-pages --depth=1 "${remote_repo}" gh-pages
cd gh-pages

# # copy current index file index.yaml and OWNERS before any change
temp_worktree=$(mktemp -d)
cp --force "index.yaml" "$temp_worktree/index.yaml"
cp --force "OWNERS" "$temp_worktree/OWNERS"

# remove current content in branch gh-pages
git rm -r .
# copy new doc.
cp -r ../site/* .

# restore chart index and OWNERS
cp "$temp_worktree/index.yaml" .
cp "$temp_worktree/OWNERS" .

# commit changes
git add .
git commit -m "Deploy GitHub Pages"
git push --force --quiet "${remote_repo}" gh-pages > /dev/null 2>&1
9 changes: 9 additions & 0 deletions .github/actions/mkdocs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# action.yml
name: 'Deploy MkDocs'
description: 'Deploys MkDocs site'
branding:
icon: 'arrow-up-circle'
color: 'orange'
runs:
using: 'docker'
image: 'Dockerfile'
53 changes: 53 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Documentation

on:
push:
branches:
- master

permissions:
contents: read

jobs:

changes:
permissions:
contents: read # for dorny/paths-filter to fetch a list of changed files
pull-requests: read # for dorny/paths-filter to read pull requests
runs-on: ubuntu-latest
if: |
(github.repository == 'kubernetes/autoscaler')
outputs:
docs: ${{ steps.filter.outputs.docs }}
charts: ${{ steps.filter.outputs.charts }}

steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
token: ${{ secrets.GITHUB_TOKEN }}
filters: |
docs:
- 'docs/**/*'
docs:
name: Update
runs-on: ubuntu-latest
needs:
- changes
if: |
(github.repository == 'kubernetes/autoscaler') &&
(needs.changes.outputs.docs == 'true')
permissions:
contents: write # needed to write releases

steps:
- name: Checkout master
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- name: Deploy
uses: ./.github/actions/mkdocs
env:
PERSONAL_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ bin/

# vertical pod autoscaler test output
vertical-pod-autoscaler/e2e/v1*/workspace/

# documentation output
site/
71 changes: 71 additions & 0 deletions docs/mkdocs-root.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
site_name: sig-autoscaling
repo_url: https://github.com/kubernetes/autoscaler
site_url: https://kubernetes.github.io/autoscaler
docs_dir: ./root/
site_dir : ../site/

# Extensions
markdown_extensions:
- admonition
- abbr
- attr_list
- def_list
- footnotes
- meta
- md_in_html
- toc:
# insert a blank space before the character
permalink: " ¶"
- pymdownx.arithmatex:
generic: true
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret
- pymdownx.critic
- pymdownx.details
- pymdownx.magiclink
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
- pymdownx.highlight
- pymdownx.inlinehilite
- pymdownx.keys
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.snippets:
check_paths: true
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.tabbed
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde

theme:
name: material
favicon: images/k8s-favicon.png
features:
- navigation.tabs
- navigation.tabs.sticky
- navigation.instant
- navigation.sections

palette:
primary: "#326CE5"

include_sidebar: true

icon:
repo: fontawesome/brands/github

plugins:
- awesome-pages
- minify:
minify_html: true

nav:
- Welcome:
- Welcome: "index.md"
79 changes: 79 additions & 0 deletions docs/mkdocs-vertical-pod-autoscaler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
site_name: Vertical Pod Autoscaler
repo_name: "kubernetes/autoscaler"
repo_url: https://github.com/kubernetes/autoscaler
site_url: https://kubernetes.github.io/autoscaler
docs_dir: ./vertical-pod-autoscaler/
site_dir : ../site/vertical-pod-autoscaler/


# Extensions
markdown_extensions:
- admonition
- abbr
- attr_list
- def_list
- footnotes
- meta
- md_in_html
- toc:
# insert a blank space before the character
permalink: " ¶"
- pymdownx.arithmatex:
generic: true
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret
- pymdownx.critic
- pymdownx.details
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
- pymdownx.highlight
- pymdownx.inlinehilite
- pymdownx.keys
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.snippets:
check_paths: true
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.tabbed
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde

theme:
name: material
favicon: images/k8s-favicon.png
features:
- navigation.tabs
- navigation.tabs.sticky
- navigation.instant
- navigation.sections

palette:
primary: "#326CE5"

include_sidebar: true

icon:
repo: fontawesome/brands/github

plugins:
- search
- awesome-pages
- minify:
minify_html: true

nav:
- Welcome:
- Welcome: "index.md"
- Installation: "installation/index.md"
- Features:
- Limit Control: "limitcontrol/index.md"
- Examples: "examples/index.md"
- Known Limitations: "limitations/index.md"
- FAQ: "faq.md"
4 changes: 4 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mkdocs-material==9.5.45
mkdocs-awesome-pages-plugin==2.9.3
mkdocs-minify-plugin==0.7.1
mkdocs-redirects==1.2.1
Binary file added docs/root/images/k8s-favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions docs/root/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Overview

SIG-autoscaling covers development and maintenance of components for automated scaling in Kubernetes. This includes automated vertical and horizontal pod autoscaling, initial resource estimation, cluster-proportional system component autoscaling, and autoscaling of Kubernetes clusters themselves.

## Projects

- [Addon Resizer](https://github.com/kubernetes/autoscaler/tree/master/addon-resizer)
- [Cluster Autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler)
- [Horizontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/)
- [Karpenter](https://karpenter.sh)
- <a href="./vertical-pod-autoscaler/">Vertical Pod Autoscaler</a>
Loading
Loading