Skip to content

Commit

Permalink
feat(chart): automate helm json schema (#5075)
Browse files Browse the repository at this point in the history
* helm(json-schema): simplified schema validation

Signed-off-by: ivan katliarchuk <[email protected]>

* helm(json-schema): simplified schema validation and documentation generation

Signed-off-by: ivan katliarchuk <[email protected]>

* helm(json-schema): simplified schema validation and documentation generation

Signed-off-by: ivan katliarchuk <[email protected]>

* helm(json-schema): simplified schema validation and documentation generation

Signed-off-by: ivan katliarchuk <[email protected]>

* helm(json-schema): simplified schema validation and documentation generation

Signed-off-by: ivan katliarchuk <[email protected]>

* helm(json-schema): simplified schema validation and documentation generation

Signed-off-by: ivan katliarchuk <[email protected]>

* helm(json-schema): simplified schema validation and documentation generation

Signed-off-by: ivan katliarchuk <[email protected]>

* helm(json-schema): simplified schema validation and documentation generation

Signed-off-by: ivan katliarchuk <[email protected]>

* helm(json-schema): simplified schema validation and documentation generation

Signed-off-by: ivan katliarchuk <[email protected]>

* helm(json-schema): simplified schema validation and documentation generation

Signed-off-by: ivan katliarchuk <[email protected]>

* helm(json-schema): simplified schema validation and documentation generation

Signed-off-by: ivan katliarchuk <[email protected]>

* helm(json-schema): simplified schema validation and documentation generation

Signed-off-by: ivan katliarchuk <[email protected]>

* helm(json-schema): simplified schema validation and documentation generation

Signed-off-by: ivan katliarchuk <[email protected]>

* helm(json-schema): simplified schema validation and documentation generation

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(chart): automate helm json schema

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(chart): automate helm json schema

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(chart): automate helm json schema

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(chart): automate helm json schema

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(chart): automate helm json schema

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(chart): automate helm json schema

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(chart): automate helm json schema

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(chart): automate helm json schema

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(chart): automate helm json schema

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(chart): automate helm json schema

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(chart): automate helm json schema

Signed-off-by: ivan katliarchuk <[email protected]>

* Apply suggestions from code review

Co-authored-by: Steve Hipwell <[email protected]>

* Apply suggestions from code review

Co-authored-by: Michel Loiseleur <[email protected]>

---------

Signed-off-by: ivan katliarchuk <[email protected]>
Co-authored-by: Steve Hipwell <[email protected]>
Co-authored-by: Michel Loiseleur <[email protected]>
  • Loading branch information
3 people authored Feb 15, 2025
1 parent ce2833c commit 9251e55
Show file tree
Hide file tree
Showing 10 changed files with 893 additions and 81 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/lint-test-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ jobs:
with:
fetch-depth: 0

- name: Install Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
token: ${{ github.token }}
version: latest

- name: Run Helm Schema check
working-directory: charts/external-dns
run: |
set -euo pipefail
helm plugin install https://github.com/losisin/helm-values-schema-json.git
helm schema
if [[ -n "$(git status --porcelain --untracked-files=no)" ]]
then
echo "Schema not up to date. Please run helm schema and commit changes!" >&2
exit 1
fi
- name: Install Helm Docs
uses: action-stars/install-tool-from-github-release@ece2623611b240002e0dd73a0d685505733122f6 # v0.2.4
with:
Expand Down Expand Up @@ -52,12 +71,6 @@ jobs:
- name: Run Artifact Hub lint
run: ah lint --kind helm || exit 1

- name: Install Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
token: ${{ github.token }}
version: latest

- name: Install Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
Expand Down
3 changes: 3 additions & 0 deletions charts/external-dns/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
.idea/
*.tmproj
.vscode/
ci/
schema/
.schema.yaml
11 changes: 11 additions & 0 deletions charts/external-dns/.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ref: https://github.com/losisin/helm-values-schema-json.git
input:
- schema/values.yaml
- values.yaml

draft: 7
indent: 2
output: values.schema.json

schemaRoot:
additionalProperties: true
9 changes: 9 additions & 0 deletions charts/external-dns/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UNRELEASED]

### Added

- Added ability to generate schema with `helm plugin schema`. ([#5075](https://github.com/kubernetes-sigs/external-dns/pull/5075)) _@ivankatliarchuk_
- Added `docs/contributing/dev-guide.md#helm-values` guide. ([#5075](https://github.com/kubernetes-sigs/external-dns/pull/5075)) _@ivankatliarchuk_

### Changed

- Regenerate JSON schema with `helm-values-schema-json' plugin. ([#5075](https://github.com/kubernetes-sigs/external-dns/pull/5075)) _@ivankatliarchuk_

## [v1.15.2] - 2025-02-14

### Changed
Expand Down
2 changes: 1 addition & 1 deletion charts/external-dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ If `namespaced` is set to `true`, please ensure that `sources` my only contains
| secretConfiguration.subPath | string | `nil` | Sub-path for mounting the `Secret`, this can be templated. |
| securityContext | object | See _values.yaml_ | [Security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) for the `external-dns` container. |
| service.annotations | object | `{}` | Service annotations. |
| service.ipFamilies | list | `[]` | Service IP families. |
| service.ipFamilies | list | `[]` | Service IP families (e.g. IPv4 and/or IPv6). |
| service.ipFamilyPolicy | string | `nil` | Service IP family policy. |
| service.port | int | `7979` | Service HTTP port. |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account. Templates are allowed in both the key and the value. Example: `example.com/annotation/{{ .Values.nameOverride }}: {{ .Values.nameOverride }}` |
Expand Down
19 changes: 19 additions & 0 deletions charts/external-dns/schema/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Custom values for schema creation.
# This is a YAML-formatted file.
# Declare variables to be passed into your schema.
resources:
requests:
cpu: 200m
memory: 128Mi
limits:
cpu: 200m
memory: 128Mi

provider:
webhook:
requests:
cpu: 200m
memory: 128Mi
limits:
cpu: 300m
memory: 200Mi
Loading

0 comments on commit 9251e55

Please sign in to comment.