Skip to content

Commit c61ebc7

Browse files
Add helm values.schema.json
Signed-off-by: Gerald Pape <gerald@giantswarm.io>
1 parent 8b20427 commit c61ebc7

File tree

9 files changed

+2054
-30
lines changed

9 files changed

+2054
-30
lines changed

.github/workflows/ci.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ jobs:
6464
- 'NGINX_BASE'
6565
charts:
6666
- 'charts/ingress-nginx/Chart.yaml'
67+
- 'charts/ingress-nginx/values.schema.json'
6768
- 'charts/ingress-nginx/**/*'
6869
- 'NGINX_BASE'
6970
baseimage:
@@ -94,7 +95,7 @@ jobs:
9495
- name: Run test
9596
run: make test
9697

97-
98+
9899
verify-docs:
99100
name: Verify Doc generation
100101
runs-on: ubuntu-latest
@@ -227,13 +228,24 @@ jobs:
227228
- name: Run chart-testing (lint)
228229
run: ct lint --config ./.ct.yaml
229230

231+
- name: Run helm-schema
232+
run: |
233+
GOBIN=$PWD GO111MODULE=on go install github.com/dadav/helm-schema/cmd/helm-schema@0.12.0
234+
./helm-schema --chart-search-root=${GITHUB_WORKSPACE}/charts --skip-auto-generation title,description,required,default,additionalProperties
235+
DIFF=$(git diff ${GITHUB_WORKSPACE}/charts/ingress-nginx/values.schema.json)
236+
if [ ! -z "$DIFF" ]; then
237+
echo "Please use dadav/helm-schema in your clone, of your fork, of the project, and commit a updated values.schema.json for the chart. https://github.com/kubernetes/ingress-nginx/blob/main/MANUAL_RELEASE.md#d-edit-the-valuesyaml-and-run-helm-schema-and-helm-docs"
238+
fi
239+
git diff --exit-code
240+
rm -f ./helm-schema
241+
230242
- name: Run helm-docs
231243
run: |
232244
GOBIN=$PWD GO111MODULE=on go install github.com/norwoodj/helm-docs/cmd/helm-docs@v1.11.0
233245
./helm-docs --chart-search-root=${GITHUB_WORKSPACE}/charts
234246
DIFF=$(git diff ${GITHUB_WORKSPACE}/charts/ingress-nginx/README.md)
235247
if [ ! -z "$DIFF" ]; then
236-
echo "Please use helm-docs in your clone, of your fork, of the project, and commit a updated README.md for the chart. https://github.com/kubernetes/ingress-nginx/blob/main/RELEASE.md#d-edit-the-valuesyaml-and-run-helm-docs"
248+
echo "Please use helm-docs in your clone, of your fork, of the project, and commit a updated README.md for the chart. https://github.com/kubernetes/ingress-nginx/blob/main/MANUAL_RELEASE.md#d-edit-the-valuesyaml-and-run-helm-schema-and-helm-docs"
237249
fi
238250
git diff --exit-code
239251
rm -f ./helm-docs

