Skip to content

Commit

Permalink
Merge pull request #1164 from wzshiming/doc/charts
Browse files Browse the repository at this point in the history
Update readme of chart
  • Loading branch information
wzshiming authored Jul 8, 2024
2 parents adaad65 + bee8934 commit ec84ad9
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 14 deletions.
30 changes: 30 additions & 0 deletions charts/_templates.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{- define "extra.usage" -}}
[KWOK](https://kwok.sigs.k8s.io/) - Simulates thousands of Nodes and Clusters.

## Installing the Chart

Before you can install the chart you will need to add the `kwok` repo to [Helm](https://helm.sh/).

```shell
helm repo add kwok https://kwok.sigs.k8s.io/charts/
```

After you've installed the repo you can install the chart.

```shell
helm upgrade --namespace kube-system --install kwok kwok/kwok
```

Set up default stage policy (required)
> NOTE: This configures the pod/node emulation behavior, if not it will do nothing.

```shell
helm upgrade --install kwok kwok/stage-fast
```

Set up default metrics usage policy (optional)

```shell
helm upgrade --install kwok kwok/metrics-usage
```
{{- end -}}
31 changes: 21 additions & 10 deletions charts/kwok/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# KWOK (Kubernetes WithOut Kubelet)

[KWOK](https://github.com/kubernetes-sigs/kwok/) - Simulates thousands of Nodes and Clusters.
[KWOK](https://kwok.sigs.k8s.io/) - Simulates thousands of Nodes and Clusters.

## Installing the Chart

Expand All @@ -23,16 +23,27 @@ Set up default stage policy (required)
helm upgrade --install kwok kwok/stage-fast
```

Set up default metrics usage policy (optional)

```shell
helm upgrade --install kwok kwok/metrics-usage
```

## Configuration

The following table lists the configurable parameters of the kwok chart and their default values.

| Parameter | Description | Default |
|--------------------|------------------------------------------------------------------------------|-----------------------------|
| `image.repository` | Image repository. | `registry.k8s.io/kwok/kwok` |
| `image.tag` | Image tag, will override the default tag derived from the chart app version. | `[chart appVersion]` |
| `image.pullPolicy` | Image pull policy. | `IfNotPresent` |
| `imagePullSecrets` | Image pull secrets. | `[]` |
| `nameOverride` | Override the `name` of the chart. | `""` |
| `fullnameOverride` | Override the `fullname` of the chart. | `""` |
| `replicas` | The replica count for Deployment. | `1` |
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| fullnameOverride | string | `"kwok-controller"` | Override the `fullname` of the chart. |
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy. |
| image.repository | string | `"registry.k8s.io/kwok/kwok"` | Image repository. |
| image.tag | string | `""` | Overrides the image tag whose default is {{ .Chart.AppVersion }}. |
| imagePullSecrets | list | `[]` | Image pull secrets. |
| nameOverride | string | `""` | Override the `name` of the chart. |
| nodeSelector | object | `{}` | |
| podSecurityContext | object | `{}` | |
| replicas | int | `1` | The replica count for Deployment. |
| resources | object | `{}` | |
| securityContext | object | `{}` | |
9 changes: 9 additions & 0 deletions charts/kwok/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# {{ template "chart.description" . }}

{{ template "extra.usage" . }}

## Configuration

The following table lists the configurable parameters of the kwok chart and their default values.

{{ template "chart.valuesTable" . }}
9 changes: 8 additions & 1 deletion charts/kwok/values.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
image:
# -- Image pull policy.
pullPolicy: IfNotPresent
# -- Image repository.
repository: registry.k8s.io/kwok/kwok
# Overrides the image tag whose default is v{{ .Chart.AppVersion }}
# -- Overrides the image tag whose default is {{ .Chart.AppVersion }}.
tag: ""

# -- Image pull secrets.
imagePullSecrets: []

# -- Override the `name` of the chart.
nameOverride: ""

# -- Override the `fullname` of the chart.
fullnameOverride: "kwok-controller"

podSecurityContext: {}
Expand All @@ -16,4 +22,5 @@ nodeSelector: {}
resources: {}
affinity: {}

# -- The replica count for Deployment.
replicas: 1
10 changes: 8 additions & 2 deletions charts/metrics-usage/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Default metrics usage of KWOK (Kubernetes WithOut Kubelet)
# Default metrics usage policy of KWOK (Kubernetes WithOut Kubelet)

[KWOK](https://github.com/kubernetes-sigs/kwok/) - Simulates thousands of Nodes and Clusters.
[KWOK](https://kwok.sigs.k8s.io/) - Simulates thousands of Nodes and Clusters.

## Installing the Chart

Expand All @@ -22,3 +22,9 @@ Set up default stage policy (required)
```shell
helm upgrade --install kwok kwok/stage-fast
```

Set up default metrics usage policy (optional)

```shell
helm upgrade --install kwok kwok/metrics-usage
```
3 changes: 3 additions & 0 deletions charts/metrics-usage/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# {{ template "chart.description" . }}

{{ template "extra.usage" . }}
8 changes: 7 additions & 1 deletion charts/stage-fast/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Default stage policy of KWOK (Kubernetes WithOut Kubelet)

[KWOK](https://github.com/kubernetes-sigs/kwok/) - Simulates thousands of Nodes and Clusters.
[KWOK](https://kwok.sigs.k8s.io/) - Simulates thousands of Nodes and Clusters.

## Installing the Chart

Expand All @@ -22,3 +22,9 @@ Set up default stage policy (required)
```shell
helm upgrade --install kwok kwok/stage-fast
```

Set up default metrics usage policy (optional)

```shell
helm upgrade --install kwok kwok/metrics-usage
```
3 changes: 3 additions & 0 deletions charts/stage-fast/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# {{ template "chart.description" . }}

{{ template "extra.usage" . }}
13 changes: 13 additions & 0 deletions hack/update-helm-charts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ function sync_to_chart() {
cp "${src}" "${dest}"
}

function update_readme() {
local chart=$1
go run github.com/norwoodj/helm-docs/cmd/[email protected] \
-c charts/ \
-t ./_templates.gotmpl \
-t README.md.gotmpl \
-g "charts/${chart}"
}

function sync() {
sync_object_to_chart kustomize/rbac/role.yaml charts/kwok/templates/role.yaml
sync_object_to_chart kustomize/rbac/role_binding.yaml charts/kwok/templates/role_binding.yaml
Expand All @@ -66,6 +75,10 @@ function sync() {

sync_stage_to_chart kustomize/metrics/resource/metrics-resource.yaml charts/metrics-usage/templates/metrics-resource.yaml
sync_stage_to_chart kustomize/metrics/usage/usage-from-annotation.yaml charts/metrics-usage/templates/usage-from-annotation.yaml

update_readme kwok
update_readme stage-fast
update_readme metrics-usage
}

cd "${ROOT_DIR}" && sync

0 comments on commit ec84ad9

Please sign in to comment.