Skip to content

Commit

Permalink
chore: improve values schema
Browse files Browse the repository at this point in the history
  • Loading branch information
eshepelyuk committed Dec 8, 2020
1 parent 03acd18 commit a19b724
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 50 deletions.
3 changes: 2 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Connection settings could be configured for all clusters at once or per dedicate
[source,yaml]
----
cmak:
commonClusters:
clustersCommon:
curatorConfig:
zkMaxRetry: 100 # <1>
clusters:
Expand All @@ -122,6 +122,7 @@ cmak:
zkConnect: "kafka01.stage:2181,kafka02.stage:2181"
- name: "cluster-prod"
kafkaVersion: "2.1.0" # <3>
enabled: false
curatorConfig:
zkConnect: "kafka01.prod:2181,kafka02.prod:2181,kafka03.prod:2181"
----
Expand Down
4 changes: 3 additions & 1 deletion values-lint.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
cmak:
commonClusters:
clustersCommon:
curatorConfig:
zkMaxRetry: 100

clusters:
- name: "cluster-stage"
kafkaVersion: "2.5.0"
curatorConfig:
zkConnect: "kafka01.stage:2181,kafka02.stage:2181"
- name: "cluster-prod"
enabled: false
kafkaVersion: "2.1.0"
curatorConfig:
zkConnect: "kafka01.prod:2181,kafka02.prod:2181,kafka03.prod:2181"
119 changes: 73 additions & 46 deletions values.schema.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,102 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://github.com/eshepelyuk/cmak-operator/",
"type": "object",
"title": "CMAK operator Helm values",
"required": [
"cmak",
"reconcile"
],

"definitions": {
"curatorConfigCommon": {
"type": "object",
"properties": {
"zkMaxRetry": { "type": "integer", "default": 100 },
"baseSleepTimeMs": { "type": "integer", "default": 100 },
"maxSleepTimeMs": { "type": "integer", "default": 1000 }
}
},
"curatorConfig": {
"type": "object", "required": ["zkConnect"],
"allOf": [
{ "$ref": "#/definitions/curatorConfigCommon" },
{ "properties": {
"zkConnect": { "type": "string" }
}
}
]
},
"clusterConfigShared": {
"type": "object",
"properties": {
"kafkaVersion": { "type": "string", "default": "2.2.0" }
}
},
"clusterConfigCommon": {
"type": "object", "required": ["curatorConfig"],
"allOf": [
{ "$ref": "#/definitions/clusterConfigShared" },
{ "properties": {
"curatorConfig": { "$ref": "#/definitions/curatorConfigCommon" }
}
}
]
},
"clusterConfig": {
"type": "object", "required": ["name", "curatorConfig"],
"allOf": [
{ "$ref": "#/definitions/clusterConfigShared" },
{ "properties": {
"name": { "type": "string" },
"enabled": { "type": "boolean", "default": true },
"curatorConfig": { "$ref": "#/definitions/curatorConfig" }
}
}
]
}
},

"type": "object", "additionalProperties": false,
"required": ["cmak", "reconcile"],

"properties": {
"reconcile": {
"type": "object",
"required": [
"schedule"
],
"type": "object", "additionalProperties": false,
"required": ["schedule"],
"properties": {
"schedule": {
"type": "string",
"title": "cron expression for periodic reconciliation"
"type": "string", "title": "cron expression for periodic reconciliation"
},
"overwriteZk": {
"type": "boolean",
"title": "allow overwrite Zookeeper settings of CMAK",
"default": true
"type": "boolean", "default": true, "title": "allow overwrite Zookeeper settings of CMAK"
},
"successfulJobsHistoryLimit": {
"type": "integer",
"title": "how many completed jobs should be kept"
"type": ["null", "integer"], "default": null, "title": "how many completed jobs should be kept"
},
"failedJobsHistoryLimit": {
"type": "integer",
"title": "how many failed jobs should be kept"
"type": ["null", "integer"], "default": null, "title": "how many failed jobs should be kept"
}

},
"additionalProperties": false
}
},
"cmak": {
"$id": "#/properties/cmak",
"type": "object",
"required": [
"basicAuth"
],
"type": "object", "additionalProperties": false,
"required": ["basicAuth", "clustersCommon", "clusters"],
"properties": {
"basicAuth": {
"$id": "#/properties/cmak/properties/basicAuth",
"type": "object",
"required": [
"enabled"
],
"type": "object", "additionalProperties": false, "required": ["enabled"],
"properties": {
"enabled": {
"type": "boolean",
"title": "enable Basic auth",
"default": false
"type": "boolean", "default": false, "title": "enable Basic auth"
},
"username": {
"type": "string",
"title": "username for Basic auth",
"default": ""
"type": "string", "default": "", "title": "username for Basic auth"
},
"password": {
"type": "string",
"title": "password for Basic auth",
"default": ""
"type": "string", "default": "", "title": "password for Basic auth"
}
},
"additionalProperties": false
}
},
"clustersCommon": { "$ref": "#/definitions/clusterConfigCommon" },
"clusters": {
"type": "array", "items": { "$ref": "#/definitions/clusterConfig" }
}
},
"additionalProperties": true
}
}
},
"additionalProperties": true
}
}
4 changes: 2 additions & 2 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ cmak:
reconcile:
schedule: "*/2 * * * *"
overwriteZk: true
# successfulJobsHistoryLimit:
# failedJobsHistoryLimit:
successfulJobsHistoryLimit: null
failedJobsHistoryLimit: null

0 comments on commit a19b724

Please sign in to comment.