diff --git a/README.adoc b/README.adoc index 423a3c5..a3286a7 100644 --- a/README.adoc +++ b/README.adoc @@ -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: @@ -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" ---- diff --git a/values-lint.yaml b/values-lint.yaml index 81e895b..152aa46 100644 --- a/values-lint.yaml +++ b/values-lint.yaml @@ -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" diff --git a/values.schema.json b/values.schema.json index e52c723..889b1bd 100644 --- a/values.schema.json +++ b/values.schema.json @@ -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 + } } diff --git a/values.yaml b/values.yaml index 2a45ec3..16ecc76 100644 --- a/values.yaml +++ b/values.yaml @@ -49,5 +49,5 @@ cmak: reconcile: schedule: "*/2 * * * *" overwriteZk: true - # successfulJobsHistoryLimit: - # failedJobsHistoryLimit: + successfulJobsHistoryLimit: null + failedJobsHistoryLimit: null