diff --git a/charts/_templates.gotmpl b/charts/_templates.gotmpl new file mode 100644 index 000000000..e791a6d19 --- /dev/null +++ b/charts/_templates.gotmpl @@ -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 -}} diff --git a/charts/kwok/README.md b/charts/kwok/README.md index 3c8b30007..2e136aeff 100644 --- a/charts/kwok/README.md +++ b/charts/kwok/README.md @@ -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 @@ -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 | `{}` | | diff --git a/charts/kwok/README.md.gotmpl b/charts/kwok/README.md.gotmpl new file mode 100644 index 000000000..4b66504e3 --- /dev/null +++ b/charts/kwok/README.md.gotmpl @@ -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" . }} diff --git a/charts/kwok/values.yaml b/charts/kwok/values.yaml index 70211e318..6b6cefddb 100644 --- a/charts/kwok/values.yaml +++ b/charts/kwok/values.yaml @@ -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: {} @@ -16,4 +22,5 @@ nodeSelector: {} resources: {} affinity: {} +# -- The replica count for Deployment. replicas: 1 diff --git a/charts/metrics-usage/README.md b/charts/metrics-usage/README.md index f0f10f0c3..1b275763b 100644 --- a/charts/metrics-usage/README.md +++ b/charts/metrics-usage/README.md @@ -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 @@ -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 +``` diff --git a/charts/metrics-usage/README.md.gotmpl b/charts/metrics-usage/README.md.gotmpl new file mode 100644 index 000000000..60539165f --- /dev/null +++ b/charts/metrics-usage/README.md.gotmpl @@ -0,0 +1,3 @@ +# {{ template "chart.description" . }} + +{{ template "extra.usage" . }} diff --git a/charts/stage-fast/README.md b/charts/stage-fast/README.md index 6721f7922..e29c6f4e7 100644 --- a/charts/stage-fast/README.md +++ b/charts/stage-fast/README.md @@ -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 @@ -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 +``` diff --git a/charts/stage-fast/README.md.gotmpl b/charts/stage-fast/README.md.gotmpl new file mode 100644 index 000000000..60539165f --- /dev/null +++ b/charts/stage-fast/README.md.gotmpl @@ -0,0 +1,3 @@ +# {{ template "chart.description" . }} + +{{ template "extra.usage" . }} diff --git a/hack/update-helm-charts.sh b/hack/update-helm-charts.sh index 9f537a487..3c7479af5 100755 --- a/hack/update-helm-charts.sh +++ b/hack/update-helm-charts.sh @@ -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/helm-docs@v1.13.1 \ + -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 @@ -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