Skip to content
Open
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
63 changes: 63 additions & 0 deletions .github/workflows/chart-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
permissions:
contents: read

jobs:
ca-release:
permissions:
contents: write # for helm/chart-releaser-action to push chart release and create a release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"

- name: Install Helm
uses: azure/[email protected]
with:
version: v3.4.0

- env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CR_RELEASE_NAME_TEMPLATE: "cluster-autoscaler-chart-{{ .Version }}"
name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: cluster-autoscaler/charts
vpa-release:
permissions:
contents: write # for helm/chart-releaser-action to push chart release and create a release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"

- name: Install Helm
uses: azure/[email protected]
with:
version: v3.4.0

- env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CR_RELEASE_NAME_TEMPLATE: "vertical-pod-autoscaler-chart-{{ .Version }}"
name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: vertical-pod-autoscaler/charts
name: Release Charts
on:
push:
branches:
- master
23 changes: 10 additions & 13 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ jobs:
with:
filters: |
charts:
- 'charts/**/Chart.yaml'
- 'charts/**/*'
- 'cluster-autoscaler/charts/**/Chart.yaml'
- 'cluster-autoscaler/charts/**/*'
- 'vertical-pod-autoscaler/charts/**/Chart.yaml'
- 'vertical-pod-autoscaler/charts/**/*'
token: ${{ secrets.GITHUB_TOKEN }}
helm-lint-test:
if: ${{ needs.changes.outputs.charts == 'true' }}
Expand All @@ -34,12 +36,12 @@ jobs:
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (lint)
run: ct lint
run: ct lint --chart-dirs cluster-autoscaler/charts vertical-pod-autoscaler/charts
# Only build a kind cluster if there are chart changes to test.
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed)
changed=$(ct list-changed --chart-dirs cluster-autoscaler/charts vertical-pod-autoscaler/charts)
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi
Expand All @@ -48,7 +50,7 @@ jobs:
uses: helm/[email protected]
- if: steps.list-changed.outputs.changed == 'true'
name: Run chart-testing (install)
run: ct install
run: ct install --chart-dirs cluster-autoscaler/charts vertical-pod-autoscaler/charts
helm-docs-validate:
if: ${{ needs.changes.outputs.charts == 'true' }}
name: Helm Docs
Expand All @@ -59,14 +61,9 @@ jobs:
- name: Checkout
uses: actions/[email protected]
- name: Run helm-docs
uses: docker://jnorwood/helm-docs:v1.14.2
- name: Check for changes
run: |
if ! git diff --exit-code charts/*/README.md; then
echo "ERROR: Helm chart README.md files are out of date"
echo "Run from charts/: docker run --rm --volume \"\$(pwd):/helm-docs\" -u \$(id -u) jnorwood/helm-docs:v1.14.2"
exit 1
fi
uses: losisin/helm-docs-github-action@v1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think it would be better to use a GitHub Action instead of Docker. However, I’m curious why you chose this particular action. I’m not familiar with it, and I noticed it only has about 10 stars - https://github.com/losisin/helm-docs-github-action. So I’m wondering if it’s reliable enough for our use case.
Btw, I’m familiar with https://github.com/norwoodj/helm-docs, which has around 1.6K stars and seems to be more established.
Is there a specific reason you chose the other one instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/norwoodj/helm-docs is the official helm-docs project, but isn't a github action.

https://github.com/marketplace?query=helm-docs&type=actions is where I found this, it seems to be the best option.

If we think a lightly used action is not prefereable compared to doing it manually I can revert this change.

with:
fail-on-diff: true

name: Lint and Test Charts
on: pull_request
34 changes: 0 additions & 34 deletions .github/workflows/release.yaml

This file was deleted.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ This repository contains autoscaling-related components for Kubernetes.
[Cluster Autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler) - a component that automatically adjusts the size of a Kubernetes
Cluster so that all pods have a place to run and there are no unneeded nodes. Supports several public cloud providers. Version 1.0 (GA) was released with kubernetes 1.8.

[Cluster Autoscaler Helm Chart](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler/charts) - Supported Helm chart for Cluster Autoscaler.

[Vertical Pod Autoscaler](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler) - a set of components that automatically adjust the
amount of CPU and memory requested by pods running in the Kubernetes Cluster. Current state - beta.

[Vertical Pod Autoscaler Helm Chart](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler/charts) - Supported Helm chart for Vertical Pod Autoscaler.

[Addon Resizer](https://github.com/kubernetes/autoscaler/tree/master/addon-resizer) - a simplified version of vertical pod autoscaler that modifies
resource requests of a deployment based on the number of nodes in the Kubernetes Cluster. Current state - beta.

[Charts](https://github.com/kubernetes/autoscaler/tree/master/charts) - Supported Helm charts for components above.

## Contact Info

Interested in autoscaling? Want to talk? Have questions, concerns or great ideas?
Expand Down
File renamed without changes.
34 changes: 34 additions & 0 deletions cluster-autoscaler/charts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# charts

The Helm chart for the Cluster Autoscaler project resides within this folder. If making changes to the Helm charts, make sure you follow the instructions below for the pre-commit checks.

## Pre-commit hooks

This Helm repository has pre-commit hooks for Helm specific needs:

* Makes sure all charts pass a `helm lint` check.
* Updates the `README.md` file of all charts based on comments in that chart's `values.yaml` file.

### Install `pre-commit` binary

The binary for `pre-commit` can be installed via Homebrew:

```shell
$ brew install pre-commit
```

For those without Homebrew, Pre-commit has [other installation methods available](https://pre-commit.com/#install).

### Install git hooks

After the `pre-commit` binary is installed, go to this repository's directory, and run the following command to install the git hook:

```shell
$ pre-commit install
```

### Install hook dependencies

The pre-commit hooks themselves call binaries under the hood; they can be installed via the [instructions found here](https://github.com/norwoodj/helm-docs#installation).

Note: You should ensure that whichever installation method you are using you either install the same version of helm-docs as used in the PR workflow to ensure your PR passes CI checks or update the version used by the workflow to match.
2 changes: 1 addition & 1 deletion cluster-autoscaler/hack/update-chart-version-readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ VERSIONS=$(

(
set -eo pipefail
cat $BASE/../../charts/cluster-autoscaler/Chart.yaml \
cat $BASE/charts/cluster-autoscaler/Chart.yaml \
| grep -e version -e appVersion
) \
| sed -E -e 's/^([^:]+): (.*)/"\1": "\2"/g' \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# charts

The Helm charts for the Autoscaler project reside within this folder. If making changes to the Helm charts, make sure you follow the instructions below for the pre-commit checks.
The Helm chart for the VPA project resides within this folder. If making changes to the Helm charts, make sure you follow the instructions below for the pre-commit checks.

## Pre-commit hooks

Expand Down
Loading