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 JSON schema for Vald Helm Chart #365

Merged
merged 10 commits into from
May 27, 2020
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
8 changes: 7 additions & 1 deletion .github/workflows/helm-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Run Helm lint'
on:
pull_request:
paths:
- 'charts'
- 'charts/**'

jobs:
helm-lint:
Expand All @@ -18,9 +18,15 @@ jobs:
- name: Helm version
run: |
helm version
- name: Generate schema for charts/vald
run: |
make helm/schema/vald
- name: Run lint for charts/vald
run: |
helm lint charts/vald
- name: Generate schema for charts/vald-helm-operator
run: |
make helm/schema/vald-helm-operator
- name: Run lint for charts/vald-helm-operator
run: |
helm lint charts/vald-helm-operator
5 changes: 5 additions & 0 deletions .github/workflows/semver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,21 @@ jobs:
make helm/docs/vald
make helm/docs/vald-helm-operator

make helm/schema/vald
make helm/schema/vald-helm-operator

git config --global user.name "vdaas-ci"
git config --global user.email "[email protected]"

git add \
versions/VALD_VERSION \
charts/vald/Chart.yaml \
charts/vald/values.yaml \
charts/vald/values.schema.json \
charts/vald/README.md \
charts/vald-helm-operator/Chart.yaml \
charts/vald-helm-operator/values.yaml \
charts/vald-helm-operator/values.schema.json \
charts/vald-helm-operator/README.md
git commit --signoff -m ":bookmark: :robot: Release ${GITWERK_RESULT}"

Expand Down
18 changes: 18 additions & 0 deletions Makefile.d/helm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,21 @@ charts/vald-helm-operator/README.md: \
charts/vald-helm-operator/README.md.gotmpl \
charts/vald-helm-operator/values.yaml
helm-docs

.PHONY: helm/schema/vald
## generate json schema for Vald Helm Chart
helm/schema/vald: charts/vald/values.schema.json

charts/vald/values.schema.json: \
charts/vald/values.yaml \
hack/helm/schema/gen/main.go
go run hack/helm/schema/gen/main.go charts/vald/values.yaml > charts/vald/values.schema.json

.PHONY: helm/schema/vald-helm-operator
## generate json schema for Vald Helm Operator Chart
helm/schema/vald-helm-operator: charts/vald-helm-operator/values.schema.json

charts/vald-helm-operator/values.schema.json: \
charts/vald-helm-operator/values.yaml \
hack/helm/schema/gen/main.go
go run hack/helm/schema/gen/main.go charts/vald-helm-operator/values.yaml > charts/vald-helm-operator/values.schema.json
1 change: 1 addition & 0 deletions charts/vald-helm-operator/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"$schema":"http://json-schema.org/draft-07/schema#","title":"Values","type":"object","properties":{"affinity":{"type":"object"},"image":{"type":"object","properties":{"pullPolicy":{"type":"string","enum":["Always","Never","IfNotPresent"]},"repository":{"type":"string"},"tag":{"type":"string"}}},"logging":{"type":"object","properties":{"format":{"type":"string","enum":["console","json"]},"level":{"type":"string","enum":["debug","info","error"]},"stacktraceLevel":{"type":"string","enum":["debug","info","error"]},"timeEncoding":{"type":"string","enum":["epoch","millis","nano","iso8601"]}}},"maxWorkers":{"type":"integer"},"name":{"type":"string"},"nodeSelector":{"type":"object"},"rbac":{"type":"object","properties":{"create":{"type":"boolean"},"name":{"type":"string"}}},"reconcilePeriod":{"type":"string"},"replicas":{"type":"integer"},"resources":{"type":"object"},"serviceAccount":{"type":"object","properties":{"create":{"type":"boolean"},"name":{"type":"string"}}},"tolerations":{"type":"array","items":{"type":"object"}}}}
23 changes: 23 additions & 0 deletions charts/vald-helm-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,78 @@
# limitations under the License.
#

# @schema {"name": "name", "type": "string"}
# name -- name of the deployment
name: vald-helm-operator
# @schema {"name": "replicas", "type": "integer"}
# replicas -- number of replicas
replicas: 2

# @schema {"name": "image", "type": "object"}
image:
# @schema {"name": "image.repository", "type": "string"}
# image.repository -- image repository
repository: vdaas/vald-helm-operator
# @schema {"name": "image.tag", "type": "string"}
# image.tag -- image tag
tag: v0.0.37
# @schema {"name": "image.pullPolicy", "type": "string", "enum": ["Always", "Never", "IfNotPresent"]}
# image.pullPolicy -- image pull policy
pullPolicy: Always

# @schema {"name": "rbac", "type": "object"}
rbac:
# @schema {"name": "rbac.create", "type": "boolean"}
# rbac.create -- required roles and rolebindings will be created
create: true
# @schema {"name": "rbac.name", "type": "string"}
# rbac.name -- name of roles and rolebindings
name: vald-helm-operator

# @schema {"name": "serviceAccount", "type": "object"}
serviceAccount:
# @schema {"name": "serviceAccount.create", "type": "boolean"}
# serviceAccount.create -- service account will be created
create: true
# @schema {"name": "serviceAccount.name", "type": "string"}
# serviceAccount.name -- name of service account
name: vald-helm-operator

# @schema {"name": "resources", "type": "object"}
# resources -- k8s resources of pod
resources: {}

# @schema {"name": "nodeSelector", "type": "object"}
# nodeSelector -- node labels for pod assignment
nodeSelector: {}

# @schema {"name": "tolerations", "type": "array", "items": {"type": "object"}}
# tolerations -- tolerations
tolerations: []

# @schema {"name": "affinity", "type": "object"}
# affinity -- affinity
affinity: {}

# @schema {"name": "reconcilePeriod", "type": "string"}
# reconcilePeriod -- reconcile duration of operator
reconcilePeriod: 1m

# @schema {"name": "maxWorkers", "type": "integer"}
# maxWorkers -- number of workers inside one operator pod
maxWorkers: 1

# @schema {"name": "logging", "type": "object"}
logging:
# @schema {"name": "logging.level", "type": "string", "enum": ["debug", "info", "error"]}
# logging.level -- logging level of operator (debug, info, or error)
level: info
# @schema {"name": "logging.stacktraceLevel", "type": "string", "enum": ["debug", "info", "error"]}
# logging.stacktraceLevel -- minimum log level triggers stacktrace generation
stacktraceLevel: error
# @schema {"name": "logging.format", "type": "string", "enum": ["console", "json"]}
# logging.format -- logging format of operator (console or json)
format: console
# @schema {"name": "logging.timeEncoding", "type": "string", "enum": ["epoch", "millis", "nano", "iso8601"]}
# logging.timeEncoding -- logging time format of operator (epoch, millis, nano, or iso8601)
timeEncoding: iso8601
1 change: 1 addition & 0 deletions charts/vald/values.schema.json

Large diffs are not rendered by default.

Loading