MANUAL_RELEASE.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,17 +181,17 @@ Promoting the images basically means that images, that were pushed to staging co
181181
- If you save the output of above command to a file called prlist.txt. It looks somewhat like this ;
182182
183183
```
184-
% cat ~/Downloads/prlist.txt
184+
% cat ~/Downloads/prlist.txt
185185
8129 fix syntax in docs for multi-tls example
186186
8120 Update go in runner and release v1.1.1
187187
8119 Update to go v1.17.6
188188
8118 Remove deprecated libraries, update other libs
189189
8117 Fix codegen errors
190-
8115 chart/ghaction: set the correct permission to have access to push a release
190+
8115 chart/ghaction: set the correct permission to have access to push a release
191191
....
192192
```
193193
You can delete the lines, that refer to PRs of the release process itself. We only need to list the feature/bugfix PRs. You can also delete the lines that are housekeeping or not really worth mentioning in the changelog.
194-
- you use some easy automation in bash/python/other, to get the PR-List that can be used in the changelog. For example, its possible to use a bash scripty way, seen below, to convert those plaintext PR numbers into clickable links.
194+
- you use some easy automation in bash/python/other, to get the PR-List that can be used in the changelog. For example, its possible to use a bash scripty way, seen below, to convert those plaintext PR numbers into clickable links.
195195
196196
```
197197
#!/usr/bin/bash
@@ -225,20 +225,22 @@ Promoting the images basically means that images, that were pushed to staging co
225225
prlist_to_changelog.sh ~/Downloads/prlist.txt | tee ~/Downloads//changelog_content.txt
226226
```
227227
228-
### d. Edit the values.yaml and run helm-docs
228+
### d. Edit the values.yaml and run helm-schema and helm-docs
229229
- [Fields to edit in values.yaml](https://github.com/kubernetes/ingress-nginx/blob/main/charts/ingress-nginx/values.yaml)
230230
231231
- tag
232232
- digest
233233
234-
- [helm-docs](https://github.com/norwoodj/helm-docs) is a tool that generates the README.md for a helm-chart automatically. In the CI pipeline workflow of github actions (/.github/workflows/ci.yaml), you can see how helm-docs is used. But the CI pipeline is not designed to make commits back into the project. So we need to run helm-docs manually, and check in the resulting autogenerated README.md at the path /charts/ingress-nginx/README.md
234+
- [helm-docs](https://github.com/norwoodj/helm-docs) and [helm-schema](https://github.com/dadav/helm-schema) are tools that generates the README.md and values.schema.json for a helm-chart automatically. In the CI pipeline workflow of github actions (/.github/workflows/ci.yaml), you can see how helm-docs and helm-schema are used. But the CI pipeline is not designed to make commits back into the project. So we need to run helm-docs and helm-schema manually, and check in the resulting autogenerated README.md and values.schema.json files located at the path /charts/ingress-nginx/
235235
```
236236
GOBIN=$PWD GO111MODULE=on go install github.com/norwoodj/helm-docs/cmd/helm-docs@v1.11.0
237+
GOBIN=$PWD GO111MODULE=on go install github.com/dadav/helm-schema/cmd/helm-schema@0.12.0
238+
./helm-schema --chart-search-root=${GITHUB_WORKSPACE}/charts --skip-auto-generation title,description,required,default,additionalProperties
237239
./helm-docs --chart-search-root=${GITHUB_WORKSPACE}/charts
238240
git diff --exit-code
239-
rm -f ./helm-docs
241+
rm -f ./helm-docs ./helm-schema
240242
```
241-
Watchout for mistakes like leaving the helm-docs executable in your clone workspace or not checking the new README.md manually etc.
243+
Watchout for mistakes like leaving the executables in your clone workspace or not checking the updated files manually etc.
242244
243245
### e. Edit the static manifests
244246

charts/ingress-nginx/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ As of version `1.26.0` of this chart, by simply not providing any clusterIP valu
322322
| controller.hostPort.enabled | bool | `false` | Enable 'hostPort' or not |
323323
| controller.hostPort.ports.http | int | `80` | 'hostPort' http port |
324324
| controller.hostPort.ports.https | int | `443` | 'hostPort' https port |
325-
| controller.hostname | object | `{}` | Optionally customize the pod hostname. |
325+
| controller.hostname | string | `""` | Optionally customize the pod hostname. |
326326
| controller.image.allowPrivilegeEscalation | bool | `false` | |
327327
| controller.image.chroot | bool | `false` | |
328328
| controller.image.digest | string | `"sha256:d5f8217feeac4887cb1ed21f27c2674e58be06bd8f5184cacea2a69abaf78dce"` | |
@@ -452,8 +452,8 @@ As of version `1.26.0` of this chart, by simply not providing any clusterIP valu
452452
| controller.service.internal.loadBalancerClass | string | `""` | Load balancer class of the internal controller service. Used by cloud providers to select a load balancer implementation other than the cloud provider default. Ref: https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class |
453453
| controller.service.internal.loadBalancerIP | string | `""` | Deprecated: Pre-defined IP address of the internal controller service. Used by cloud providers to connect the resulting load balancer service to a pre-existing static IP. Ref: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer |
454454
| controller.service.internal.loadBalancerSourceRanges | list | `[]` | Restrict access to the internal controller service. Values must be CIDRs. Allows any source address by default. |
455-
| controller.service.internal.nodePorts.http | string | `""` | Node port allocated for the internal HTTP listener. If left empty, the service controller allocates one from the configured node port range. |
456-
| controller.service.internal.nodePorts.https | string | `""` | Node port allocated for the internal HTTPS listener. If left empty, the service controller allocates one from the configured node port range. |
455+
| controller.service.internal.nodePorts.http | int | `0` | Node port allocated for the internal HTTP listener. If left empty, the service controller allocates one from the configured node port range. |
456+
| controller.service.internal.nodePorts.https | int | `0` | Node port allocated for the internal HTTPS listener. If left empty, the service controller allocates one from the configured node port range. |
457457
| controller.service.internal.nodePorts.tcp | object | `{}` | Node port mapping for internal TCP listeners. If left empty, the service controller allocates them from the configured node port range. Example: tcp: 8080: 30080 |
458458
| controller.service.internal.nodePorts.udp | object | `{}` | Node port mapping for internal UDP listeners. If left empty, the service controller allocates them from the configured node port range. Example: udp: 53: 30053 |
459459
| controller.service.internal.ports | object | `{}` | |
@@ -466,13 +466,13 @@ As of version `1.26.0` of this chart, by simply not providing any clusterIP valu
466466
| controller.service.loadBalancerClass | string | `""` | Load balancer class of the external controller service. Used by cloud providers to select a load balancer implementation other than the cloud provider default. Ref: https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class |
467467
| controller.service.loadBalancerIP | string | `""` | Deprecated: Pre-defined IP address of the external controller service. Used by cloud providers to connect the resulting load balancer service to a pre-existing static IP. Ref: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer |
468468
| controller.service.loadBalancerSourceRanges | list | `[]` | Restrict access to the external controller service. Values must be CIDRs. Allows any source address by default. |
469-
| controller.service.nodePorts.http | string | `""` | Node port allocated for the external HTTP listener. If left empty, the service controller allocates one from the configured node port range. |
470-
| controller.service.nodePorts.https | string | `""` | Node port allocated for the external HTTPS listener. If left empty, the service controller allocates one from the configured node port range. |
469+
| controller.service.nodePorts.http | int | `0` | Node port allocated for the external HTTP listener. If left empty, the service controller allocates one from the configured node port range. |
470+
| controller.service.nodePorts.https | int | `0` | Node port allocated for the external HTTPS listener. If left empty, the service controller allocates one from the configured node port range. |
471471
| controller.service.nodePorts.tcp | object | `{}` | Node port mapping for external TCP listeners. If left empty, the service controller allocates them from the configured node port range. Example: tcp: 8080: 30080 |
472472
| controller.service.nodePorts.udp | object | `{}` | Node port mapping for external UDP listeners. If left empty, the service controller allocates them from the configured node port range. Example: udp: 53: 30053 |
473473
| controller.service.ports.http | int | `80` | Port the external HTTP listener is published with. |
474474
| controller.service.ports.https | int | `443` | Port the external HTTPS listener is published with. |
475-
| controller.service.sessionAffinity | string | `""` | Session affinity of the external controller service. Must be either "None" or "ClientIP" if set. Defaults to "None". Ref: https://kubernetes.io/docs/reference/networking/virtual-ips/#session-affinity |
475+
| controller.service.sessionAffinity | string | `"None"` | Session affinity of the external controller service. Must be either "None" or "ClientIP" if set. Defaults to "None". Ref: https://kubernetes.io/docs/reference/networking/virtual-ips/#session-affinity |
476476
| controller.service.targetPorts.http | string | `"http"` | Port of the ingress controller the external HTTP listener is mapped to. |
477477
| controller.service.targetPorts.https | string | `"https"` | Port of the ingress controller the external HTTPS listener is mapped to. |
478478
| controller.service.type | string | `"LoadBalancer"` | Type of the external controller service. Ref: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types |

0 commit comments

Comments
 (0)