generated from cybozu-go/neco-template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: d-kuro <[email protected]>
- Loading branch information
Showing
23 changed files
with
566 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# This file is the config file for helm/chart-releaser | ||
owner: cybozu-go | ||
git-repo: accurate | ||
release-name-template: "{{ .Name }}-chart-v{{ .Version }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Release Charts | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
# Add depending repository for helm to avoid the error below. | ||
# `Error: no repository definition for https://charts.jetstack.io` | ||
# see: https://github.com/helm/chart-releaser-action/issues/74 | ||
- name: Add cert-manager repo for helm | ||
run: helm repo add cert-manager https://charts.jetstack.io | ||
|
||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
with: | ||
config: .cr.yaml | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Lint and Test Charts | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "charts/**" | ||
|
||
jobs: | ||
lint-test: | ||
runs-on: ubuntu-18.04 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup helm-docs | ||
run: | | ||
HELM_DOCS_VERSION="1.5.0" | ||
OS=$(uname) | ||
curl -L -sS https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_${OS}_x86_64.tar.gz \ | ||
| tar zx -C /tmp | ||
sudo mv /tmp/helm-docs /usr/local/bin | ||
- name: Run helm-docs | ||
run: helm-docs && git diff --no-patch --exit-code | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Set up chart-testing | ||
uses: helm/[email protected] | ||
|
||
- name: Run chart-testing (list-changed) | ||
id: list-changed | ||
run: | | ||
changed=$(ct list-changed --config ct.yaml) | ||
if [[ -n "$changed" ]]; then | ||
echo "::set-output name=changed::true" | ||
fi | ||
- name: Run chart-testing (lint) | ||
run: ct lint --config ct.yaml | ||
|
||
- name: Create kind cluster | ||
uses: helm/[email protected] | ||
if: steps.list-changed.outputs.changed == 'true' | ||
|
||
- name: Apply cert-manager CRDs | ||
run: kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.1/cert-manager.crds.yaml | ||
|
||
- name: Run chart-testing (install) | ||
run: ct install --config ct.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,6 @@ | |
|
||
# Generated files | ||
/docs/book | ||
|
||
# Ignore dependency charts | ||
charts/*/charts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dependencies: | ||
- name: cert-manager | ||
repository: https://charts.jetstack.io | ||
version: v1.5.1 | ||
digest: sha256:d00aee7a3873a9ced5b1212b4a904c54629112b1fdc59baab00899d39a885593 | ||
generated: "2021-08-18T12:07:14.637063+09:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
# Accurate Helm Chart | ||
|
||
## How to use Accurate Helm repository | ||
|
||
You need to add this repository to your Helm repositories: | ||
|
||
```sh | ||
helm repo add accurate https://cybozu-go.github.io/accurate/ | ||
helm repo update | ||
``` | ||
|
||
## Dependencies | ||
|
||
| Repository | Name | Version | | ||
| ---------- | ---- | ------- | | ||
| https://charts.jetstack.io | cert-manager | 1.5.0 | | ||
|
||
## Quick start | ||
|
||
### Installing the Chart | ||
|
||
> NOTE: | ||
> | ||
> This installation method requires cert-manger to be installed beforehand. | ||
To install the chart with the release name `accurate` using a dedicated namespace(recommended): | ||
|
||
```sh | ||
helm install --create-namespace --namespace accurate accurate accurate/accurate | ||
``` | ||
|
||
Specify parameters using `--set key=value[,key=value]` argument to `helm install`. | ||
|
||
Alternatively a YAML file that specifies the values for the parameters can be provided like this: | ||
|
||
```sh | ||
helm upgrade --create-namespace --namespace accurate -i accurate -f values.yaml accurate/accurate | ||
``` | ||
|
||
### Install together with cert-manager | ||
|
||
Before installing the chart, you must first install the cert-manager CustomResourceDefinition resources. | ||
|
||
```sh | ||
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.0/cert-manager.crds.yaml | ||
``` | ||
|
||
Set the `cert-manager.enabled=true` parameter when installing Accurate chart: | ||
|
||
```sh | ||
helm install --create-namespace --namespace accurate accurate accurate/accurate --set cert-manager.enabled=true | ||
``` | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| cert-manager.enabled | bool | `false` | Install cert-manager together. | | ||
| controller.additionalRBAC.rules | list | `[]` | Specify the RBAC rules to be added to the controller. ClusterRole and ClusterRoleBinding are created with the names `{{ release name }}-additional-resources`. The rules defined here will be used for the ClusterRole rules. | | ||
| controller.config.annotationKeys | list | `[]` | Annotations to be propagated to sub-namespaces. It is also possible to specify a glob pattern that can be interpreted by Go's "path.Match" func. | | ||
| controller.config.labelKeys | list | `[]` | Labels to be propagated to sub-namespaces. It is also possible to specify a glob pattern that can be interpreted by Go's "path.Match" func. | | ||
| controller.config.watches | list | `[{"group":"rbac.authorization.k8s.io","kind":"Role","version":"v1"},{"group":"rbac.authorization.k8s.io","kind":"RoleBinding","version":"v1"},{"kind":"Secret","version":"v1"}]` | List of GVK for namespace-scoped resources that can be propagated. Any namespace-scoped resource is allowed. | | ||
| controller.replicas | int | `2` | Specify the number of replicas of the controller Pod. | | ||
| controller.resources | object | `{"requests":{"cpu":"100m","memory":"20Mi"}}` | Specify resources. | | ||
| controller.terminationGracePeriodSeconds | int | `10` | Specify terminationGracePeriodSeconds. | | ||
| image.pullPolicy | string | `nil` | Accurate image pullPolicy. | | ||
| image.repository | string | `"ghcr.io/cybozu-go/accurate"` | Accurate image repository to use. | | ||
| image.tag | string | `{{ .Chart.AppVersion }}` | Accurate image tag to use. | | ||
|
||
## Generate Manifests | ||
|
||
You can use the `helm template` command to render manifests. | ||
|
||
```sh | ||
helm template --namespace accurate accurate accurate/accurate | ||
``` | ||
|
||
## Upgrade CRDs | ||
|
||
There is no support at this time for upgrading or deleting CRDs using Helm. | ||
Users must manually upgrade the CRD if there is a change in the CRD used by Accurate. | ||
|
||
https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#install-a-crd-declaration-before-using-the-resource | ||
|
||
## Update README | ||
|
||
The `README.md` for this chart is generated by [helm-docs](https://github.com/norwoodj/helm-docs). | ||
To update the README, edit the `README.md.gotmpl` file and run the helm-docs command. | ||
|
||
```console | ||
# path to Accurate repository root | ||
$ make helm-docs | ||
$ ./bin/helm-docs | ||
helm-docs | ||
INFO[2021-07-25T23:53:15+09:00] Found Chart directories [charts/accurate] | ||
INFO[2021-07-25T23:53:15+09:00] Generating README Documentation for chart /path/to/dir/github.com/cybozu-go/accurate/charts/accurate | ||
``` | ||
|
||
## Release Chart | ||
|
||
Accurate Helm Chart will be released independently. | ||
This will prevent the Accurate version from going up just by modifying the Helm Chart. | ||
|
||
You must change the version of `Chart.yaml` when making changes to the Helm Chart. | ||
CI fails with lint error when creating a Pull Request without changing the version of `Chart.yaml`. | ||
|
||
When you release the Helm Chart, manually run the GitHub Actions workflow for the release. | ||
|
||
https://github.com/cybozu-go/accurate/actions/workflows/helm-release.yaml | ||
|
||
When you run workflow, [helm/chart-releaser-action](https://github.com/helm/chart-releaser-action) will automatically create a GitHub Release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Accurate Helm Chart | ||
|
||
## How to use Accurate Helm repository | ||
|
||
You need to add this repository to your Helm repositories: | ||
|
||
```sh | ||
helm repo add accurate https://cybozu-go.github.io/accurate/ | ||
helm repo update | ||
``` | ||
|
||
## Dependencies | ||
|
||
| Repository | Name | Version | | ||
| ---------- | ---- | ------- | | ||
| https://charts.jetstack.io | cert-manager | 1.5.0 | | ||
|
||
## Quick start | ||
|
||
### Installing the Chart | ||
|
||
> NOTE: | ||
> | ||
> This installation method requires cert-manger to be installed beforehand. | ||
|
||
To install the chart with the release name `accurate` using a dedicated namespace(recommended): | ||
|
||
```sh | ||
helm install --create-namespace --namespace accurate accurate accurate/accurate | ||
``` | ||
|
||
Specify parameters using `--set key=value[,key=value]` argument to `helm install`. | ||
|
||
Alternatively a YAML file that specifies the values for the parameters can be provided like this: | ||
|
||
```sh | ||
helm upgrade --create-namespace --namespace accurate -i accurate -f values.yaml accurate/accurate | ||
``` | ||
|
||
### Install together with cert-manager | ||
|
||
Before installing the chart, you must first install the cert-manager CustomResourceDefinition resources. | ||
|
||
```sh | ||
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.0/cert-manager.crds.yaml | ||
``` | ||
|
||
Set the `cert-manager.enabled=true` parameter when installing Accurate chart: | ||
|
||
```sh | ||
helm install --create-namespace --namespace accurate accurate accurate/accurate --set cert-manager.enabled=true | ||
``` | ||
|
||
{{ template "chart.valuesSection" . }} | ||
|
||
## Generate Manifests | ||
|
||
You can use the `helm template` command to render manifests. | ||
|
||
```sh | ||
helm template --namespace accurate accurate accurate/accurate | ||
``` | ||
|
||
## Upgrade CRDs | ||
|
||
There is no support at this time for upgrading or deleting CRDs using Helm. | ||
Users must manually upgrade the CRD if there is a change in the CRD used by Accurate. | ||
|
||
https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#install-a-crd-declaration-before-using-the-resource | ||
|
||
## Update README | ||
|
||
The `README.md` for this chart is generated by [helm-docs](https://github.com/norwoodj/helm-docs). | ||
To update the README, edit the `README.md.gotmpl` file and run the helm-docs command. | ||
|
||
```console | ||
# path to Accurate repository root | ||
$ make helm-docs | ||
$ ./bin/helm-docs | ||
helm-docs | ||
INFO[2021-07-25T23:53:15+09:00] Found Chart directories [charts/accurate] | ||
INFO[2021-07-25T23:53:15+09:00] Generating README Documentation for chart /path/to/dir/github.com/cybozu-go/accurate/charts/accurate | ||
``` | ||
|
||
## Release Chart | ||
|
||
Accurate Helm Chart will be released independently. | ||
This will prevent the Accurate version from going up just by modifying the Helm Chart. | ||
|
||
You must change the version of `Chart.yaml` when making changes to the Helm Chart. | ||
CI fails with lint error when creating a Pull Request without changing the version of `Chart.yaml`. | ||
|
||
When you release the Helm Chart, manually run the GitHub Actions workflow for the release. | ||
|
||
https://github.com/cybozu-go/accurate/actions/workflows/helm-release.yaml | ||
|
||
When you run workflow, [helm/chart-releaser-action](https://github.com/helm/chart-releaser-action) will automatically create a GitHub Release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cert-manager: | ||
enabled: true |
Oops, something went wrong.