Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add schemas for all values files #120

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions .github/workflows/helm-charts-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,33 @@ jobs:
- name: Lint charts
id: lint
run: ct lint --all

# collect-values-files-to-validate:
# runs-on: ubuntu-latest
# name: Validate values schema json
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Validate values schema json
# uses: losisin/helm-values-schema-json-action@v1
# with:
# input: values.yaml
# fail-on-diff: true
# validate-values-schema:
# runs-on: ubuntu-latest
# name: Validate values schema json
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Validate values schema json
# uses: losisin/helm-values-schema-json-action@v1
# with:
# input: values.yaml
# fail-on-diff: true
test:
runs-on: ubuntu-latest
needs: lint
needs:
- lint
# - validate-values-schema
strategy:
fail-fast: false
matrix:
Expand Down
21 changes: 15 additions & 6 deletions charts/cron-jobs/ci/sleep-values.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# List of cronjobs to create
jobs:
- name: sleep
schedule: "* * * * *"
# Cronjob's name
- name: sleep # @schema required:true
# Cronjob's schedule following [https://crontab.guru/](crontab syntax)
schedule: "* * * * *" # @schema required:true
# Any labels to apply to the created cronjob
labels:
cronjob:
key: value
jobTemplate:
key: value
container:
# Anything to apply to the container spec
container: # @schema required:true
command: ["sleep"]
args: ["1"]
resources:
Expand All @@ -16,7 +21,11 @@ jobs:
requests:
cpu: 1m
memory: 12Mi
# Image configuration
image:
repository: alpine
tag: 3.12
pullPolicy: IfNotPresent
# Image repository
repository: alpine # @schema required:true
# The image tag to use
tag: 3.12 # @schema required:true
# The pod's image pull policy
pullPolicy: IfNotPresent # @schema required:true
109 changes: 109 additions & 0 deletions charts/cron-jobs/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"jobs": {
"items": {
"properties": {
"container": {
"properties": {
"args": {
"items": {
"type": "string"
},
"type": "array"
},
"command": {
"items": {
"type": "string"
},
"type": "array"
},
"resources": {
"properties": {
"limits": {
"properties": {
"cpu": {
"type": "string"
},
"memory": {
"type": "string"
}
},
"type": "object"
},
"requests": {
"properties": {
"cpu": {
"type": "string"
},
"memory": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
},
"image": {
"properties": {
"pullPolicy": {
"type": "string"
},
"repository": {
"type": "string"
},
"tag": {
"type": "number"
}
},
"required": [
"repository",
"tag",
"pullPolicy"
],
"type": "object"
},
"labels": {
"properties": {
"cronjob": {
"properties": {
"key": {
"type": "string"
}
},
"type": "object"
},
"jobTemplate": {
"properties": {
"key": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"name": {
"type": "string"
},
"schedule": {
"type": "string"
}
},
"required": [
"name",
"schedule",
"container"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
31 changes: 31 additions & 0 deletions charts/cron-jobs/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# List of cronjobs to create
jobs: []
# # Cronjob's name
# - name: sleep # @schema required:true
# # Cronjob's schedule following [https://crontab.guru/](crontab syntax)
# schedule: "* * * * *" # @schema required:true
# # Any labels to apply to the created cronjob
# labels:
# cronjob:
# key: value
# jobTemplate:
# key: value
# # Anything to apply to the container spec
# container: # @schema required:true
# command: ["sleep"]
# args: ["1"]
# resources:
# limits:
# cpu: 1m
# memory: 12Mi
# requests:
# cpu: 1m
# memory: 12Mi
# # Image configuration
# image:
# # Image repository
# repository: alpine # @schema required:true
# # The image tag to use
# tag: 3.12 # @schema required:true
# # The pod's image pull policy
# pullPolicy: IfNotPresent # @schema required:true
88 changes: 88 additions & 0 deletions charts/default-backend/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"cron": {
"properties": {
"replaceOldestPodHourly": {
"type": "boolean"
}
},
"type": "object"
},
"hpa": {
"properties": {
"enable": {
"type": "boolean"
},
"maxReplicas": {
"type": "integer"
}
},
"type": "object"
},
"image": {
"properties": {
"pullPolicy": {
"type": "string"
},
"repository": {
"type": "string"
},
"tag": {
"type": "string"
}
},
"type": "object"
},
"ingress": {
"properties": {
"annotations": {
"properties": {
"kubernetes.io/ingress.class": {
"type": "string"
},
"kubernetes.io/tls-acme": {
"type": "string"
}
},
"type": "object"
},
"hosts": {
"type": "array"
}
},
"type": "object"
},
"replicas": {
"type": "integer"
},
"resources": {
"properties": {
"limits": {
"properties": {
"cpu": {
"type": "string"
},
"memory": {
"type": "string"
}
},
"type": "object"
},
"requests": {
"properties": {
"cpu": {
"type": "string"
},
"memory": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
}
64 changes: 64 additions & 0 deletions charts/docker-hub-exporter/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"grafana": {
"properties": {
"influxdb": {
"type": "boolean"
},
"prometheus": {
"type": "boolean"
}
},
"type": "object"
},
"image": {
"properties": {
"pullPolicy": {
"type": "string"
},
"repository": {
"type": "string"
},
"tag": {
"type": "string"
}
},
"type": "object"
},
"organisations": {
"type": "string"
},
"replicas": {
"type": "integer"
},
"resources": {
"properties": {
"limits": {
"properties": {
"cpu": {
"type": "string"
},
"memory": {
"type": "string"
}
},
"type": "object"
},
"requests": {
"properties": {
"cpu": {
"type": "string"
},
"memory": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
}
2 changes: 1 addition & 1 deletion charts/horizontal-pod-autoscalers/ci/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
replicas: 2
replicas: 2
Loading
Loading