diff --git a/Makefile b/Makefile index 7edb33490..cab8b9910 100644 --- a/Makefile +++ b/Makefile @@ -121,3 +121,8 @@ SHELLSPEC_INCLUDE_PATH := $(shell ./utils/get_shellspec_include_path.sh) .PHONY: scripts-test-kcov scripts-test-kcov: install-shellspec ## Run shellspec unit test cases. @shellspec --load-path $(SHELLSPEC_LOAD_PATH) --default-path $(SHELLSPEC_DEFAULT_PATH) --shell $(SHELLSPEC_DEFAULT_SHELL) --kcov --kcov-options "--include-path=$(SHELLSPEC_INCLUDE_PATH) --path-strip-level=1" + +CHART_FOLDER ?= +.PHONY: test-charts +test-charts: ## Run helm template tests for all charts. + @./hack/test-charts.sh $(CHART_FOLDER) diff --git a/addons-cluster/apecloud-mysql/templates/_helpers.tpl b/addons-cluster/apecloud-mysql/templates/_helpers.tpl index 43fc497e0..14df7abc9 100644 --- a/addons-cluster/apecloud-mysql/templates/_helpers.tpl +++ b/addons-cluster/apecloud-mysql/templates/_helpers.tpl @@ -115,7 +115,7 @@ raftGroup mode: max(replicas, 3) - ReadWriteOnce resources: requests: - storage: {{ .Values.etcd.local.resources.storage }} + storage: {{ print .Values.etcd.local.resources.storage "Gi" }} {{- end -}} {{- define "apecloud-mysql-cluster.schedulingPolicy" }} diff --git a/addons-cluster/apecloud-mysql/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/apecloud-mysql/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/apecloud-mysql/tests/fail/cpu-too-high.yaml b/addons-cluster/apecloud-mysql/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/apecloud-mysql/tests/fail/cpu-too-low.yaml b/addons-cluster/apecloud-mysql/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/apecloud-mysql/tests/fail/etcd-mode-invalid.yaml b/addons-cluster/apecloud-mysql/tests/fail/etcd-mode-invalid.yaml new file mode 100644 index 000000000..eecb9a403 --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/fail/etcd-mode-invalid.yaml @@ -0,0 +1,4 @@ +mode: raftGroup +proxyEnabled: true +etcd: + mode: invalid diff --git a/addons-cluster/apecloud-mysql/tests/fail/etcd-replicas-too-high.yaml b/addons-cluster/apecloud-mysql/tests/fail/etcd-replicas-too-high.yaml new file mode 100644 index 000000000..5ff3c5bb5 --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/fail/etcd-replicas-too-high.yaml @@ -0,0 +1,6 @@ +mode: raftGroup +proxyEnabled: true +etcd: + mode: local + local: + replicas: 4 diff --git a/addons-cluster/apecloud-mysql/tests/fail/etcd-replicas-too-low.yaml b/addons-cluster/apecloud-mysql/tests/fail/etcd-replicas-too-low.yaml new file mode 100644 index 000000000..6d16552db --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/fail/etcd-replicas-too-low.yaml @@ -0,0 +1,6 @@ +mode: raftGroup +proxyEnabled: true +etcd: + mode: local + local: + replicas: 0 diff --git a/addons-cluster/apecloud-mysql/tests/fail/invalid-mode.yaml b/addons-cluster/apecloud-mysql/tests/fail/invalid-mode.yaml new file mode 100644 index 000000000..d1d0695e4 --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/fail/invalid-mode.yaml @@ -0,0 +1 @@ +mode: invalid-mode diff --git a/addons-cluster/apecloud-mysql/tests/fail/memory-too-high.yaml b/addons-cluster/apecloud-mysql/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/apecloud-mysql/tests/fail/memory-too-low.yaml b/addons-cluster/apecloud-mysql/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/apecloud-mysql/tests/fail/raftgroup-replicas-too-high.yaml b/addons-cluster/apecloud-mysql/tests/fail/raftgroup-replicas-too-high.yaml new file mode 100644 index 000000000..a0c87ae95 --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/fail/raftgroup-replicas-too-high.yaml @@ -0,0 +1,2 @@ +mode: raftGroup +replicas: 7 diff --git a/addons-cluster/apecloud-mysql/tests/fail/raftgroup-replicas-too-low.yaml b/addons-cluster/apecloud-mysql/tests/fail/raftgroup-replicas-too-low.yaml new file mode 100644 index 000000000..914e2a4a5 --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/fail/raftgroup-replicas-too-low.yaml @@ -0,0 +1,2 @@ +mode: raftGroup +replicas: 0 diff --git a/addons-cluster/apecloud-mysql/tests/fail/storage-too-high.yaml b/addons-cluster/apecloud-mysql/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/apecloud-mysql/tests/fail/storage-too-low.yaml b/addons-cluster/apecloud-mysql/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..55e2bf62c --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0.5 diff --git a/addons-cluster/apecloud-mysql/tests/pass/defaults.yaml b/addons-cluster/apecloud-mysql/tests/pass/defaults.yaml new file mode 100644 index 000000000..0d2113f86 --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (mode: standalone) diff --git a/addons-cluster/apecloud-mysql/tests/pass/etcd-replicas-max.yaml b/addons-cluster/apecloud-mysql/tests/pass/etcd-replicas-max.yaml new file mode 100644 index 000000000..8372e7a8a --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/pass/etcd-replicas-max.yaml @@ -0,0 +1,6 @@ +mode: raftGroup +proxyEnabled: true +etcd: + mode: local + local: + replicas: 3 diff --git a/addons-cluster/apecloud-mysql/tests/pass/etcd-replicas.yaml b/addons-cluster/apecloud-mysql/tests/pass/etcd-replicas.yaml new file mode 100644 index 000000000..6653f1fa1 --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/pass/etcd-replicas.yaml @@ -0,0 +1,6 @@ +mode: raftGroup +proxyEnabled: true +etcd: + mode: local + local: + replicas: 1 diff --git a/addons-cluster/apecloud-mysql/tests/pass/max-values.yaml b/addons-cluster/apecloud-mysql/tests/pass/max-values.yaml new file mode 100644 index 000000000..83f00ed3c --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 5 +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/apecloud-mysql/tests/pass/min-values.yaml b/addons-cluster/apecloud-mysql/tests/pass/min-values.yaml new file mode 100644 index 000000000..901e3628b --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/pass/min-values.yaml @@ -0,0 +1,4 @@ +replicas: 1 +cpu: 0.5 +memory: 0.5 +storage: 1 diff --git a/addons-cluster/apecloud-mysql/tests/pass/raftgroup-proxy-etcd-serviceref.yaml b/addons-cluster/apecloud-mysql/tests/pass/raftgroup-proxy-etcd-serviceref.yaml new file mode 100644 index 000000000..dfd16b767 --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/pass/raftgroup-proxy-etcd-serviceref.yaml @@ -0,0 +1,8 @@ +mode: raftGroup +replicas: 3 +proxyEnabled: true +etcd: + mode: serviceRef + serviceRef: + cluster: + name: my-etcd diff --git a/addons-cluster/apecloud-mysql/tests/pass/raftgroup-proxy.yaml b/addons-cluster/apecloud-mysql/tests/pass/raftgroup-proxy.yaml new file mode 100644 index 000000000..ccba2945b --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/pass/raftgroup-proxy.yaml @@ -0,0 +1,3 @@ +mode: raftGroup +replicas: 3 +proxyEnabled: true diff --git a/addons-cluster/apecloud-mysql/tests/pass/raftgroup.yaml b/addons-cluster/apecloud-mysql/tests/pass/raftgroup.yaml new file mode 100644 index 000000000..ada76f24c --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/pass/raftgroup.yaml @@ -0,0 +1,2 @@ +mode: raftGroup +replicas: 3 diff --git a/addons-cluster/apecloud-mysql/tests/pass/replicas-max.yaml b/addons-cluster/apecloud-mysql/tests/pass/replicas-max.yaml new file mode 100644 index 000000000..94afaeec4 --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/pass/replicas-max.yaml @@ -0,0 +1,2 @@ +mode: raftGroup +replicas: 5 diff --git a/addons-cluster/apecloud-mysql/tests/pass/resources.yaml b/addons-cluster/apecloud-mysql/tests/pass/resources.yaml new file mode 100644 index 000000000..674f8d5e4 --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/pass/resources.yaml @@ -0,0 +1,16 @@ +cpu: 2 +memory: 4 + +asserts: + - equal: + path: ".spec.componentSpecs[0].resources.limits.cpu" + value: "2" + - equal: + path: ".spec.componentSpecs[0].resources.limits.memory" + value: "4Gi" + - equal: + path: ".spec.componentSpecs[0].resources.requests.cpu" + value: "2" + - equal: + path: ".spec.componentSpecs[0].resources.requests.memory" + value: "4Gi" diff --git a/addons-cluster/apecloud-mysql/tests/pass/storageclass.yaml b/addons-cluster/apecloud-mysql/tests/pass/storageclass.yaml new file mode 100644 index 000000000..b5f32e90e --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/pass/storageclass.yaml @@ -0,0 +1,16 @@ +storageClassName: "my-storage-class" +proxy: + storageClassName: "my-proxy-storage-class" +mode: raftGroup +proxyEnabled: true + +asserts: + - equal: + path: ".spec.componentSpecs[0].volumeClaimTemplates[0].spec.storageClassName" + value: "my-storage-class" + - equal: + path: ".spec.componentSpecs[1].volumeClaimTemplates[0].spec.storageClassName" + value: "my-proxy-storage-class" + - equal: + path: ".spec.componentSpecs[3].volumeClaimTemplates[0].spec.storageClassName" + value: "my-proxy-storage-class" diff --git a/addons-cluster/apecloud-mysql/tests/pass/string-values.yaml b/addons-cluster/apecloud-mysql/tests/pass/string-values.yaml new file mode 100644 index 000000000..b847608e1 --- /dev/null +++ b/addons-cluster/apecloud-mysql/tests/pass/string-values.yaml @@ -0,0 +1,3 @@ +cpu: "1.5" +memory: "10" +storage: "50" diff --git a/addons-cluster/apecloud-mysql/values.schema.json b/addons-cluster/apecloud-mysql/values.schema.json index 802b9164e..c7969786f 100644 --- a/addons-cluster/apecloud-mysql/values.schema.json +++ b/addons-cluster/apecloud-mysql/values.schema.json @@ -36,6 +36,7 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -47,7 +48,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -58,7 +60,8 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", @@ -100,8 +103,14 @@ "type": "object", "properties": { "storage": { - "type": "string", - "default": "20Gi" + "type": [ + "number", + "string" + ], + "default": 20, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } diff --git a/addons-cluster/apecloud-mysql/values.yaml b/addons-cluster/apecloud-mysql/values.yaml index 29686ef24..aaebd6b6d 100644 --- a/addons-cluster/apecloud-mysql/values.yaml +++ b/addons-cluster/apecloud-mysql/values.yaml @@ -33,6 +33,9 @@ requests: ## storage: 20 +## @param storageClassName +storageClassName: "" + ## @param proxyEnabled if true, enable the proxy ## if mode is standalone, proxyEnabled is always false ## if mode is raftGroup, proxyEnabled can be true or false @@ -60,7 +63,7 @@ etcd: etcdctlApi: "3" # the etcd tool etcdctl api version replicas: 3 # no support other num resources: - storage: 20Gi + storage: 20 serviceRef: # -- Kubernetes namespace for etcd # @default default diff --git a/addons-cluster/clickhouse/templates/_helpers.tpl b/addons-cluster/clickhouse/templates/_helpers.tpl index 80daf6a36..a83ebeb1d 100644 --- a/addons-cluster/clickhouse/templates/_helpers.tpl +++ b/addons-cluster/clickhouse/templates/_helpers.tpl @@ -100,7 +100,7 @@ Define clickhouse componentSpec with ComponentDefinition. - name: clickhouse componentDef: {{ include "clickhouse-cluster.cmpdName" . }} replicas: {{ $.Values.replicas | default 2 }} - disableExporter: {{ $.Values.disableExporter | default "false" }} + disableExporter: {{ $.Values.extra.disableExporter | default "false" }} serviceVersion: {{ $.Values.version }} services: - name: default @@ -128,7 +128,7 @@ Define clickhouse keeper componentSpec with ComponentDefinition. - name: ch-keeper componentDef: {{ include "clickhouse-cluster.keeperCmpdName" . }} replicas: {{ .Values.keeper.replicas }} - disableExporter: {{ $.Values.disableExporter | default "false" }} + disableExporter: {{ $.Values.extra.disableExporter | default "false" }} serviceVersion: {{ $.Values.version }} {{- with .Values.keeper.tolerations }} tolerations: {{ .| toYaml | nindent 4 }} @@ -177,9 +177,9 @@ Define clickhouse shardingComponentSpec with ComponentDefinition. env: - name: "INIT_CLUSTER_NAME" value: "{{ .Values.clickhouse.initClusterName }}" - replicas: {{ $.Values.replicas | default 2 }} - disableExporter: {{ $.Values.disableExporter | default "false" }} - serviceVersion: {{ $.Values.version }} + replicas: {{ .Values.replicas | default 2 }} + disableExporter: {{ .Values.extra.disableExporter | default "false" }} + serviceVersion: {{ .Values.version }} services: - name: default serviceType: {{ .Values.service.type | default "NodePort" }} @@ -191,7 +191,7 @@ Define clickhouse shardingComponentSpec with ComponentDefinition. numSymbols: 0 letterCase: MixedCases seed: {{ include "kblib.clusterName" . }} - {{- with $.Values.tolerations }} + {{- with .Values.tolerations }} tolerations: {{ .| toYaml | nindent 6 }} {{- end }} {{- include "kblib.componentResources" . | indent 4 }} @@ -211,16 +211,16 @@ Define clickhouse componentSpec with compatible ComponentDefinition API - name: {{ $name }} env: - name: "INIT_CLUSTER_NAME" - value: "{{ .Values.clickhouse.initClusterName }}" - componentDef: {{ include "clickhouse-cluster.cmpdName" . }} + value: "{{ $.Values.clickhouse.initClusterName }}" + componentDef: {{ include "clickhouse-cluster.cmpdName" $ }} replicas: {{ $.Values.replicas | default 2 }} - disableExporter: {{ $.Values.disableExporter | default "false" }} + disableExporter: {{ $.Values.extra.disableExporter | default "false" }} serviceVersion: {{ $.Values.version }} {{- with $.Values.tolerations }} tolerations: {{ .| toYaml | nindent 4 }} services: - name: default - serviceType: {{ .Values.service.type | default "NodePort" }} + serviceType: {{ $.Values.service.type | default "NodePort" }} {{- end }} {{- include "kblib.componentResources" $ | indent 2 }} {{- include "kblib.componentStorages" $ | indent 2 }} diff --git a/addons-cluster/clickhouse/tests/fail/cpu-too-high.yaml b/addons-cluster/clickhouse/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/clickhouse/tests/fail/cpu-too-low.yaml b/addons-cluster/clickhouse/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/clickhouse/tests/fail/invalid-mode.yaml b/addons-cluster/clickhouse/tests/fail/invalid-mode.yaml new file mode 100644 index 000000000..fc7b62207 --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/invalid-mode.yaml @@ -0,0 +1 @@ +mode: invalid diff --git a/addons-cluster/clickhouse/tests/fail/invalid-service-type.yaml b/addons-cluster/clickhouse/tests/fail/invalid-service-type.yaml new file mode 100644 index 000000000..5cc4dba65 --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/invalid-service-type.yaml @@ -0,0 +1,2 @@ +service: + type: InvalidType diff --git a/addons-cluster/clickhouse/tests/fail/invalid-tls-issuer.yaml b/addons-cluster/clickhouse/tests/fail/invalid-tls-issuer.yaml new file mode 100644 index 000000000..6b48a9c1c --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/invalid-tls-issuer.yaml @@ -0,0 +1,3 @@ +tls: + enabled: true + issuer: InvalidIssuer diff --git a/addons-cluster/clickhouse/tests/fail/keeper-cpu-too-high.yaml b/addons-cluster/clickhouse/tests/fail/keeper-cpu-too-high.yaml new file mode 100644 index 000000000..5ef3e38e5 --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/keeper-cpu-too-high.yaml @@ -0,0 +1,2 @@ +keeper: + cpu: 65 diff --git a/addons-cluster/clickhouse/tests/fail/keeper-cpu-too-low.yaml b/addons-cluster/clickhouse/tests/fail/keeper-cpu-too-low.yaml new file mode 100644 index 000000000..f7cf1d698 --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/keeper-cpu-too-low.yaml @@ -0,0 +1,2 @@ +keeper: + cpu: 0.05 diff --git a/addons-cluster/clickhouse/tests/fail/keeper-memory-too-high.yaml b/addons-cluster/clickhouse/tests/fail/keeper-memory-too-high.yaml new file mode 100644 index 000000000..836c6707f --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/keeper-memory-too-high.yaml @@ -0,0 +1,2 @@ +keeper: + memory: 1001 diff --git a/addons-cluster/clickhouse/tests/fail/keeper-memory-too-low.yaml b/addons-cluster/clickhouse/tests/fail/keeper-memory-too-low.yaml new file mode 100644 index 000000000..a4ff84bba --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/keeper-memory-too-low.yaml @@ -0,0 +1,2 @@ +keeper: + memory: 0.1 diff --git a/addons-cluster/clickhouse/tests/fail/keeper-replicas-invalid.yaml b/addons-cluster/clickhouse/tests/fail/keeper-replicas-invalid.yaml new file mode 100644 index 000000000..5a201704e --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/keeper-replicas-invalid.yaml @@ -0,0 +1,2 @@ +keeper: + replicas: 2 diff --git a/addons-cluster/clickhouse/tests/fail/keeper-storage-too-high.yaml b/addons-cluster/clickhouse/tests/fail/keeper-storage-too-high.yaml new file mode 100644 index 000000000..6d7f15cfd --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/keeper-storage-too-high.yaml @@ -0,0 +1,2 @@ +keeper: + storage: 10001 diff --git a/addons-cluster/clickhouse/tests/fail/keeper-storage-too-low.yaml b/addons-cluster/clickhouse/tests/fail/keeper-storage-too-low.yaml new file mode 100644 index 000000000..7417d04cd --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/keeper-storage-too-low.yaml @@ -0,0 +1,2 @@ +keeper: + storage: 0 diff --git a/addons-cluster/clickhouse/tests/fail/memory-too-high.yaml b/addons-cluster/clickhouse/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/clickhouse/tests/fail/memory-too-low.yaml b/addons-cluster/clickhouse/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/clickhouse/tests/fail/replicas-too-low.yaml b/addons-cluster/clickhouse/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/clickhouse/tests/fail/shards-too-low.yaml b/addons-cluster/clickhouse/tests/fail/shards-too-low.yaml new file mode 100644 index 000000000..478e8b62c --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/shards-too-low.yaml @@ -0,0 +1 @@ +shards: 0 diff --git a/addons-cluster/clickhouse/tests/fail/storage-too-high.yaml b/addons-cluster/clickhouse/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/clickhouse/tests/fail/storage-too-low.yaml b/addons-cluster/clickhouse/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/clickhouse/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/clickhouse/tests/pass/defaults.yaml b/addons-cluster/clickhouse/tests/pass/defaults.yaml new file mode 100644 index 000000000..8d6639185 --- /dev/null +++ b/addons-cluster/clickhouse/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (mode: cluster, sharding: true) diff --git a/addons-cluster/clickhouse/tests/pass/keeper-replicas-3.yaml b/addons-cluster/clickhouse/tests/pass/keeper-replicas-3.yaml new file mode 100644 index 000000000..3caf9ba99 --- /dev/null +++ b/addons-cluster/clickhouse/tests/pass/keeper-replicas-3.yaml @@ -0,0 +1,2 @@ +keeper: + replicas: 3 diff --git a/addons-cluster/clickhouse/tests/pass/keeper-replicas-5.yaml b/addons-cluster/clickhouse/tests/pass/keeper-replicas-5.yaml new file mode 100644 index 000000000..81fc17239 --- /dev/null +++ b/addons-cluster/clickhouse/tests/pass/keeper-replicas-5.yaml @@ -0,0 +1,2 @@ +keeper: + replicas: 5 diff --git a/addons-cluster/clickhouse/tests/pass/max-values.yaml b/addons-cluster/clickhouse/tests/pass/max-values.yaml new file mode 100644 index 000000000..035dcee68 --- /dev/null +++ b/addons-cluster/clickhouse/tests/pass/max-values.yaml @@ -0,0 +1,9 @@ +replicas: 10 +cpu: 64 +memory: 1000 +storage: 10000 +keeper: + replicas: 5 + cpu: 64 + memory: 1000 + storage: 10000 diff --git a/addons-cluster/clickhouse/tests/pass/no-sharding.yaml b/addons-cluster/clickhouse/tests/pass/no-sharding.yaml new file mode 100644 index 000000000..2c91fe2d5 --- /dev/null +++ b/addons-cluster/clickhouse/tests/pass/no-sharding.yaml @@ -0,0 +1,2 @@ +mode: cluster +sharding: false diff --git a/addons-cluster/clickhouse/tests/pass/service-externalname.yaml b/addons-cluster/clickhouse/tests/pass/service-externalname.yaml new file mode 100644 index 000000000..3ead960ba --- /dev/null +++ b/addons-cluster/clickhouse/tests/pass/service-externalname.yaml @@ -0,0 +1,2 @@ +service: + type: ExternalName diff --git a/addons-cluster/clickhouse/tests/pass/service-loadbalancer.yaml b/addons-cluster/clickhouse/tests/pass/service-loadbalancer.yaml new file mode 100644 index 000000000..42838b76e --- /dev/null +++ b/addons-cluster/clickhouse/tests/pass/service-loadbalancer.yaml @@ -0,0 +1,2 @@ +service: + type: LoadBalancer diff --git a/addons-cluster/clickhouse/tests/pass/service-nodeport.yaml b/addons-cluster/clickhouse/tests/pass/service-nodeport.yaml new file mode 100644 index 000000000..eb6ea6526 --- /dev/null +++ b/addons-cluster/clickhouse/tests/pass/service-nodeport.yaml @@ -0,0 +1,2 @@ +service: + type: NodePort diff --git a/addons-cluster/clickhouse/tests/pass/sharding-disabled-with-multiple-shards.yaml b/addons-cluster/clickhouse/tests/pass/sharding-disabled-with-multiple-shards.yaml new file mode 100644 index 000000000..527ff2516 --- /dev/null +++ b/addons-cluster/clickhouse/tests/pass/sharding-disabled-with-multiple-shards.yaml @@ -0,0 +1,2 @@ +sharding: false +shards: 2 diff --git a/addons-cluster/clickhouse/tests/pass/sharding-disabled.yaml b/addons-cluster/clickhouse/tests/pass/sharding-disabled.yaml new file mode 100644 index 000000000..316bbbcee --- /dev/null +++ b/addons-cluster/clickhouse/tests/pass/sharding-disabled.yaml @@ -0,0 +1 @@ +sharding: false diff --git a/addons-cluster/clickhouse/tests/pass/shards-3.yaml b/addons-cluster/clickhouse/tests/pass/shards-3.yaml new file mode 100644 index 000000000..ca11f86cd --- /dev/null +++ b/addons-cluster/clickhouse/tests/pass/shards-3.yaml @@ -0,0 +1 @@ +shards: 3 diff --git a/addons-cluster/clickhouse/tests/pass/standalone.yaml b/addons-cluster/clickhouse/tests/pass/standalone.yaml new file mode 100644 index 000000000..b89a257d1 --- /dev/null +++ b/addons-cluster/clickhouse/tests/pass/standalone.yaml @@ -0,0 +1 @@ +mode: standalone diff --git a/addons-cluster/clickhouse/tests/pass/tls-enabled.yaml b/addons-cluster/clickhouse/tests/pass/tls-enabled.yaml new file mode 100644 index 000000000..6ba315aea --- /dev/null +++ b/addons-cluster/clickhouse/tests/pass/tls-enabled.yaml @@ -0,0 +1,2 @@ +tls: + enabled: true diff --git a/addons-cluster/clickhouse/tests/pass/tls-kubeblocks-issuer.yaml b/addons-cluster/clickhouse/tests/pass/tls-kubeblocks-issuer.yaml new file mode 100644 index 000000000..7662fc866 --- /dev/null +++ b/addons-cluster/clickhouse/tests/pass/tls-kubeblocks-issuer.yaml @@ -0,0 +1,3 @@ +tls: + enabled: true + issuer: KubeBlocks diff --git a/addons-cluster/clickhouse/values.schema.json b/addons-cluster/clickhouse/values.schema.json index a4a63d0dc..ab703e5ba 100644 --- a/addons-cluster/clickhouse/values.schema.json +++ b/addons-cluster/clickhouse/values.schema.json @@ -49,7 +49,8 @@ ], "default": 1, "minimum": 0.5, - "maximum": 64 + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "memory": { "title": "Memory(Gi)", @@ -60,7 +61,8 @@ ], "default": 2, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", @@ -77,7 +79,8 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "keeper": { "title": "ClickHouse Keeper Configuration", @@ -110,7 +113,8 @@ ], "default": 1, "minimum": 0.1, - "maximum": 64 + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "memory": { "title": "Keeper Memory(Gi)", @@ -121,7 +125,8 @@ ], "default": 2, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Keeper Storage(Gi)", @@ -132,7 +137,8 @@ ], "default": 10, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "tolerations": { "title": "Keeper Tolerations", diff --git a/addons-cluster/clickhouse/values.yaml b/addons-cluster/clickhouse/values.yaml index 10d487c00..782bdacea 100644 --- a/addons-cluster/clickhouse/values.yaml +++ b/addons-cluster/clickhouse/values.yaml @@ -29,7 +29,7 @@ requests: storageClassName: "" storage: 20 -disableExporter: false + ## Tolerations for ClickHouse pods assignment ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ @@ -67,3 +67,4 @@ extra: ## Define Cluster termination policy. ## Options: DoNotTerminate, Delete, WipeOut. terminationPolicy: Delete + disableExporter: false \ No newline at end of file diff --git a/addons-cluster/elasticsearch/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/elasticsearch/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/elasticsearch/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/elasticsearch/tests/fail/cpu-too-high.yaml b/addons-cluster/elasticsearch/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/elasticsearch/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/elasticsearch/tests/fail/cpu-too-low.yaml b/addons-cluster/elasticsearch/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/elasticsearch/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/elasticsearch/tests/fail/invalid-mode.yaml b/addons-cluster/elasticsearch/tests/fail/invalid-mode.yaml new file mode 100644 index 000000000..fc7b62207 --- /dev/null +++ b/addons-cluster/elasticsearch/tests/fail/invalid-mode.yaml @@ -0,0 +1 @@ +mode: invalid diff --git a/addons-cluster/elasticsearch/tests/fail/memory-too-high.yaml b/addons-cluster/elasticsearch/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/elasticsearch/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/elasticsearch/tests/fail/memory-too-low.yaml b/addons-cluster/elasticsearch/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..456d3865c --- /dev/null +++ b/addons-cluster/elasticsearch/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.5 diff --git a/addons-cluster/elasticsearch/tests/fail/replicas-too-high.yaml b/addons-cluster/elasticsearch/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/elasticsearch/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/elasticsearch/tests/fail/replicas-too-low.yaml b/addons-cluster/elasticsearch/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/elasticsearch/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/elasticsearch/tests/fail/storage-too-high.yaml b/addons-cluster/elasticsearch/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/elasticsearch/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/elasticsearch/tests/fail/storage-too-low.yaml b/addons-cluster/elasticsearch/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/elasticsearch/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/elasticsearch/tests/pass/defaults.yaml b/addons-cluster/elasticsearch/tests/pass/defaults.yaml new file mode 100644 index 000000000..3787dbf69 --- /dev/null +++ b/addons-cluster/elasticsearch/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (mode: multi-node) diff --git a/addons-cluster/elasticsearch/tests/pass/max-values.yaml b/addons-cluster/elasticsearch/tests/pass/max-values.yaml new file mode 100644 index 000000000..83f00ed3c --- /dev/null +++ b/addons-cluster/elasticsearch/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 5 +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/elasticsearch/tests/pass/min-values.yaml b/addons-cluster/elasticsearch/tests/pass/min-values.yaml new file mode 100644 index 000000000..1c738f91e --- /dev/null +++ b/addons-cluster/elasticsearch/tests/pass/min-values.yaml @@ -0,0 +1,4 @@ +replicas: 1 +cpu: 0.5 +memory: 1 +storage: 1 diff --git a/addons-cluster/elasticsearch/tests/pass/single-node.yaml b/addons-cluster/elasticsearch/tests/pass/single-node.yaml new file mode 100644 index 000000000..9a232ce33 --- /dev/null +++ b/addons-cluster/elasticsearch/tests/pass/single-node.yaml @@ -0,0 +1 @@ +mode: single-node diff --git a/addons-cluster/elasticsearch/values.schema.json b/addons-cluster/elasticsearch/values.schema.json index 40a27134b..9e1d6bd80 100644 --- a/addons-cluster/elasticsearch/values.schema.json +++ b/addons-cluster/elasticsearch/values.schema.json @@ -36,6 +36,7 @@ "default": 1, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -47,7 +48,8 @@ ], "default": 2, "minimum": 1, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -58,7 +60,14 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" + }, + "storageClassName": { + "title": "Storage Class Name", + "description": "Storage class name of the data volume", + "type": "string", + "default": "" } } } diff --git a/addons-cluster/elasticsearch/values.yaml b/addons-cluster/elasticsearch/values.yaml index ec8f5a9af..36425c6ee 100644 --- a/addons-cluster/elasticsearch/values.yaml +++ b/addons-cluster/elasticsearch/values.yaml @@ -28,6 +28,8 @@ memory: 2 ## storage: 20 +storageClassName: "" + nameOverride: "" fullnameOverride: "" diff --git a/addons-cluster/etcd/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/etcd/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/etcd/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/etcd/tests/fail/cpu-too-high.yaml b/addons-cluster/etcd/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/etcd/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/etcd/tests/fail/cpu-too-low.yaml b/addons-cluster/etcd/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/etcd/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/etcd/tests/fail/invalid-client-service-type.yaml b/addons-cluster/etcd/tests/fail/invalid-client-service-type.yaml new file mode 100644 index 000000000..9bb4064be --- /dev/null +++ b/addons-cluster/etcd/tests/fail/invalid-client-service-type.yaml @@ -0,0 +1,2 @@ +clientService: + type: invalid diff --git a/addons-cluster/etcd/tests/fail/invalid-peer-service-type.yaml b/addons-cluster/etcd/tests/fail/invalid-peer-service-type.yaml new file mode 100644 index 000000000..d7ba25381 --- /dev/null +++ b/addons-cluster/etcd/tests/fail/invalid-peer-service-type.yaml @@ -0,0 +1,2 @@ +peerService: + type: invalid diff --git a/addons-cluster/etcd/tests/fail/memory-too-high.yaml b/addons-cluster/etcd/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/etcd/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/etcd/tests/fail/memory-too-low.yaml b/addons-cluster/etcd/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/etcd/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/etcd/tests/fail/replicas-too-high.yaml b/addons-cluster/etcd/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/etcd/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/etcd/tests/fail/replicas-too-low.yaml b/addons-cluster/etcd/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/etcd/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/etcd/tests/fail/storage-too-high.yaml b/addons-cluster/etcd/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/etcd/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/etcd/tests/fail/storage-too-low.yaml b/addons-cluster/etcd/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/etcd/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/etcd/tests/pass/client-loadbalancer.yaml b/addons-cluster/etcd/tests/pass/client-loadbalancer.yaml new file mode 100644 index 000000000..a8af088fc --- /dev/null +++ b/addons-cluster/etcd/tests/pass/client-loadbalancer.yaml @@ -0,0 +1,2 @@ +clientService: + type: LoadBalancer diff --git a/addons-cluster/etcd/tests/pass/client-nodeport.yaml b/addons-cluster/etcd/tests/pass/client-nodeport.yaml new file mode 100644 index 000000000..56b092d8d --- /dev/null +++ b/addons-cluster/etcd/tests/pass/client-nodeport.yaml @@ -0,0 +1,2 @@ +clientService: + type: NodePort diff --git a/addons-cluster/etcd/tests/pass/defaults.yaml b/addons-cluster/etcd/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/etcd/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/etcd/tests/pass/max-values.yaml b/addons-cluster/etcd/tests/pass/max-values.yaml new file mode 100644 index 000000000..83f00ed3c --- /dev/null +++ b/addons-cluster/etcd/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 5 +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/etcd/tests/pass/min-values.yaml b/addons-cluster/etcd/tests/pass/min-values.yaml new file mode 100644 index 000000000..901e3628b --- /dev/null +++ b/addons-cluster/etcd/tests/pass/min-values.yaml @@ -0,0 +1,4 @@ +replicas: 1 +cpu: 0.5 +memory: 0.5 +storage: 1 diff --git a/addons-cluster/etcd/tests/pass/peer-loadbalancer.yaml b/addons-cluster/etcd/tests/pass/peer-loadbalancer.yaml new file mode 100644 index 000000000..80e64ed6c --- /dev/null +++ b/addons-cluster/etcd/tests/pass/peer-loadbalancer.yaml @@ -0,0 +1,2 @@ +peerService: + type: LoadBalancer diff --git a/addons-cluster/etcd/tests/pass/tls-enabled.yaml b/addons-cluster/etcd/tests/pass/tls-enabled.yaml new file mode 100644 index 000000000..df957c009 --- /dev/null +++ b/addons-cluster/etcd/tests/pass/tls-enabled.yaml @@ -0,0 +1 @@ +tlsEnable: true diff --git a/addons-cluster/etcd/values.schema.json b/addons-cluster/etcd/values.schema.json index 91ca9a57e..2e4416f46 100644 --- a/addons-cluster/etcd/values.schema.json +++ b/addons-cluster/etcd/values.schema.json @@ -26,6 +26,7 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -37,7 +38,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -48,7 +50,8 @@ ], "default": 10, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", diff --git a/addons-cluster/greptimedb/templates/cluster.yaml b/addons-cluster/greptimedb/templates/cluster.yaml index 3dd89e47e..77f8adde7 100644 --- a/addons-cluster/greptimedb/templates/cluster.yaml +++ b/addons-cluster/greptimedb/templates/cluster.yaml @@ -44,6 +44,9 @@ spec: spec: accessModes: - ReadWriteOnce + {{- if .Values.datanode.volume.storageClassName }} + storageClassName: {{ .Values.datanode.volume.storageClassName | quote }} + {{- end }} resources: requests: storage: {{ print .Values.datanode.volume.storage "Gi" }} @@ -82,6 +85,9 @@ spec: spec: accessModes: - ReadWriteOnce + {{- if .Values.etcd.volume.storageClassName }} + storageClassName: {{ .Values.etcd.volume.storageClassName | quote }} + {{- end }} resources: requests: storage: {{ print .Values.etcd.volume.storage "Gi" }} diff --git a/addons-cluster/greptimedb/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/greptimedb/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/greptimedb/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/greptimedb/tests/fail/cpu-too-high.yaml b/addons-cluster/greptimedb/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/greptimedb/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/greptimedb/tests/fail/cpu-too-low.yaml b/addons-cluster/greptimedb/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/greptimedb/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/greptimedb/tests/fail/datanode-replicas-too-low.yaml b/addons-cluster/greptimedb/tests/fail/datanode-replicas-too-low.yaml new file mode 100644 index 000000000..436be884f --- /dev/null +++ b/addons-cluster/greptimedb/tests/fail/datanode-replicas-too-low.yaml @@ -0,0 +1,2 @@ +datanode: + replicas: 0 diff --git a/addons-cluster/greptimedb/tests/fail/etcd-replicas-too-low.yaml b/addons-cluster/greptimedb/tests/fail/etcd-replicas-too-low.yaml new file mode 100644 index 000000000..be96d9c4d --- /dev/null +++ b/addons-cluster/greptimedb/tests/fail/etcd-replicas-too-low.yaml @@ -0,0 +1,2 @@ +etcd: + replicas: 0 diff --git a/addons-cluster/greptimedb/tests/fail/frontend-replicas-too-low.yaml b/addons-cluster/greptimedb/tests/fail/frontend-replicas-too-low.yaml new file mode 100644 index 000000000..543cb8195 --- /dev/null +++ b/addons-cluster/greptimedb/tests/fail/frontend-replicas-too-low.yaml @@ -0,0 +1,2 @@ +frontend: + replicas: 0 diff --git a/addons-cluster/greptimedb/tests/fail/invalid-termination-policy.yaml b/addons-cluster/greptimedb/tests/fail/invalid-termination-policy.yaml new file mode 100644 index 000000000..938c1e404 --- /dev/null +++ b/addons-cluster/greptimedb/tests/fail/invalid-termination-policy.yaml @@ -0,0 +1 @@ +terminationPolicy: invalid diff --git a/addons-cluster/greptimedb/tests/fail/memory-too-high.yaml b/addons-cluster/greptimedb/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/greptimedb/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/greptimedb/tests/fail/memory-too-low.yaml b/addons-cluster/greptimedb/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/greptimedb/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/greptimedb/tests/fail/meta-replicas-too-low.yaml b/addons-cluster/greptimedb/tests/fail/meta-replicas-too-low.yaml new file mode 100644 index 000000000..234d05ac7 --- /dev/null +++ b/addons-cluster/greptimedb/tests/fail/meta-replicas-too-low.yaml @@ -0,0 +1,2 @@ +meta: + replicas: 0 diff --git a/addons-cluster/greptimedb/tests/fail/replicas-too-high.yaml b/addons-cluster/greptimedb/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/greptimedb/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/greptimedb/tests/fail/replicas-too-low.yaml b/addons-cluster/greptimedb/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/greptimedb/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/greptimedb/tests/fail/storage-too-high.yaml b/addons-cluster/greptimedb/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/greptimedb/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/greptimedb/tests/fail/storage-too-low.yaml b/addons-cluster/greptimedb/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/greptimedb/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/greptimedb/tests/pass/defaults.yaml b/addons-cluster/greptimedb/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/greptimedb/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/greptimedb/tests/pass/max-values.yaml b/addons-cluster/greptimedb/tests/pass/max-values.yaml new file mode 100644 index 000000000..83f00ed3c --- /dev/null +++ b/addons-cluster/greptimedb/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 5 +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/greptimedb/tests/pass/min-values.yaml b/addons-cluster/greptimedb/tests/pass/min-values.yaml new file mode 100644 index 000000000..e51dad50d --- /dev/null +++ b/addons-cluster/greptimedb/tests/pass/min-values.yaml @@ -0,0 +1,16 @@ +replicas: 1 +cpu: 0.5 +memory: 0.5 +storage: 1 +datanode: + replicas: 1 + volume: + storage: 1 +etcd: + replicas: 1 + volume: + storage: 1 +meta: + replicas: 1 +frontend: + replicas: 1 diff --git a/addons-cluster/greptimedb/tests/pass/termination-policy-donotterminate.yaml b/addons-cluster/greptimedb/tests/pass/termination-policy-donotterminate.yaml new file mode 100644 index 000000000..7978d1ed3 --- /dev/null +++ b/addons-cluster/greptimedb/tests/pass/termination-policy-donotterminate.yaml @@ -0,0 +1 @@ +terminationPolicy: DoNotTerminate diff --git a/addons-cluster/greptimedb/tests/pass/termination-policy-wipeout.yaml b/addons-cluster/greptimedb/tests/pass/termination-policy-wipeout.yaml new file mode 100644 index 000000000..b69b320fa --- /dev/null +++ b/addons-cluster/greptimedb/tests/pass/termination-policy-wipeout.yaml @@ -0,0 +1 @@ +terminationPolicy: WipeOut diff --git a/addons-cluster/greptimedb/values.schema.json b/addons-cluster/greptimedb/values.schema.json index 7c98472e7..4af95f9ad 100644 --- a/addons-cluster/greptimedb/values.schema.json +++ b/addons-cluster/greptimedb/values.schema.json @@ -43,6 +43,7 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -54,7 +55,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -65,7 +67,8 @@ ], "default": 10, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "datanode": { "title": "Datanode Configurations", @@ -94,14 +97,22 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "type": [ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } }, @@ -115,14 +126,22 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "type": [ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } } @@ -140,7 +159,16 @@ "number", "string" ], - "default": 10 + "default": 10, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" + }, + "storageClassName": { + "title": "Storage Class Name", + "description": "Storage class name of the data volume", + "type": "string", + "default": "" } } } @@ -175,7 +203,16 @@ "number", "string" ], - "default": 10 + "default": 10, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" + }, + "storageClassName": { + "title": "Storage Class Name", + "description": "Storage class name of the data volume", + "type": "string", + "default": "" } } } @@ -208,14 +245,22 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "type": [ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } }, @@ -229,14 +274,22 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "type": [ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } } @@ -271,14 +324,22 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "type": [ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } }, @@ -292,14 +353,22 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "type": [ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } } diff --git a/addons-cluster/greptimedb/values.yaml b/addons-cluster/greptimedb/values.yaml index c4bbb46c4..48aa7a7ee 100644 --- a/addons-cluster/greptimedb/values.yaml +++ b/addons-cluster/greptimedb/values.yaml @@ -25,6 +25,7 @@ datanode: # memory: 512Mi volume: + storageClassName: "" storage: 10 ## @param etcd configs @@ -33,6 +34,7 @@ etcd: replicas: 3 resources: {} volume: + storageClassName: "" storage: 10 ## @param meta configs diff --git a/addons-cluster/influxdb/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/influxdb/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/influxdb/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/influxdb/tests/fail/cpu-too-high.yaml b/addons-cluster/influxdb/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/influxdb/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/influxdb/tests/fail/cpu-too-low.yaml b/addons-cluster/influxdb/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/influxdb/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/influxdb/tests/fail/invalid-mode.yaml b/addons-cluster/influxdb/tests/fail/invalid-mode.yaml new file mode 100644 index 000000000..fc7b62207 --- /dev/null +++ b/addons-cluster/influxdb/tests/fail/invalid-mode.yaml @@ -0,0 +1 @@ +mode: invalid diff --git a/addons-cluster/influxdb/tests/fail/memory-too-high.yaml b/addons-cluster/influxdb/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/influxdb/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/influxdb/tests/fail/memory-too-low.yaml b/addons-cluster/influxdb/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/influxdb/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/influxdb/tests/fail/replicas-too-high.yaml b/addons-cluster/influxdb/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..eb5c26739 --- /dev/null +++ b/addons-cluster/influxdb/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 2 diff --git a/addons-cluster/influxdb/tests/fail/replicas-too-low.yaml b/addons-cluster/influxdb/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/influxdb/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/influxdb/tests/fail/storage-too-high.yaml b/addons-cluster/influxdb/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/influxdb/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/influxdb/tests/fail/storage-too-low.yaml b/addons-cluster/influxdb/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/influxdb/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/influxdb/tests/pass/defaults.yaml b/addons-cluster/influxdb/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/influxdb/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/influxdb/tests/pass/max-values.yaml b/addons-cluster/influxdb/tests/pass/max-values.yaml new file mode 100644 index 000000000..8f81346ed --- /dev/null +++ b/addons-cluster/influxdb/tests/pass/max-values.yaml @@ -0,0 +1,3 @@ +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/influxdb/tests/pass/min-values.yaml b/addons-cluster/influxdb/tests/pass/min-values.yaml new file mode 100644 index 000000000..901e3628b --- /dev/null +++ b/addons-cluster/influxdb/tests/pass/min-values.yaml @@ -0,0 +1,4 @@ +replicas: 1 +cpu: 0.5 +memory: 0.5 +storage: 1 diff --git a/addons-cluster/influxdb/values.schema.json b/addons-cluster/influxdb/values.schema.json index 51be153ed..177fbef15 100644 --- a/addons-cluster/influxdb/values.schema.json +++ b/addons-cluster/influxdb/values.schema.json @@ -35,6 +35,7 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -46,7 +47,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -57,8 +59,14 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" + }, + "storageClassName": { + "title": "Storage Class Name", + "description": "Storage class name of the data volume", + "type": "string", + "default": "" } - } } diff --git a/addons-cluster/influxdb/values.yaml b/addons-cluster/influxdb/values.yaml index ff7ff1f96..b52a6f81a 100644 --- a/addons-cluster/influxdb/values.yaml +++ b/addons-cluster/influxdb/values.yaml @@ -31,3 +31,5 @@ requests: ## @param storage size, the unit is Gi ## storage: 20 + +storageClassName: "" \ No newline at end of file diff --git a/addons-cluster/kafka/templates/cluster.yaml b/addons-cluster/kafka/templates/cluster.yaml index 207e2f029..069fe9d6c 100644 --- a/addons-cluster/kafka/templates/cluster.yaml +++ b/addons-cluster/kafka/templates/cluster.yaml @@ -43,7 +43,9 @@ spec: volumeClaimTemplates: - name: data spec: + {{- if .Values.storageClassName }} storageClassName: {{ .Values.storageClassName }} + {{- end }} accessModes: - ReadWriteOnce resources: @@ -51,7 +53,9 @@ spec: storage: {{ print .Values.storage "Gi" }} - name: metadata spec: + {{- if .Values.metaStorageClassName }} storageClassName: {{ .Values.metaStorageClassName }} + {{- end }} accessModes: - ReadWriteOnce resources: @@ -92,7 +96,9 @@ spec: volumeClaimTemplates: - name: data spec: + {{- if .Values.storageClassName }} storageClassName: {{ .Values.storageClassName }} + {{- end }} accessModes: - ReadWriteOnce resources: @@ -100,7 +106,9 @@ spec: storage: {{ print .Values.storage "Gi" }} - name: metadata spec: + {{- if .Values.metaStorageClassName }} storageClassName: {{ .Values.metaStorageClassName }} + {{- end }} accessModes: - ReadWriteOnce resources: @@ -119,7 +127,9 @@ spec: volumeClaimTemplates: - name: metadata spec: + {{- if .Values.metaStorageClassName }} storageClassName: {{ .Values.metaStorageClassName }} + {{- end }} accessModes: - ReadWriteOnce resources: diff --git a/addons-cluster/kafka/tests/fail/broker-replicas-too-high.yaml b/addons-cluster/kafka/tests/fail/broker-replicas-too-high.yaml new file mode 100644 index 000000000..d5ed160a1 --- /dev/null +++ b/addons-cluster/kafka/tests/fail/broker-replicas-too-high.yaml @@ -0,0 +1,2 @@ +mode: separated +brokerReplicas: 101 diff --git a/addons-cluster/kafka/tests/fail/broker-replicas-too-low.yaml b/addons-cluster/kafka/tests/fail/broker-replicas-too-low.yaml new file mode 100644 index 000000000..f35e04b6a --- /dev/null +++ b/addons-cluster/kafka/tests/fail/broker-replicas-too-low.yaml @@ -0,0 +1,2 @@ +mode: separated +brokerReplicas: 0 diff --git a/addons-cluster/kafka/tests/fail/controller-replicas-invalid.yaml b/addons-cluster/kafka/tests/fail/controller-replicas-invalid.yaml new file mode 100644 index 000000000..a46cee897 --- /dev/null +++ b/addons-cluster/kafka/tests/fail/controller-replicas-invalid.yaml @@ -0,0 +1,2 @@ +mode: separated +controllerReplicas: 2 diff --git a/addons-cluster/kafka/tests/fail/cpu-too-high.yaml b/addons-cluster/kafka/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/kafka/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/kafka/tests/fail/cpu-too-low.yaml b/addons-cluster/kafka/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..bf1d88a9a --- /dev/null +++ b/addons-cluster/kafka/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0 diff --git a/addons-cluster/kafka/tests/fail/invalid-mode.yaml b/addons-cluster/kafka/tests/fail/invalid-mode.yaml new file mode 100644 index 000000000..fc7b62207 --- /dev/null +++ b/addons-cluster/kafka/tests/fail/invalid-mode.yaml @@ -0,0 +1 @@ +mode: invalid diff --git a/addons-cluster/kafka/tests/fail/memory-too-high.yaml b/addons-cluster/kafka/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/kafka/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/kafka/tests/fail/memory-too-low.yaml b/addons-cluster/kafka/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..05f29037b --- /dev/null +++ b/addons-cluster/kafka/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0 diff --git a/addons-cluster/kafka/tests/fail/meta-storage-too-high.yaml b/addons-cluster/kafka/tests/fail/meta-storage-too-high.yaml new file mode 100644 index 000000000..b4cbc2b90 --- /dev/null +++ b/addons-cluster/kafka/tests/fail/meta-storage-too-high.yaml @@ -0,0 +1 @@ +metaStorage: 10001 diff --git a/addons-cluster/kafka/tests/fail/meta-storage-too-low.yaml b/addons-cluster/kafka/tests/fail/meta-storage-too-low.yaml new file mode 100644 index 000000000..73fe68d7d --- /dev/null +++ b/addons-cluster/kafka/tests/fail/meta-storage-too-low.yaml @@ -0,0 +1 @@ +metaStorage: 0 diff --git a/addons-cluster/kafka/tests/fail/replicas-invalid.yaml b/addons-cluster/kafka/tests/fail/replicas-invalid.yaml new file mode 100644 index 000000000..eb5c26739 --- /dev/null +++ b/addons-cluster/kafka/tests/fail/replicas-invalid.yaml @@ -0,0 +1 @@ +replicas: 2 diff --git a/addons-cluster/kafka/tests/fail/replicas-too-high.yaml b/addons-cluster/kafka/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/kafka/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/kafka/tests/fail/storage-too-high.yaml b/addons-cluster/kafka/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/kafka/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/kafka/tests/fail/storage-too-low.yaml b/addons-cluster/kafka/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/kafka/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/kafka/tests/pass/defaults.yaml b/addons-cluster/kafka/tests/pass/defaults.yaml new file mode 100644 index 000000000..1fc433791 --- /dev/null +++ b/addons-cluster/kafka/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (mode: combined, monitor: true, storage: true) diff --git a/addons-cluster/kafka/tests/pass/fixed-pod-ip.yaml b/addons-cluster/kafka/tests/pass/fixed-pod-ip.yaml new file mode 100644 index 000000000..eb4fbe6c4 --- /dev/null +++ b/addons-cluster/kafka/tests/pass/fixed-pod-ip.yaml @@ -0,0 +1 @@ +fixedPodIPEnabled: true diff --git a/addons-cluster/kafka/tests/pass/max-values.yaml b/addons-cluster/kafka/tests/pass/max-values.yaml new file mode 100644 index 000000000..681d8b31a --- /dev/null +++ b/addons-cluster/kafka/tests/pass/max-values.yaml @@ -0,0 +1,8 @@ +mode: separated +replicas: 5 +brokerReplicas: 100 +controllerReplicas: 5 +cpu: 64 +memory: 1000 +storage: 10000 +metaStorage: 10000 diff --git a/addons-cluster/kafka/tests/pass/min-values.yaml b/addons-cluster/kafka/tests/pass/min-values.yaml new file mode 100644 index 000000000..9bb83b18c --- /dev/null +++ b/addons-cluster/kafka/tests/pass/min-values.yaml @@ -0,0 +1,10 @@ +mode: separated +replicas: 1 +brokerReplicas: 1 +controllerReplicas: 1 +cpu: 0.5 +memory: 0.5 +storage: 1 +metaStorage: 1 +monitor: + replicas: 1 diff --git a/addons-cluster/kafka/tests/pass/no-monitor.yaml b/addons-cluster/kafka/tests/pass/no-monitor.yaml new file mode 100644 index 000000000..5a77d6395 --- /dev/null +++ b/addons-cluster/kafka/tests/pass/no-monitor.yaml @@ -0,0 +1 @@ +monitorEnable: false diff --git a/addons-cluster/kafka/tests/pass/no-storage.yaml b/addons-cluster/kafka/tests/pass/no-storage.yaml new file mode 100644 index 000000000..4cda68c5e --- /dev/null +++ b/addons-cluster/kafka/tests/pass/no-storage.yaml @@ -0,0 +1 @@ +storageEnable: false diff --git a/addons-cluster/kafka/tests/pass/nodeport.yaml b/addons-cluster/kafka/tests/pass/nodeport.yaml new file mode 100644 index 000000000..9ac3e0433 --- /dev/null +++ b/addons-cluster/kafka/tests/pass/nodeport.yaml @@ -0,0 +1 @@ +nodePortEnabled: true diff --git a/addons-cluster/kafka/tests/pass/replicas-3.yaml b/addons-cluster/kafka/tests/pass/replicas-3.yaml new file mode 100644 index 000000000..71ffd9f27 --- /dev/null +++ b/addons-cluster/kafka/tests/pass/replicas-3.yaml @@ -0,0 +1 @@ +replicas: 3 diff --git a/addons-cluster/kafka/tests/pass/replicas-5.yaml b/addons-cluster/kafka/tests/pass/replicas-5.yaml new file mode 100644 index 000000000..fd99c27e3 --- /dev/null +++ b/addons-cluster/kafka/tests/pass/replicas-5.yaml @@ -0,0 +1 @@ +replicas: 5 diff --git a/addons-cluster/kafka/tests/pass/separated-ha.yaml b/addons-cluster/kafka/tests/pass/separated-ha.yaml new file mode 100644 index 000000000..b8342fc35 --- /dev/null +++ b/addons-cluster/kafka/tests/pass/separated-ha.yaml @@ -0,0 +1,3 @@ +mode: separated +brokerReplicas: 3 +controllerReplicas: 3 diff --git a/addons-cluster/kafka/tests/pass/separated.yaml b/addons-cluster/kafka/tests/pass/separated.yaml new file mode 100644 index 000000000..adcf6b187 --- /dev/null +++ b/addons-cluster/kafka/tests/pass/separated.yaml @@ -0,0 +1 @@ +mode: separated diff --git a/addons-cluster/kafka/tests/pass/tls-sasl.yaml b/addons-cluster/kafka/tests/pass/tls-sasl.yaml new file mode 100644 index 000000000..f9010c88e --- /dev/null +++ b/addons-cluster/kafka/tests/pass/tls-sasl.yaml @@ -0,0 +1,2 @@ +tlsEnable: true +saslEnable: true diff --git a/addons-cluster/kafka/values.schema.json b/addons-cluster/kafka/values.schema.json index cb3def24d..9166346f8 100644 --- a/addons-cluster/kafka/values.schema.json +++ b/addons-cluster/kafka/values.schema.json @@ -45,13 +45,14 @@ ], "default": 10, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, - "storageClass": { - "title": "StorageClass", + "storageClassName": { + "title": "StorageClassName", "description": "The StorageClass for Kafka Data Storage.", - "type": "string", - "default": "" + "type": ["string", "null"], + "default": null }, "metaStorage": { "title": "MetaStorage(Gi)", @@ -62,13 +63,14 @@ ], "default": 5, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, - "metaStorageClass": { - "title": "MetaStorageClass", + "metaStorageClassName": { + "title": "MetaStorageClassName", "description": "The StorageClass for Kafka Metadata Storage.", - "type": "string", - "default": "" + "type": ["string", "null"], + "default": null }, "replicas": { "title": "Replicas", @@ -108,9 +110,9 @@ "string" ], "default": 0.5, - "minimum": 0.5, + "minimum": 0.1, "maximum": 64, - "multipleOf": 0.5 + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "memory": { "title": "Memory(Gi)", @@ -120,8 +122,9 @@ "string" ], "default": 0.5, - "minimum": 0.5, - "maximum": 1000 + "minimum": 0.1, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "monitor": { "title": "Monitor Configuration", @@ -131,7 +134,7 @@ "replicas": { "title": "Monitor Replicas", "description": "Number of replicas for the monitor component.", - "type": [ "number", "string" ], + "type": "integer", "default": 1, "minimum": 1 }, @@ -142,11 +145,17 @@ "properties": { "cpu": { "type": [ "number", "string" ], - "default": 0.1 + "default": 0.5, + "minimum": 0.1, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "memory": { "type": [ "number", "string" ], - "default": 0.2 + "default": 0.5, + "minimum": 0.1, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -157,11 +166,17 @@ "properties": { "cpu": { "type": [ "number", "string" ], - "default": 0.5 + "default": 0.5, + "minimum": 0.1, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "memory": { "type": [ "number", "string" ], - "default": 1 + "default": 0.5, + "minimum": 0.1, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } diff --git a/addons-cluster/llm/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/llm/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/llm/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/llm/tests/fail/cpu-too-high.yaml b/addons-cluster/llm/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/llm/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/llm/tests/fail/cpu-too-low.yaml b/addons-cluster/llm/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..b84650aa0 --- /dev/null +++ b/addons-cluster/llm/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: -1 diff --git a/addons-cluster/llm/tests/fail/gpu-not-multiple-of.yaml b/addons-cluster/llm/tests/fail/gpu-not-multiple-of.yaml new file mode 100644 index 000000000..beac6628b --- /dev/null +++ b/addons-cluster/llm/tests/fail/gpu-not-multiple-of.yaml @@ -0,0 +1 @@ +gpu: 1.5 diff --git a/addons-cluster/llm/tests/fail/gpu-too-high.yaml b/addons-cluster/llm/tests/fail/gpu-too-high.yaml new file mode 100644 index 000000000..48ab454ec --- /dev/null +++ b/addons-cluster/llm/tests/fail/gpu-too-high.yaml @@ -0,0 +1 @@ +gpu: 65 diff --git a/addons-cluster/llm/tests/fail/gpu-too-low.yaml b/addons-cluster/llm/tests/fail/gpu-too-low.yaml new file mode 100644 index 000000000..76cc5b010 --- /dev/null +++ b/addons-cluster/llm/tests/fail/gpu-too-low.yaml @@ -0,0 +1 @@ +gpu: -1 diff --git a/addons-cluster/llm/tests/fail/memory-too-high.yaml b/addons-cluster/llm/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/llm/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/llm/tests/fail/memory-too-low.yaml b/addons-cluster/llm/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..5b5b65120 --- /dev/null +++ b/addons-cluster/llm/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: -1 diff --git a/addons-cluster/llm/tests/fail/replicas-too-high.yaml b/addons-cluster/llm/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/llm/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/llm/tests/fail/replicas-too-low.yaml b/addons-cluster/llm/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/llm/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/llm/tests/pass/defaults.yaml b/addons-cluster/llm/tests/pass/defaults.yaml new file mode 100644 index 000000000..9a7b5fbee --- /dev/null +++ b/addons-cluster/llm/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (cpuMode: true) diff --git a/addons-cluster/llm/tests/pass/gpu-enabled.yaml b/addons-cluster/llm/tests/pass/gpu-enabled.yaml new file mode 100644 index 000000000..fcc5c1cc2 --- /dev/null +++ b/addons-cluster/llm/tests/pass/gpu-enabled.yaml @@ -0,0 +1,2 @@ +cpuMode: false +gpu: 1 diff --git a/addons-cluster/llm/tests/pass/max-values.yaml b/addons-cluster/llm/tests/pass/max-values.yaml new file mode 100644 index 000000000..c31987a9e --- /dev/null +++ b/addons-cluster/llm/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 5 +cpu: 64 +memory: 1000 +gpu: 64 diff --git a/addons-cluster/llm/tests/pass/min-values.yaml b/addons-cluster/llm/tests/pass/min-values.yaml new file mode 100644 index 000000000..f0456279c --- /dev/null +++ b/addons-cluster/llm/tests/pass/min-values.yaml @@ -0,0 +1,4 @@ +replicas: 1 +cpu: 0 +memory: 0 +gpu: 0 diff --git a/addons-cluster/llm/tests/pass/replicas-5.yaml b/addons-cluster/llm/tests/pass/replicas-5.yaml new file mode 100644 index 000000000..fd99c27e3 --- /dev/null +++ b/addons-cluster/llm/tests/pass/replicas-5.yaml @@ -0,0 +1 @@ +replicas: 5 diff --git a/addons-cluster/llm/values.schema.json b/addons-cluster/llm/values.schema.json index b7338bf01..ba5418c51 100644 --- a/addons-cluster/llm/values.schema.json +++ b/addons-cluster/llm/values.schema.json @@ -29,7 +29,11 @@ "number", "string" ], - "default": 1 + "default": 0, + "minimum": 0, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -38,7 +42,10 @@ "number", "string" ], - "default": 1 + "default": 0, + "minimum": 0, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "gpu": { "title": "GPU", @@ -47,7 +54,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 1 }, "model": { "title": "Model", diff --git a/addons-cluster/loki/tests/fail/backend-replicas-too-low.yaml b/addons-cluster/loki/tests/fail/backend-replicas-too-low.yaml new file mode 100644 index 000000000..8fdfee30e --- /dev/null +++ b/addons-cluster/loki/tests/fail/backend-replicas-too-low.yaml @@ -0,0 +1,2 @@ +backend: + replicas: 0 diff --git a/addons-cluster/loki/tests/fail/gateway-replicas-too-low.yaml b/addons-cluster/loki/tests/fail/gateway-replicas-too-low.yaml new file mode 100644 index 000000000..8416c6984 --- /dev/null +++ b/addons-cluster/loki/tests/fail/gateway-replicas-too-low.yaml @@ -0,0 +1,2 @@ +gateway: + replicas: 0 diff --git a/addons-cluster/loki/tests/fail/invalid-replicas.yaml b/addons-cluster/loki/tests/fail/invalid-replicas.yaml new file mode 100644 index 000000000..2242e0590 --- /dev/null +++ b/addons-cluster/loki/tests/fail/invalid-replicas.yaml @@ -0,0 +1,2 @@ +read: + replicas: "invalid" diff --git a/addons-cluster/loki/tests/fail/invalid-storage.yaml b/addons-cluster/loki/tests/fail/invalid-storage.yaml new file mode 100644 index 000000000..1204b09d3 --- /dev/null +++ b/addons-cluster/loki/tests/fail/invalid-storage.yaml @@ -0,0 +1,2 @@ +backend: + storage: "invalid" diff --git a/addons-cluster/loki/tests/fail/read-replicas-too-low.yaml b/addons-cluster/loki/tests/fail/read-replicas-too-low.yaml new file mode 100644 index 000000000..f1dbc0a69 --- /dev/null +++ b/addons-cluster/loki/tests/fail/read-replicas-too-low.yaml @@ -0,0 +1,2 @@ +read: + replicas: 0 diff --git a/addons-cluster/loki/tests/fail/write-replicas-too-low.yaml b/addons-cluster/loki/tests/fail/write-replicas-too-low.yaml new file mode 100644 index 000000000..f65c0773a --- /dev/null +++ b/addons-cluster/loki/tests/fail/write-replicas-too-low.yaml @@ -0,0 +1,2 @@ +write: + replicas: 0 diff --git a/addons-cluster/loki/tests/pass/defaults.yaml b/addons-cluster/loki/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/loki/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/loki/tests/pass/gateway-auth-enabled.yaml b/addons-cluster/loki/tests/pass/gateway-auth-enabled.yaml new file mode 100644 index 000000000..84dfb3673 --- /dev/null +++ b/addons-cluster/loki/tests/pass/gateway-auth-enabled.yaml @@ -0,0 +1,3 @@ +gateway: + basicAuth: + enabled: true diff --git a/addons-cluster/loki/tests/pass/ha.yaml b/addons-cluster/loki/tests/pass/ha.yaml new file mode 100644 index 000000000..b0932c274 --- /dev/null +++ b/addons-cluster/loki/tests/pass/ha.yaml @@ -0,0 +1,8 @@ +read: + replicas: 2 +write: + replicas: 2 +backend: + replicas: 2 +gateway: + replicas: 2 diff --git a/addons-cluster/loki/tests/pass/max-values.yaml b/addons-cluster/loki/tests/pass/max-values.yaml new file mode 100644 index 000000000..5c4c3c5d6 --- /dev/null +++ b/addons-cluster/loki/tests/pass/max-values.yaml @@ -0,0 +1,2 @@ +backend: + storage: 10000 diff --git a/addons-cluster/loki/tests/pass/minio-enabled.yaml b/addons-cluster/loki/tests/pass/minio-enabled.yaml new file mode 100644 index 000000000..edd69f213 --- /dev/null +++ b/addons-cluster/loki/tests/pass/minio-enabled.yaml @@ -0,0 +1,2 @@ +minio: + enabled: true diff --git a/addons-cluster/loki/values.schema.json b/addons-cluster/loki/values.schema.json index 09211e793..b4f62f060 100644 --- a/addons-cluster/loki/values.schema.json +++ b/addons-cluster/loki/values.schema.json @@ -24,7 +24,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory limit(Gi)", @@ -33,7 +37,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } }, @@ -49,7 +57,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory request(Gi)", @@ -58,15 +70,22 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } } } }, "replicas": { + "title": "Replicas", + "description": "The number of replicas.", "type": "integer", - "default": 1 + "default": 1, + "minimum": 1 } } }, @@ -90,7 +109,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory limit(Gi)", @@ -99,7 +122,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } }, @@ -115,7 +142,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory request(Gi)", @@ -124,15 +155,22 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } } } }, "replicas": { + "title": "Replicas", + "description": "The number of replicas.", "type": "integer", - "default": 1 + "default": 1, + "minimum": 1 } } }, @@ -156,7 +194,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory limit(Gi)", @@ -165,7 +207,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } }, @@ -181,7 +227,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory request(Gi)", @@ -190,26 +240,40 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } } } }, "replicas": { + "title": "Replicas", + "description": "The number of replicas.", "type": "integer", - "default": 1 + "default": 1, + "minimum": 1 }, "storageClassName": { - "type": "string", - "default": "" + "title": "Storage Class Name", + "description": "Storage class name of the data volume", + "type": ["string", "null"], + "default": null }, "storage": { + "title": "Storage(Gi)", + "description": "Storage size, the unit is Gi.", "type": [ "number", "string" ], - "default": 20 + "default": 20, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -233,7 +297,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory limit(Gi)", @@ -242,7 +310,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } }, @@ -258,7 +330,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory request(Gi)", @@ -267,7 +343,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } } @@ -277,7 +357,8 @@ "title": "Replicas", "description": "The number of replicas.", "type": "integer", - "default": 1 + "default": 1, + "minimum": 1 }, "basicAuth": { "title": "Basic Auth", diff --git a/addons-cluster/mariadb/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/mariadb/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/mariadb/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/mariadb/tests/fail/cpu-too-high.yaml b/addons-cluster/mariadb/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/mariadb/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/mariadb/tests/fail/cpu-too-low.yaml b/addons-cluster/mariadb/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/mariadb/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/mariadb/tests/fail/invalid-mode.yaml b/addons-cluster/mariadb/tests/fail/invalid-mode.yaml new file mode 100644 index 000000000..fc7b62207 --- /dev/null +++ b/addons-cluster/mariadb/tests/fail/invalid-mode.yaml @@ -0,0 +1 @@ +mode: invalid diff --git a/addons-cluster/mariadb/tests/fail/memory-too-high.yaml b/addons-cluster/mariadb/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/mariadb/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/mariadb/tests/fail/memory-too-low.yaml b/addons-cluster/mariadb/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/mariadb/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/mariadb/tests/fail/replicas-too-high.yaml b/addons-cluster/mariadb/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..eb5c26739 --- /dev/null +++ b/addons-cluster/mariadb/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 2 diff --git a/addons-cluster/mariadb/tests/fail/replicas-too-low.yaml b/addons-cluster/mariadb/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/mariadb/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/mariadb/tests/fail/storage-too-high.yaml b/addons-cluster/mariadb/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/mariadb/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/mariadb/tests/fail/storage-too-low.yaml b/addons-cluster/mariadb/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/mariadb/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/mariadb/tests/pass/defaults.yaml b/addons-cluster/mariadb/tests/pass/defaults.yaml new file mode 100644 index 000000000..0d2113f86 --- /dev/null +++ b/addons-cluster/mariadb/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (mode: standalone) diff --git a/addons-cluster/mariadb/tests/pass/max-values.yaml b/addons-cluster/mariadb/tests/pass/max-values.yaml new file mode 100644 index 000000000..8f81346ed --- /dev/null +++ b/addons-cluster/mariadb/tests/pass/max-values.yaml @@ -0,0 +1,3 @@ +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/mariadb/values.schema.json b/addons-cluster/mariadb/values.schema.json index 314c1bd61..a8209d2ce 100644 --- a/addons-cluster/mariadb/values.schema.json +++ b/addons-cluster/mariadb/values.schema.json @@ -29,6 +29,7 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -40,7 +41,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -51,8 +53,14 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" + }, + "storageClassName": { + "title": "Storage Class Name", + "description": "Storage class name of the data volume", + "type": "string", + "default": "" } - } } diff --git a/addons-cluster/mariadb/values.yaml b/addons-cluster/mariadb/values.yaml index 3cc10c68c..2fc2e008e 100644 --- a/addons-cluster/mariadb/values.yaml +++ b/addons-cluster/mariadb/values.yaml @@ -29,3 +29,5 @@ requests: ## @param storage size, the unit is Gi ## storage: 20 + +storageclassName: "" \ No newline at end of file diff --git a/addons-cluster/milvus/tests/fail/cpu-invalid.yaml b/addons-cluster/milvus/tests/fail/cpu-invalid.yaml new file mode 100644 index 000000000..2fdefcc16 --- /dev/null +++ b/addons-cluster/milvus/tests/fail/cpu-invalid.yaml @@ -0,0 +1 @@ +cpu: "invalid" diff --git a/addons-cluster/milvus/tests/fail/invalid-mode.yaml b/addons-cluster/milvus/tests/fail/invalid-mode.yaml new file mode 100644 index 000000000..fc7b62207 --- /dev/null +++ b/addons-cluster/milvus/tests/fail/invalid-mode.yaml @@ -0,0 +1 @@ +mode: invalid diff --git a/addons-cluster/milvus/tests/fail/memory-invalid.yaml b/addons-cluster/milvus/tests/fail/memory-invalid.yaml new file mode 100644 index 000000000..3428c7e9f --- /dev/null +++ b/addons-cluster/milvus/tests/fail/memory-invalid.yaml @@ -0,0 +1 @@ +memory: "invalid" diff --git a/addons-cluster/milvus/tests/fail/replicas-too-low.yaml b/addons-cluster/milvus/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/milvus/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/milvus/tests/fail/storage-invalid.yaml b/addons-cluster/milvus/tests/fail/storage-invalid.yaml new file mode 100644 index 000000000..c15ce2d19 --- /dev/null +++ b/addons-cluster/milvus/tests/fail/storage-invalid.yaml @@ -0,0 +1,3 @@ +persistence: + data: + size: "invalid" diff --git a/addons-cluster/milvus/tests/pass/cluster-ha.yaml b/addons-cluster/milvus/tests/pass/cluster-ha.yaml new file mode 100644 index 000000000..84bdf204c --- /dev/null +++ b/addons-cluster/milvus/tests/pass/cluster-ha.yaml @@ -0,0 +1,11 @@ +mode: cluster +proxy: + replicas: 2 +mixcoord: + replicas: 2 +datanode: + replicas: 2 +indexnode: + replicas: 2 +querynode: + replicas: 2 diff --git a/addons-cluster/milvus/tests/pass/cluster.yaml b/addons-cluster/milvus/tests/pass/cluster.yaml new file mode 100644 index 000000000..0f259a0d4 --- /dev/null +++ b/addons-cluster/milvus/tests/pass/cluster.yaml @@ -0,0 +1 @@ +mode: cluster diff --git a/addons-cluster/milvus/tests/pass/defaults.yaml b/addons-cluster/milvus/tests/pass/defaults.yaml new file mode 100644 index 000000000..0d2113f86 --- /dev/null +++ b/addons-cluster/milvus/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (mode: standalone) diff --git a/addons-cluster/milvus/tests/pass/no-persistence.yaml b/addons-cluster/milvus/tests/pass/no-persistence.yaml new file mode 100644 index 000000000..4d6af8b22 --- /dev/null +++ b/addons-cluster/milvus/tests/pass/no-persistence.yaml @@ -0,0 +1,2 @@ +persistence: + enabled: false diff --git a/addons-cluster/milvus/values.schema.json b/addons-cluster/milvus/values.schema.json index 546629674..74e879016 100644 --- a/addons-cluster/milvus/values.schema.json +++ b/addons-cluster/milvus/values.schema.json @@ -18,7 +18,8 @@ "title": "Replicas", "description": "Number of replicas for standalone mode", "type": "integer", - "default": 1 + "default": 1, + "minimum": 1 }, "cpu": { "title": "CPU", @@ -30,6 +31,7 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -41,7 +43,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "persistence": { "type": "object", @@ -70,7 +73,10 @@ "number", "string" ], - "default": 10 + "default": 10, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -89,7 +95,8 @@ "title": "Replicas", "description": "Number of replicas for proxy in cluster mode", "type": "integer", - "default": 1 + "default": 1, + "minimum": 1 } } }, @@ -115,7 +122,8 @@ "title": "Replicas", "description": "Number of replicas for datanode in cluster mode", "type": "integer", - "default": 1 + "default": 1, + "minimum": 1 } } }, @@ -128,7 +136,8 @@ "title": "Replicas", "description": "Number of replicas for indexnode in cluster mode", "type": "integer", - "default": 1 + "default": 1, + "minimum": 1 } } }, @@ -141,7 +150,8 @@ "title": "Replicas", "description": "Number of replicas for querynode in cluster mode", "type": "integer", - "default": 1 + "default": 1, + "minimum": 1 } } } diff --git a/addons-cluster/minio/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/minio/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/minio/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/minio/tests/fail/cpu-too-high.yaml b/addons-cluster/minio/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/minio/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/minio/tests/fail/cpu-too-low.yaml b/addons-cluster/minio/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/minio/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/minio/tests/fail/memory-too-high.yaml b/addons-cluster/minio/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/minio/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/minio/tests/fail/memory-too-low.yaml b/addons-cluster/minio/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/minio/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/minio/tests/fail/replicas-too-high.yaml b/addons-cluster/minio/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..6f4d28b6a --- /dev/null +++ b/addons-cluster/minio/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 33 diff --git a/addons-cluster/minio/tests/fail/replicas-too-low.yaml b/addons-cluster/minio/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..3b3a9950e --- /dev/null +++ b/addons-cluster/minio/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 1 diff --git a/addons-cluster/minio/tests/fail/storage-too-high.yaml b/addons-cluster/minio/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/minio/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/minio/tests/fail/storage-too-low.yaml b/addons-cluster/minio/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/minio/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/minio/tests/pass/defaults.yaml b/addons-cluster/minio/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/minio/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/minio/tests/pass/max-values.yaml b/addons-cluster/minio/tests/pass/max-values.yaml new file mode 100644 index 000000000..b743a0f1c --- /dev/null +++ b/addons-cluster/minio/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 32 +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/minio/tests/pass/replicas-4.yaml b/addons-cluster/minio/tests/pass/replicas-4.yaml new file mode 100644 index 000000000..59d592750 --- /dev/null +++ b/addons-cluster/minio/tests/pass/replicas-4.yaml @@ -0,0 +1 @@ +replicas: 4 diff --git a/addons-cluster/minio/tests/pass/with-buckets.yaml b/addons-cluster/minio/tests/pass/with-buckets.yaml new file mode 100644 index 000000000..3b79b6235 --- /dev/null +++ b/addons-cluster/minio/tests/pass/with-buckets.yaml @@ -0,0 +1 @@ +buckets: "bucket-1,bucket-2" diff --git a/addons-cluster/minio/values.schema.json b/addons-cluster/minio/values.schema.json index b2f8b19fb..4518fc1c2 100644 --- a/addons-cluster/minio/values.schema.json +++ b/addons-cluster/minio/values.schema.json @@ -20,6 +20,7 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -31,7 +32,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -42,7 +44,8 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", diff --git a/addons-cluster/mogdb/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/mogdb/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..e54bcfa3a --- /dev/null +++ b/addons-cluster/mogdb/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 1.1 diff --git a/addons-cluster/mogdb/tests/fail/cpu-too-high.yaml b/addons-cluster/mogdb/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/mogdb/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/mogdb/tests/fail/cpu-too-low.yaml b/addons-cluster/mogdb/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..cc54cebbf --- /dev/null +++ b/addons-cluster/mogdb/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.5 diff --git a/addons-cluster/mogdb/tests/fail/invalid-mode.yaml b/addons-cluster/mogdb/tests/fail/invalid-mode.yaml new file mode 100644 index 000000000..fc7b62207 --- /dev/null +++ b/addons-cluster/mogdb/tests/fail/invalid-mode.yaml @@ -0,0 +1 @@ +mode: invalid diff --git a/addons-cluster/mogdb/tests/fail/memory-too-high.yaml b/addons-cluster/mogdb/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/mogdb/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/mogdb/tests/fail/memory-too-low.yaml b/addons-cluster/mogdb/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..456d3865c --- /dev/null +++ b/addons-cluster/mogdb/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.5 diff --git a/addons-cluster/mogdb/tests/fail/replicas-too-high.yaml b/addons-cluster/mogdb/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/mogdb/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/mogdb/tests/fail/replicas-too-low.yaml b/addons-cluster/mogdb/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/mogdb/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/mogdb/tests/fail/storage-too-high.yaml b/addons-cluster/mogdb/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/mogdb/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/mogdb/tests/fail/storage-too-low.yaml b/addons-cluster/mogdb/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/mogdb/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/mogdb/tests/pass/defaults.yaml b/addons-cluster/mogdb/tests/pass/defaults.yaml new file mode 100644 index 000000000..a796c6c37 --- /dev/null +++ b/addons-cluster/mogdb/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (mode: replication) diff --git a/addons-cluster/mogdb/tests/pass/max-values.yaml b/addons-cluster/mogdb/tests/pass/max-values.yaml new file mode 100644 index 000000000..83f00ed3c --- /dev/null +++ b/addons-cluster/mogdb/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 5 +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/mogdb/tests/pass/standalone.yaml b/addons-cluster/mogdb/tests/pass/standalone.yaml new file mode 100644 index 000000000..c3dab2b97 --- /dev/null +++ b/addons-cluster/mogdb/tests/pass/standalone.yaml @@ -0,0 +1,2 @@ +mode: standalone +replicas: 1 diff --git a/addons-cluster/mogdb/values.schema.json b/addons-cluster/mogdb/values.schema.json index ab8084a4f..7a4b11060 100644 --- a/addons-cluster/mogdb/values.schema.json +++ b/addons-cluster/mogdb/values.schema.json @@ -30,6 +30,7 @@ "default": 1, "minimum": 1, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -41,7 +42,8 @@ ], "default": 1, "minimum": 1, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -52,7 +54,8 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", diff --git a/addons-cluster/mogdb/values.yaml b/addons-cluster/mogdb/values.yaml index b8d11ec3d..79fe2d062 100644 --- a/addons-cluster/mogdb/values.yaml +++ b/addons-cluster/mogdb/values.yaml @@ -33,5 +33,8 @@ requests: ## storage: 20 +storageclassName: "" + extra: + terminationPolicy: Delete disableExporter: false \ No newline at end of file diff --git a/addons-cluster/mongodb/templates/cluster.yaml b/addons-cluster/mongodb/templates/cluster.yaml index 194c5aa3b..efa9c9c75 100644 --- a/addons-cluster/mongodb/templates/cluster.yaml +++ b/addons-cluster/mongodb/templates/cluster.yaml @@ -16,6 +16,6 @@ spec: - name: mongodb serviceVersion: {{ .Values.version }} {{- include "mongodb-cluster.replicaCount" . | indent 6 }} - disableExporter: {{ $.Values.disableExporter | default "false" }} + disableExporter: {{ $.Values.extra.disableExporter | default "false" }} {{- include "kblib.componentResources" . | indent 6 }} {{- include "kblib.componentStorages" . | indent 6 }} diff --git a/addons-cluster/mongodb/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/mongodb/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/mongodb/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/mongodb/tests/fail/cpu-too-high.yaml b/addons-cluster/mongodb/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/mongodb/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/mongodb/tests/fail/cpu-too-low.yaml b/addons-cluster/mongodb/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/mongodb/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/mongodb/tests/fail/invalid-hostnetwork.yaml b/addons-cluster/mongodb/tests/fail/invalid-hostnetwork.yaml new file mode 100644 index 000000000..d263ba067 --- /dev/null +++ b/addons-cluster/mongodb/tests/fail/invalid-hostnetwork.yaml @@ -0,0 +1 @@ +hostnetwork: invalid diff --git a/addons-cluster/mongodb/tests/fail/invalid-mode.yaml b/addons-cluster/mongodb/tests/fail/invalid-mode.yaml new file mode 100644 index 000000000..fc7b62207 --- /dev/null +++ b/addons-cluster/mongodb/tests/fail/invalid-mode.yaml @@ -0,0 +1 @@ +mode: invalid diff --git a/addons-cluster/mongodb/tests/fail/memory-too-high.yaml b/addons-cluster/mongodb/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/mongodb/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/mongodb/tests/fail/memory-too-low.yaml b/addons-cluster/mongodb/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/mongodb/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/mongodb/tests/fail/replicas-too-high.yaml b/addons-cluster/mongodb/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/mongodb/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/mongodb/tests/fail/replicas-too-low.yaml b/addons-cluster/mongodb/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/mongodb/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/mongodb/tests/fail/storage-too-high.yaml b/addons-cluster/mongodb/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/mongodb/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/mongodb/tests/fail/storage-too-low.yaml b/addons-cluster/mongodb/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/mongodb/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/mongodb/tests/pass/defaults.yaml b/addons-cluster/mongodb/tests/pass/defaults.yaml new file mode 100644 index 000000000..0d2113f86 --- /dev/null +++ b/addons-cluster/mongodb/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (mode: standalone) diff --git a/addons-cluster/mongodb/tests/pass/hostnetwork-enabled.yaml b/addons-cluster/mongodb/tests/pass/hostnetwork-enabled.yaml new file mode 100644 index 000000000..90ca5fcba --- /dev/null +++ b/addons-cluster/mongodb/tests/pass/hostnetwork-enabled.yaml @@ -0,0 +1 @@ +hostnetwork: "enabled" diff --git a/addons-cluster/mongodb/tests/pass/max-values.yaml b/addons-cluster/mongodb/tests/pass/max-values.yaml new file mode 100644 index 000000000..83f00ed3c --- /dev/null +++ b/addons-cluster/mongodb/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 5 +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/mongodb/tests/pass/replicaset.yaml b/addons-cluster/mongodb/tests/pass/replicaset.yaml new file mode 100644 index 000000000..0a3c4a3cc --- /dev/null +++ b/addons-cluster/mongodb/tests/pass/replicaset.yaml @@ -0,0 +1,2 @@ +mode: replicaset +replicas: 3 diff --git a/addons-cluster/mongodb/values.schema.json b/addons-cluster/mongodb/values.schema.json index 8aa946fb5..193ee2bde 100644 --- a/addons-cluster/mongodb/values.schema.json +++ b/addons-cluster/mongodb/values.schema.json @@ -52,6 +52,7 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -63,7 +64,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -74,7 +76,8 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", diff --git a/addons-cluster/mongodb/values.yaml b/addons-cluster/mongodb/values.yaml index 352ebde61..a86ee3ab8 100644 --- a/addons-cluster/mongodb/values.yaml +++ b/addons-cluster/mongodb/values.yaml @@ -28,10 +28,10 @@ requests: ## @param storage size, the unit is Gi ## storage: 20 +storageClassName: "" hostnetwork: "disabled" extra: terminationPolicy: Delete - -disableExporter: false + disableExporter: false diff --git a/addons-cluster/mysql/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/mysql/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/mysql/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/mysql/tests/fail/cpu-too-high.yaml b/addons-cluster/mysql/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/mysql/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/mysql/tests/fail/cpu-too-low.yaml b/addons-cluster/mysql/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/mysql/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/mysql/tests/fail/invalid-topology.yaml b/addons-cluster/mysql/tests/fail/invalid-topology.yaml new file mode 100644 index 000000000..4fae5f078 --- /dev/null +++ b/addons-cluster/mysql/tests/fail/invalid-topology.yaml @@ -0,0 +1 @@ +topology: invalid diff --git a/addons-cluster/mysql/tests/fail/memory-too-high.yaml b/addons-cluster/mysql/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/mysql/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/mysql/tests/fail/memory-too-low.yaml b/addons-cluster/mysql/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/mysql/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/mysql/tests/fail/replicas-too-high.yaml b/addons-cluster/mysql/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/mysql/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/mysql/tests/fail/replicas-too-low.yaml b/addons-cluster/mysql/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/mysql/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/mysql/tests/fail/storage-too-high.yaml b/addons-cluster/mysql/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/mysql/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/mysql/tests/fail/storage-too-low.yaml b/addons-cluster/mysql/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/mysql/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/mysql/tests/pass/defaults.yaml b/addons-cluster/mysql/tests/pass/defaults.yaml new file mode 100644 index 000000000..5ce02bbb6 --- /dev/null +++ b/addons-cluster/mysql/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (topology: semisync) diff --git a/addons-cluster/mysql/tests/pass/max-values.yaml b/addons-cluster/mysql/tests/pass/max-values.yaml new file mode 100644 index 000000000..83f00ed3c --- /dev/null +++ b/addons-cluster/mysql/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 5 +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/mysql/tests/pass/mgr-proxysql.yaml b/addons-cluster/mysql/tests/pass/mgr-proxysql.yaml new file mode 100644 index 000000000..70235853c --- /dev/null +++ b/addons-cluster/mysql/tests/pass/mgr-proxysql.yaml @@ -0,0 +1,2 @@ +topology: mgr-proxysql +replicas: 3 diff --git a/addons-cluster/mysql/tests/pass/mgr.yaml b/addons-cluster/mysql/tests/pass/mgr.yaml new file mode 100644 index 000000000..058cfc806 --- /dev/null +++ b/addons-cluster/mysql/tests/pass/mgr.yaml @@ -0,0 +1,2 @@ +topology: mgr +replicas: 3 diff --git a/addons-cluster/mysql/tests/pass/orc-proxysql.yaml b/addons-cluster/mysql/tests/pass/orc-proxysql.yaml new file mode 100644 index 000000000..eb11b4310 --- /dev/null +++ b/addons-cluster/mysql/tests/pass/orc-proxysql.yaml @@ -0,0 +1,4 @@ +topology: orc-proxysql +orchestrator: + serviceReference: + endpoint: "myorc-orchestrator:80" diff --git a/addons-cluster/mysql/tests/pass/orc.yaml b/addons-cluster/mysql/tests/pass/orc.yaml new file mode 100644 index 000000000..c1a322257 --- /dev/null +++ b/addons-cluster/mysql/tests/pass/orc.yaml @@ -0,0 +1,4 @@ +topology: orc +orchestrator: + serviceReference: + endpoint: "myorc-orchestrator:80" diff --git a/addons-cluster/mysql/tests/pass/semisync-proxysql.yaml b/addons-cluster/mysql/tests/pass/semisync-proxysql.yaml new file mode 100644 index 000000000..2b6ab24fa --- /dev/null +++ b/addons-cluster/mysql/tests/pass/semisync-proxysql.yaml @@ -0,0 +1 @@ +topology: semisync-proxysql diff --git a/addons-cluster/mysql/values.schema.json b/addons-cluster/mysql/values.schema.json index 0974f843f..a549756f7 100644 --- a/addons-cluster/mysql/values.schema.json +++ b/addons-cluster/mysql/values.schema.json @@ -36,6 +36,7 @@ "default": 1, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -47,7 +48,8 @@ ], "default": 1, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -58,7 +60,14 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" + }, + "storageClassName": { + "title": "Storage Class Name", + "description": "Storage class name of the data volume", + "type": "string", + "default": "" }, "topology": { "type": "string", diff --git a/addons-cluster/mysql/values.yaml b/addons-cluster/mysql/values.yaml index dd5cb089f..58879851c 100644 --- a/addons-cluster/mysql/values.yaml +++ b/addons-cluster/mysql/values.yaml @@ -28,6 +28,10 @@ requests: ## @param storage size, the unit is Gi ## storage: 20 + +## @param storageClassName +storageClassName: "" + topology: semisync proxysql: replicas: 1 diff --git a/addons-cluster/nebula/tests/fail/invalid-replicas.yaml b/addons-cluster/nebula/tests/fail/invalid-replicas.yaml new file mode 100644 index 000000000..badd9f5fb --- /dev/null +++ b/addons-cluster/nebula/tests/fail/invalid-replicas.yaml @@ -0,0 +1,3 @@ +nebula: + console: + replicas: "invalid" diff --git a/addons-cluster/nebula/tests/fail/invalid-service-type.yaml b/addons-cluster/nebula/tests/fail/invalid-service-type.yaml new file mode 100644 index 000000000..260f5d6c2 --- /dev/null +++ b/addons-cluster/nebula/tests/fail/invalid-service-type.yaml @@ -0,0 +1,3 @@ +nebula: + graphd: + serviceType: Invalid diff --git a/addons-cluster/nebula/tests/fail/invalid-storage.yaml b/addons-cluster/nebula/tests/fail/invalid-storage.yaml new file mode 100644 index 000000000..6212cbc86 --- /dev/null +++ b/addons-cluster/nebula/tests/fail/invalid-storage.yaml @@ -0,0 +1,3 @@ +nebula: + graphd: + logStorage: "invalid" diff --git a/addons-cluster/nebula/tests/pass/defaults.yaml b/addons-cluster/nebula/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/nebula/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/nebula/tests/pass/graphd-clusterip.yaml b/addons-cluster/nebula/tests/pass/graphd-clusterip.yaml new file mode 100644 index 000000000..e6a02dce5 --- /dev/null +++ b/addons-cluster/nebula/tests/pass/graphd-clusterip.yaml @@ -0,0 +1,3 @@ +nebula: + graphd: + serviceType: ClusterIP diff --git a/addons-cluster/nebula/tests/pass/graphd-loadbalancer.yaml b/addons-cluster/nebula/tests/pass/graphd-loadbalancer.yaml new file mode 100644 index 000000000..766676c0e --- /dev/null +++ b/addons-cluster/nebula/tests/pass/graphd-loadbalancer.yaml @@ -0,0 +1,3 @@ +nebula: + graphd: + serviceType: LoadBalancer diff --git a/addons-cluster/nebula/tests/pass/ha.yaml b/addons-cluster/nebula/tests/pass/ha.yaml new file mode 100644 index 000000000..88604e2cb --- /dev/null +++ b/addons-cluster/nebula/tests/pass/ha.yaml @@ -0,0 +1,9 @@ +nebula: + console: + replicas: 2 + graphd: + replicas: 2 + metad: + replicas: 5 + storaged: + replicas: 5 diff --git a/addons-cluster/nebula/values.schema.json b/addons-cluster/nebula/values.schema.json index c10b4625a..78b4b32ea 100644 --- a/addons-cluster/nebula/values.schema.json +++ b/addons-cluster/nebula/values.schema.json @@ -15,7 +15,8 @@ "storageClassName": { "type": ["string", "null"], "default": null, - "description": "Storage class name" + "description": "Storage class name", + "title": "Storage Class Name" }, "console": { "type": "object", @@ -38,7 +39,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -47,7 +52,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -61,7 +69,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -70,7 +82,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -109,7 +124,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -118,7 +137,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -132,7 +154,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -141,19 +167,26 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } } }, "logStorage": { + "title": "Log Storage(Gi)", + "description": "Log storage size, the unit is Gi.", "type": [ "number", "string" ], "default": 1, - "description": "Log storage size" + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -178,7 +211,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -187,7 +224,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -201,7 +241,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -210,7 +254,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -223,7 +270,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "dataStorage": { "title": "Data Storage(Gi)", @@ -232,7 +282,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -257,7 +310,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -266,7 +323,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -280,7 +340,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -289,7 +353,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -302,7 +369,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "dataStorage": { "title": "Data Storage(Gi)", @@ -311,7 +381,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } diff --git a/addons-cluster/neo4j/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/neo4j/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..9a59c7f23 --- /dev/null +++ b/addons-cluster/neo4j/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 2.05 diff --git a/addons-cluster/neo4j/tests/fail/cpu-too-high.yaml b/addons-cluster/neo4j/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/neo4j/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/neo4j/tests/fail/cpu-too-low.yaml b/addons-cluster/neo4j/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..2159e71fe --- /dev/null +++ b/addons-cluster/neo4j/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 1.9 diff --git a/addons-cluster/neo4j/tests/fail/invalid-mode.yaml b/addons-cluster/neo4j/tests/fail/invalid-mode.yaml new file mode 100644 index 000000000..fc7b62207 --- /dev/null +++ b/addons-cluster/neo4j/tests/fail/invalid-mode.yaml @@ -0,0 +1 @@ +mode: invalid diff --git a/addons-cluster/neo4j/tests/fail/memory-too-high.yaml b/addons-cluster/neo4j/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/neo4j/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/neo4j/tests/fail/memory-too-low.yaml b/addons-cluster/neo4j/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..f671292a7 --- /dev/null +++ b/addons-cluster/neo4j/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 1 diff --git a/addons-cluster/neo4j/tests/fail/replicas-too-high.yaml b/addons-cluster/neo4j/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/neo4j/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/neo4j/tests/fail/replicas-too-low.yaml b/addons-cluster/neo4j/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/neo4j/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/neo4j/tests/fail/storage-too-high.yaml b/addons-cluster/neo4j/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/neo4j/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/neo4j/tests/fail/storage-too-low.yaml b/addons-cluster/neo4j/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/neo4j/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/neo4j/tests/pass/clustermode.yaml b/addons-cluster/neo4j/tests/pass/clustermode.yaml new file mode 100644 index 000000000..104b4dfeb --- /dev/null +++ b/addons-cluster/neo4j/tests/pass/clustermode.yaml @@ -0,0 +1,2 @@ +mode: clustermode +replicas: 3 diff --git a/addons-cluster/neo4j/tests/pass/defaults.yaml b/addons-cluster/neo4j/tests/pass/defaults.yaml new file mode 100644 index 000000000..1f8016160 --- /dev/null +++ b/addons-cluster/neo4j/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (mode: singlealone) diff --git a/addons-cluster/neo4j/tests/pass/max-values.yaml b/addons-cluster/neo4j/tests/pass/max-values.yaml new file mode 100644 index 000000000..83f00ed3c --- /dev/null +++ b/addons-cluster/neo4j/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 5 +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/neo4j/values.schema.json b/addons-cluster/neo4j/values.schema.json index e37ddee87..0c636713f 100644 --- a/addons-cluster/neo4j/values.schema.json +++ b/addons-cluster/neo4j/values.schema.json @@ -18,7 +18,8 @@ "type": "string", "default": "singlealone", "enum": [ - "singlealone" + "singlealone", + "clustermode" ] }, "replicas": { @@ -39,6 +40,7 @@ "default": 2, "minimum": 2, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.1 }, "memory": { @@ -50,7 +52,8 @@ ], "default": 2, "minimum": 2, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -61,7 +64,8 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", diff --git a/addons-cluster/neo4j/values.yaml b/addons-cluster/neo4j/values.yaml index fc72b4e27..f476f1902 100644 --- a/addons-cluster/neo4j/values.yaml +++ b/addons-cluster/neo4j/values.yaml @@ -6,7 +6,7 @@ ## version: 5.26.5 -## @param mode cluster topology mode, singlealone +## @param mode cluster topology mode, singlealone, clustermode ## mode: singlealone @@ -28,6 +28,7 @@ requests: ## @param storage size, the unit is Gi ## storage: 20 +storageClassName: "" extra: terminationPolicy: Delete diff --git a/addons-cluster/neon/tests/fail/compute-replicas-too-low.yaml b/addons-cluster/neon/tests/fail/compute-replicas-too-low.yaml new file mode 100644 index 000000000..d3c0ea777 --- /dev/null +++ b/addons-cluster/neon/tests/fail/compute-replicas-too-low.yaml @@ -0,0 +1,2 @@ +compute: + replicas: 0 diff --git a/addons-cluster/neon/tests/fail/invalid-replicas.yaml b/addons-cluster/neon/tests/fail/invalid-replicas.yaml new file mode 100644 index 000000000..749995b96 --- /dev/null +++ b/addons-cluster/neon/tests/fail/invalid-replicas.yaml @@ -0,0 +1,2 @@ +compute: + replicas: "invalid" diff --git a/addons-cluster/neon/tests/fail/invalid-storage.yaml b/addons-cluster/neon/tests/fail/invalid-storage.yaml new file mode 100644 index 000000000..151928aa8 --- /dev/null +++ b/addons-cluster/neon/tests/fail/invalid-storage.yaml @@ -0,0 +1,2 @@ +safekeeper: + dataStorage: "invalid" diff --git a/addons-cluster/neon/tests/fail/pageserver-replicas-too-low.yaml b/addons-cluster/neon/tests/fail/pageserver-replicas-too-low.yaml new file mode 100644 index 000000000..0a2a03d03 --- /dev/null +++ b/addons-cluster/neon/tests/fail/pageserver-replicas-too-low.yaml @@ -0,0 +1,2 @@ +pageserver: + replicas: 0 diff --git a/addons-cluster/neon/tests/fail/safekeeper-replicas-too-low.yaml b/addons-cluster/neon/tests/fail/safekeeper-replicas-too-low.yaml new file mode 100644 index 000000000..2c4bf8b4d --- /dev/null +++ b/addons-cluster/neon/tests/fail/safekeeper-replicas-too-low.yaml @@ -0,0 +1,2 @@ +safekeeper: + replicas: 0 diff --git a/addons-cluster/neon/tests/fail/storagebroker-replicas-too-low.yaml b/addons-cluster/neon/tests/fail/storagebroker-replicas-too-low.yaml new file mode 100644 index 000000000..612325ac7 --- /dev/null +++ b/addons-cluster/neon/tests/fail/storagebroker-replicas-too-low.yaml @@ -0,0 +1,2 @@ +storagebroker: + replicas: 0 diff --git a/addons-cluster/neon/tests/pass/defaults.yaml b/addons-cluster/neon/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/neon/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/neon/tests/pass/ha.yaml b/addons-cluster/neon/tests/pass/ha.yaml new file mode 100644 index 000000000..37736784c --- /dev/null +++ b/addons-cluster/neon/tests/pass/ha.yaml @@ -0,0 +1,6 @@ +compute: + replicas: 2 +safekeeper: + replicas: 3 +pageserver: + replicas: 2 diff --git a/addons-cluster/neon/values.schema.json b/addons-cluster/neon/values.schema.json index d1ba9c811..ad3a20f4c 100644 --- a/addons-cluster/neon/values.schema.json +++ b/addons-cluster/neon/values.schema.json @@ -12,7 +12,8 @@ "storageClassName": { "type": ["string", "null"], "default": null, - "description": "Storage class name used by persistent volumes" + "description": "Storage class name used by persistent volumes", + "title": "Storage Class Name" }, "compute": { "type": "object", @@ -20,7 +21,8 @@ "replicas": { "type": "integer", "default": 1, - "description": "Number of compute replicas" + "description": "Number of compute replicas", + "minimum": 1 }, "resources": { "type": "object", @@ -35,7 +37,11 @@ "number", "string" ], - "default": 0.5 + "default": 0.5, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -44,7 +50,10 @@ "number", "string" ], - "default": 0.5 + "default": 0.5, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -58,7 +67,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -67,7 +80,10 @@ "number", "string" ], - "default": 2 + "default": 2, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -81,7 +97,8 @@ "replicas": { "type": "integer", "default": 1, - "description": "Number of storage broker replicas" + "description": "Number of storage broker replicas", + "minimum": 1 }, "resources": { "type": "object", @@ -96,7 +113,11 @@ "number", "string" ], - "default": 0.5 + "default": 0.5, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -105,7 +126,10 @@ "number", "string" ], - "default": 0.5 + "default": 0.5, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -119,7 +143,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -128,7 +156,10 @@ "number", "string" ], - "default": 2 + "default": 2, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -142,7 +173,8 @@ "replicas": { "type": "integer", "default": 3, - "description": "Number of safekeeper replicas, forming a raft group" + "description": "Number of safekeeper replicas, forming a raft group", + "minimum": 1 }, "resources": { "type": "object", @@ -157,7 +189,11 @@ "number", "string" ], - "default": 0.5 + "default": 0.5, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -166,7 +202,11 @@ "number", "string" ], - "default": 0.5 + "default": 0.5, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } }, @@ -180,7 +220,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -189,19 +233,26 @@ "number", "string" ], - "default": 2 + "default": 2, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } } }, "dataStorage": { + "title": "Data Storage(Gi)", + "description": "Data storage size for each safekeeper replica", "type": [ "number", "string" ], "default": 20, - "description": "Data storage size for each safekeeper replica" + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -211,7 +262,8 @@ "replicas": { "type": "integer", "default": 1, - "description": "Number of pageserver replicas" + "description": "Number of pageserver replicas", + "minimum": 1 }, "resources": { "type": "object", @@ -226,7 +278,11 @@ "number", "string" ], - "default": 0.5 + "default": 0.5, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -235,7 +291,10 @@ "number", "string" ], - "default": 0.5 + "default": 0.5, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -249,7 +308,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -258,7 +321,10 @@ "number", "string" ], - "default": 2 + "default": 2, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } diff --git a/addons-cluster/oceanbase-ce/tests/fail/cpu-too-low.yaml b/addons-cluster/oceanbase-ce/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..0fc7c79b4 --- /dev/null +++ b/addons-cluster/oceanbase-ce/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 2 diff --git a/addons-cluster/oceanbase-ce/tests/fail/invalid-clusterip.yaml b/addons-cluster/oceanbase-ce/tests/fail/invalid-clusterip.yaml new file mode 100644 index 000000000..a1902938e --- /dev/null +++ b/addons-cluster/oceanbase-ce/tests/fail/invalid-clusterip.yaml @@ -0,0 +1 @@ +clusterIP: invalid diff --git a/addons-cluster/oceanbase-ce/tests/fail/invalid-hostnetwork.yaml b/addons-cluster/oceanbase-ce/tests/fail/invalid-hostnetwork.yaml new file mode 100644 index 000000000..d263ba067 --- /dev/null +++ b/addons-cluster/oceanbase-ce/tests/fail/invalid-hostnetwork.yaml @@ -0,0 +1 @@ +hostnetwork: invalid diff --git a/addons-cluster/oceanbase-ce/tests/fail/memory-too-low.yaml b/addons-cluster/oceanbase-ce/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..4aee4024b --- /dev/null +++ b/addons-cluster/oceanbase-ce/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 3 diff --git a/addons-cluster/oceanbase-ce/tests/fail/replicas-less-than-zonecount.yaml b/addons-cluster/oceanbase-ce/tests/fail/replicas-less-than-zonecount.yaml new file mode 100644 index 000000000..5e0408e27 --- /dev/null +++ b/addons-cluster/oceanbase-ce/tests/fail/replicas-less-than-zonecount.yaml @@ -0,0 +1,2 @@ +replicas: 2 +zoneCount: 3 diff --git a/addons-cluster/oceanbase-ce/tests/fail/zonecount-too-high.yaml b/addons-cluster/oceanbase-ce/tests/fail/zonecount-too-high.yaml new file mode 100644 index 000000000..1502a229a --- /dev/null +++ b/addons-cluster/oceanbase-ce/tests/fail/zonecount-too-high.yaml @@ -0,0 +1 @@ +zoneCount: 4 diff --git a/addons-cluster/oceanbase-ce/tests/fail/zonecount-too-low.yaml b/addons-cluster/oceanbase-ce/tests/fail/zonecount-too-low.yaml new file mode 100644 index 000000000..9bb422c81 --- /dev/null +++ b/addons-cluster/oceanbase-ce/tests/fail/zonecount-too-low.yaml @@ -0,0 +1 @@ +zoneCount: 0 diff --git a/addons-cluster/oceanbase-ce/tests/pass/clusterip-disabled.yaml b/addons-cluster/oceanbase-ce/tests/pass/clusterip-disabled.yaml new file mode 100644 index 000000000..0c813b5e1 --- /dev/null +++ b/addons-cluster/oceanbase-ce/tests/pass/clusterip-disabled.yaml @@ -0,0 +1 @@ +clusterIP: "disabled" diff --git a/addons-cluster/oceanbase-ce/tests/pass/defaults.yaml b/addons-cluster/oceanbase-ce/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/oceanbase-ce/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/oceanbase-ce/tests/pass/hostnetwork-enabled.yaml b/addons-cluster/oceanbase-ce/tests/pass/hostnetwork-enabled.yaml new file mode 100644 index 000000000..90ca5fcba --- /dev/null +++ b/addons-cluster/oceanbase-ce/tests/pass/hostnetwork-enabled.yaml @@ -0,0 +1 @@ +hostnetwork: "enabled" diff --git a/addons-cluster/oceanbase-ce/tests/pass/multizone.yaml b/addons-cluster/oceanbase-ce/tests/pass/multizone.yaml new file mode 100644 index 000000000..9d5f419c9 --- /dev/null +++ b/addons-cluster/oceanbase-ce/tests/pass/multizone.yaml @@ -0,0 +1,2 @@ +zoneCount: 3 +replicas: 3 diff --git a/addons-cluster/oceanbase-ce/tests/pass/two-zones.yaml b/addons-cluster/oceanbase-ce/tests/pass/two-zones.yaml new file mode 100644 index 000000000..3cf85230e --- /dev/null +++ b/addons-cluster/oceanbase-ce/tests/pass/two-zones.yaml @@ -0,0 +1,2 @@ +zoneCount: 2 +replicas: 2 diff --git a/addons-cluster/oceanbase-ce/values.schema.json b/addons-cluster/oceanbase-ce/values.schema.json index c2d75ce9f..329028296 100644 --- a/addons-cluster/oceanbase-ce/values.schema.json +++ b/addons-cluster/oceanbase-ce/values.schema.json @@ -21,28 +21,20 @@ "replicas": { "title": "Replicas", "description": "The number of replicas, no less than zoneCount.", - "type": [ - "integer" - ], + "type": "integer", "minimum": 1 }, "cpu": { "title": "CPU", "description": "CPU cores.", - "type": [ - "number", - "string" - ], + "type": "integer", "default": 8, "minimum": 3 }, "memory": { "title": "Memory(Gi)", "description": "Memory, the unit is Gi.", - "type": [ - "number", - "string" - ], + "type": "integer", "default": 16, "minimum": 4 }, @@ -70,12 +62,10 @@ "type": "object", "properties": { "storageClassName": { - "type": [ - "string", - "null" - ], + "type": "string", "default": "", - "description": "Storage class name used by persistent volumes" + "description": "Storage class name used by persistent volumes", + "title": "Storage Class Name" }, "storages": { "type": "object", diff --git a/addons-cluster/oceanbase-ce/values.yaml b/addons-cluster/oceanbase-ce/values.yaml index 08477e6e2..8d6ad424f 100644 --- a/addons-cluster/oceanbase-ce/values.yaml +++ b/addons-cluster/oceanbase-ce/values.yaml @@ -21,5 +21,5 @@ clusterIP: "enabled" clusterID: "1" extra: + terminationPolicy: Delete disableExporter: false - terminationPolicy: Delete \ No newline at end of file diff --git a/addons-cluster/opensearch/tests/fail/dashboard-replicas-too-low.yaml b/addons-cluster/opensearch/tests/fail/dashboard-replicas-too-low.yaml new file mode 100644 index 000000000..eac5f5cd9 --- /dev/null +++ b/addons-cluster/opensearch/tests/fail/dashboard-replicas-too-low.yaml @@ -0,0 +1,2 @@ +dashboard: + replicaCount: 0 diff --git a/addons-cluster/opensearch/tests/fail/invalid-replicas.yaml b/addons-cluster/opensearch/tests/fail/invalid-replicas.yaml new file mode 100644 index 000000000..d294b81dd --- /dev/null +++ b/addons-cluster/opensearch/tests/fail/invalid-replicas.yaml @@ -0,0 +1 @@ +replicaCount: "invalid" diff --git a/addons-cluster/opensearch/tests/fail/invalid-storage.yaml b/addons-cluster/opensearch/tests/fail/invalid-storage.yaml new file mode 100644 index 000000000..c15ce2d19 --- /dev/null +++ b/addons-cluster/opensearch/tests/fail/invalid-storage.yaml @@ -0,0 +1,3 @@ +persistence: + data: + size: "invalid" diff --git a/addons-cluster/opensearch/tests/pass/defaults.yaml b/addons-cluster/opensearch/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/opensearch/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/opensearch/tests/pass/ha.yaml b/addons-cluster/opensearch/tests/pass/ha.yaml new file mode 100644 index 000000000..81aa0e1e6 --- /dev/null +++ b/addons-cluster/opensearch/tests/pass/ha.yaml @@ -0,0 +1,3 @@ +replicaCount: 3 +dashboard: + replicaCount: 2 diff --git a/addons-cluster/opensearch/tests/pass/no-persistence.yaml b/addons-cluster/opensearch/tests/pass/no-persistence.yaml new file mode 100644 index 000000000..4d6af8b22 --- /dev/null +++ b/addons-cluster/opensearch/tests/pass/no-persistence.yaml @@ -0,0 +1,2 @@ +persistence: + enabled: false diff --git a/addons-cluster/opensearch/values.schema.json b/addons-cluster/opensearch/values.schema.json index cb8f5950f..c8a04069a 100644 --- a/addons-cluster/opensearch/values.schema.json +++ b/addons-cluster/opensearch/values.schema.json @@ -23,7 +23,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -32,7 +36,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -46,7 +53,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -55,7 +66,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -75,7 +89,8 @@ "storageClassName": { "type": ["string", "null"], "default": null, - "description": "Storage class name used by persistent volumes" + "description": "Storage class name used by persistent volumes", + "title": "Storage Class Name" }, "size": { "title": "Storage Size(Gi)", @@ -84,7 +99,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -107,7 +125,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -116,7 +138,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -130,7 +155,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory(Gi)", @@ -139,15 +168,20 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } } }, "replicaCount": { + "title": "Replica Count", "type": "integer", "default": 1, + "minimum": 1, "description": "Number of dashboard replicas" } } diff --git a/addons-cluster/orchestrator/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/orchestrator/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/orchestrator/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/orchestrator/tests/fail/cpu-too-high.yaml b/addons-cluster/orchestrator/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/orchestrator/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/orchestrator/tests/fail/cpu-too-low.yaml b/addons-cluster/orchestrator/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/orchestrator/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/orchestrator/tests/fail/invalid-mode.yaml b/addons-cluster/orchestrator/tests/fail/invalid-mode.yaml new file mode 100644 index 000000000..fc7b62207 --- /dev/null +++ b/addons-cluster/orchestrator/tests/fail/invalid-mode.yaml @@ -0,0 +1 @@ +mode: invalid diff --git a/addons-cluster/orchestrator/tests/fail/memory-too-high.yaml b/addons-cluster/orchestrator/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/orchestrator/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/orchestrator/tests/fail/memory-too-low.yaml b/addons-cluster/orchestrator/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/orchestrator/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/orchestrator/tests/fail/storage-too-high.yaml b/addons-cluster/orchestrator/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/orchestrator/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/orchestrator/tests/fail/storage-too-low.yaml b/addons-cluster/orchestrator/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/orchestrator/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/orchestrator/tests/pass/defaults.yaml b/addons-cluster/orchestrator/tests/pass/defaults.yaml new file mode 100644 index 000000000..759034056 --- /dev/null +++ b/addons-cluster/orchestrator/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (mode: raft) diff --git a/addons-cluster/orchestrator/tests/pass/max-values.yaml b/addons-cluster/orchestrator/tests/pass/max-values.yaml new file mode 100644 index 000000000..8f81346ed --- /dev/null +++ b/addons-cluster/orchestrator/tests/pass/max-values.yaml @@ -0,0 +1,3 @@ +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/orchestrator/tests/pass/shared-backend.yaml b/addons-cluster/orchestrator/tests/pass/shared-backend.yaml new file mode 100644 index 000000000..37dfb2bb0 --- /dev/null +++ b/addons-cluster/orchestrator/tests/pass/shared-backend.yaml @@ -0,0 +1,4 @@ +mode: shared-backend +serviceReference: + metadb: + cluster: "my-mysql-cluster" diff --git a/addons-cluster/orchestrator/values.schema.json b/addons-cluster/orchestrator/values.schema.json index 9b4c18aa8..eccc1df60 100644 --- a/addons-cluster/orchestrator/values.schema.json +++ b/addons-cluster/orchestrator/values.schema.json @@ -28,6 +28,7 @@ "default": 1, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -39,7 +40,8 @@ ], "default": 1, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -50,7 +52,8 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } diff --git a/addons-cluster/orioledb/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/orioledb/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/orioledb/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/orioledb/tests/fail/cpu-too-high.yaml b/addons-cluster/orioledb/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/orioledb/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/orioledb/tests/fail/cpu-too-low.yaml b/addons-cluster/orioledb/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/orioledb/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/orioledb/tests/fail/invalid-mode.yaml b/addons-cluster/orioledb/tests/fail/invalid-mode.yaml new file mode 100644 index 000000000..fc7b62207 --- /dev/null +++ b/addons-cluster/orioledb/tests/fail/invalid-mode.yaml @@ -0,0 +1 @@ +mode: invalid diff --git a/addons-cluster/orioledb/tests/fail/memory-too-high.yaml b/addons-cluster/orioledb/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/orioledb/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/orioledb/tests/fail/memory-too-low.yaml b/addons-cluster/orioledb/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/orioledb/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/orioledb/tests/fail/replicas-too-high.yaml b/addons-cluster/orioledb/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/orioledb/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/orioledb/tests/fail/replicas-too-low.yaml b/addons-cluster/orioledb/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/orioledb/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/orioledb/tests/fail/storage-too-high.yaml b/addons-cluster/orioledb/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/orioledb/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/orioledb/tests/fail/storage-too-low.yaml b/addons-cluster/orioledb/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/orioledb/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/orioledb/tests/pass/defaults.yaml b/addons-cluster/orioledb/tests/pass/defaults.yaml new file mode 100644 index 000000000..a796c6c37 --- /dev/null +++ b/addons-cluster/orioledb/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (mode: replication) diff --git a/addons-cluster/orioledb/tests/pass/max-values.yaml b/addons-cluster/orioledb/tests/pass/max-values.yaml new file mode 100644 index 000000000..83f00ed3c --- /dev/null +++ b/addons-cluster/orioledb/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 5 +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/orioledb/tests/pass/standalone.yaml b/addons-cluster/orioledb/tests/pass/standalone.yaml new file mode 100644 index 000000000..c3dab2b97 --- /dev/null +++ b/addons-cluster/orioledb/tests/pass/standalone.yaml @@ -0,0 +1,2 @@ +mode: standalone +replicas: 1 diff --git a/addons-cluster/orioledb/values.schema.json b/addons-cluster/orioledb/values.schema.json index e4d4086a7..c1d09d4af 100644 --- a/addons-cluster/orioledb/values.schema.json +++ b/addons-cluster/orioledb/values.schema.json @@ -30,6 +30,7 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -41,7 +42,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -52,12 +54,14 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", "description": "Storage class name of the data volume", - "type": "string" + "type": "string", + "default": "" } } } diff --git a/addons-cluster/orioledb/values.yaml b/addons-cluster/orioledb/values.yaml index 0a75e5f73..42490513b 100644 --- a/addons-cluster/orioledb/values.yaml +++ b/addons-cluster/orioledb/values.yaml @@ -36,3 +36,5 @@ requests: ## @param storage size, the unit is Gi ## storage: 20 + +storageClassName: "" diff --git a/addons-cluster/polardbx/tests/fail/cdc-replicas-too-low.yaml b/addons-cluster/polardbx/tests/fail/cdc-replicas-too-low.yaml new file mode 100644 index 000000000..a9aadd353 --- /dev/null +++ b/addons-cluster/polardbx/tests/fail/cdc-replicas-too-low.yaml @@ -0,0 +1,2 @@ +cdc: + replicas: 0 diff --git a/addons-cluster/polardbx/tests/fail/cn-replicas-too-low.yaml b/addons-cluster/polardbx/tests/fail/cn-replicas-too-low.yaml new file mode 100644 index 000000000..c8332b5bd --- /dev/null +++ b/addons-cluster/polardbx/tests/fail/cn-replicas-too-low.yaml @@ -0,0 +1,2 @@ +cn: + replicas: 0 diff --git a/addons-cluster/polardbx/tests/fail/gms-replicas-too-low.yaml b/addons-cluster/polardbx/tests/fail/gms-replicas-too-low.yaml new file mode 100644 index 000000000..c8c03ba71 --- /dev/null +++ b/addons-cluster/polardbx/tests/fail/gms-replicas-too-low.yaml @@ -0,0 +1,2 @@ +gms: + replicas: 0 diff --git a/addons-cluster/polardbx/tests/fail/invalid-replicas.yaml b/addons-cluster/polardbx/tests/fail/invalid-replicas.yaml new file mode 100644 index 000000000..008934ed1 --- /dev/null +++ b/addons-cluster/polardbx/tests/fail/invalid-replicas.yaml @@ -0,0 +1,2 @@ +gms: + replicas: "invalid" diff --git a/addons-cluster/polardbx/tests/fail/invalid-storage.yaml b/addons-cluster/polardbx/tests/fail/invalid-storage.yaml new file mode 100644 index 000000000..ee255226b --- /dev/null +++ b/addons-cluster/polardbx/tests/fail/invalid-storage.yaml @@ -0,0 +1,4 @@ +gms: + persistence: + data: + size: "invalid" diff --git a/addons-cluster/polardbx/tests/pass/defaults.yaml b/addons-cluster/polardbx/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/polardbx/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/polardbx/tests/pass/ha.yaml b/addons-cluster/polardbx/tests/pass/ha.yaml new file mode 100644 index 000000000..d38138247 --- /dev/null +++ b/addons-cluster/polardbx/tests/pass/ha.yaml @@ -0,0 +1,6 @@ +gms: + replicas: 5 +cn: + replicas: 3 +cdc: + replicas: 3 diff --git a/addons-cluster/polardbx/tests/pass/multi-dn.yaml b/addons-cluster/polardbx/tests/pass/multi-dn.yaml new file mode 100644 index 000000000..4ee31b831 --- /dev/null +++ b/addons-cluster/polardbx/tests/pass/multi-dn.yaml @@ -0,0 +1,27 @@ +dn: + - replicas: 3 + resources: + requests: + cpu: 1 + memory: 1 + limits: + cpu: 1 + memory: 1 + persistence: + enabled: true + data: + storageClassName: + size: 20 + - replicas: 3 + resources: + requests: + cpu: 1 + memory: 1 + limits: + cpu: 1 + memory: 1 + persistence: + enabled: true + data: + storageClassName: + size: 20 diff --git a/addons-cluster/polardbx/values.schema.json b/addons-cluster/polardbx/values.schema.json index 877ed5e64..0b177345b 100644 --- a/addons-cluster/polardbx/values.schema.json +++ b/addons-cluster/polardbx/values.schema.json @@ -9,11 +9,11 @@ "replicas": { "type": "integer", "description": "data replicas of gms instance. Default value is 3, which means a paxos group: leader, follower, follower", - "default": 3 + "default": 3, + "minimum": 1 }, "resources": { "type": "object", - "description": "resource management for gms component. more info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", "properties": { "requests": { "type": "object", @@ -25,7 +25,11 @@ ], "title": "CPU request", "description": "CPU request", - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "type": [ @@ -34,7 +38,11 @@ ], "title": "Memory request(Gi)", "description": "Memory request", - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } }, @@ -48,7 +56,11 @@ ], "title": "CPU limit", "description": "CPU limit", - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "type": [ @@ -57,7 +69,11 @@ ], "title": "Memory limit(Gi)", "description": "Memory limit", - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } } @@ -68,28 +84,31 @@ "description": "Enable persistence using Persistent Volume Claims", "properties": { "enabled": { - "type": "boolean", + "title": "Enabled", "description": "Enable persistence using Persistent Volume Claims", - "default": true + "default": true, + "type": "boolean" }, "data": { "type": "object", - "description": "`data` volume settings", "properties": { "storageClassName": { - "title": "Storage Class Name", "description": "Storage class name of the data volume", "type": ["string", "null"], - "default": null + "default": null, + "title": "Storage Class Name" }, "size": { "type": [ "number", "string" ], - "title": "Size of data volume(Gi)", "description": "Size of data volume, the unit is Gi.", - "default": 20 + "default": 20, + "title": "Size of data volume(Gi)", + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -104,11 +123,11 @@ "replicas": { "type": "integer", "description": "number of polardb-x cn nodes", - "default": 2 + "default": 2, + "minimum": 1 }, "resources": { "type": "object", - "description": "resource management for cn component. more info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", "properties": { "requests": { "type": "object", @@ -120,7 +139,11 @@ ], "title": "CPU request", "description": "CPU request", - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "type": [ @@ -129,7 +152,11 @@ ], "title": "Memory request(Gi)", "description": "Memory request", - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } }, @@ -143,7 +170,11 @@ ], "title": "CPU limit", "description": "CPU limit", - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "type": [ @@ -152,7 +183,11 @@ ], "title": "Memory limit(Gi)", "description": "Memory limit", - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } } @@ -167,11 +202,11 @@ "replicas": { "type": "integer", "description": "number of polardb-x cdc nodes", - "default": 2 + "default": 2, + "minimum": 1 }, "resources": { "type": "object", - "description": "resource management for cdc component. more info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", "properties": { "requests": { "type": "object", @@ -183,7 +218,11 @@ ], "title": "CPU request", "description": "CPU request", - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "type": [ @@ -192,7 +231,11 @@ ], "title": "Memory request(Gi)", "description": "Memory request", - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } }, @@ -206,7 +249,11 @@ ], "title": "CPU limit", "description": "CPU limit", - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "type": [ @@ -215,7 +262,11 @@ ], "title": "Memory limit(Gi)", "description": "Memory limit", - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } } diff --git a/addons-cluster/postgresql/templates/cluster.yaml b/addons-cluster/postgresql/templates/cluster.yaml index 41ad11f9b..7c4fe713e 100644 --- a/addons-cluster/postgresql/templates/cluster.yaml +++ b/addons-cluster/postgresql/templates/cluster.yaml @@ -5,6 +5,6 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{ include "kblib.clusterLabels" . | nindent 4 }} spec: - terminationPolicy: {{ .Values.terminationPolicy }} + terminationPolicy: {{ .Values.extra.terminationPolicy }} {{- include "postgresql-cluster.componentSpec" . }} diff --git a/addons-cluster/postgresql/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/postgresql/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/postgresql/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/postgresql/tests/fail/cpu-too-high.yaml b/addons-cluster/postgresql/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/postgresql/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/postgresql/tests/fail/cpu-too-low.yaml b/addons-cluster/postgresql/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/postgresql/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/postgresql/tests/fail/memory-too-high.yaml b/addons-cluster/postgresql/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/postgresql/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/postgresql/tests/fail/memory-too-low.yaml b/addons-cluster/postgresql/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/postgresql/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/postgresql/tests/fail/replicas-too-high.yaml b/addons-cluster/postgresql/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/postgresql/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/postgresql/tests/fail/replicas-too-low.yaml b/addons-cluster/postgresql/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/postgresql/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/postgresql/tests/fail/storage-too-high.yaml b/addons-cluster/postgresql/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/postgresql/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/postgresql/tests/fail/storage-too-low.yaml b/addons-cluster/postgresql/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/postgresql/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/postgresql/tests/pass/defaults.yaml b/addons-cluster/postgresql/tests/pass/defaults.yaml new file mode 100644 index 000000000..a796c6c37 --- /dev/null +++ b/addons-cluster/postgresql/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (mode: replication) diff --git a/addons-cluster/postgresql/tests/pass/etcd-enabled.yaml b/addons-cluster/postgresql/tests/pass/etcd-enabled.yaml new file mode 100644 index 000000000..a5d428efd --- /dev/null +++ b/addons-cluster/postgresql/tests/pass/etcd-enabled.yaml @@ -0,0 +1,7 @@ +etcd: + enabled: true + meta: + mode: incluster + serviceRef: + cluster: + name: "my-etcd-cluster" diff --git a/addons-cluster/postgresql/tests/pass/max-values.yaml b/addons-cluster/postgresql/tests/pass/max-values.yaml new file mode 100644 index 000000000..83f00ed3c --- /dev/null +++ b/addons-cluster/postgresql/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 5 +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/postgresql/tests/pass/standalone.yaml b/addons-cluster/postgresql/tests/pass/standalone.yaml new file mode 100644 index 000000000..c3dab2b97 --- /dev/null +++ b/addons-cluster/postgresql/tests/pass/standalone.yaml @@ -0,0 +1,2 @@ +mode: standalone +replicas: 1 diff --git a/addons-cluster/postgresql/values.schema.json b/addons-cluster/postgresql/values.schema.json index a461ca928..68bcdb06d 100644 --- a/addons-cluster/postgresql/values.schema.json +++ b/addons-cluster/postgresql/values.schema.json @@ -26,6 +26,7 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -37,7 +38,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -48,12 +50,14 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", "description": "Storage class name of the data volume", - "type": "string" + "type": "string", + "default": "" } } } diff --git a/addons-cluster/postgresql/values.yaml b/addons-cluster/postgresql/values.yaml index 394739964..b73d5e86b 100644 --- a/addons-cluster/postgresql/values.yaml +++ b/addons-cluster/postgresql/values.yaml @@ -2,9 +2,8 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -## @param terminationPolicy define Cluster termination policy. One of DoNotTerminate, Delete, WipeOut. -## -terminationPolicy: Delete +extra: + terminationPolicy: Delete ## @param version, mapping cluster.spec.componentSpec[].serviceVersion which defined in ComponentVersion ## @@ -37,6 +36,10 @@ requests: ## storage: 20 +## @param storageClassName class name +storageClassName: "" + + etcd: enabled: false meta: diff --git a/addons-cluster/pulsar/templates/cluster.yaml b/addons-cluster/pulsar/templates/cluster.yaml index 0d411eaeb..db77d6589 100644 --- a/addons-cluster/pulsar/templates/cluster.yaml +++ b/addons-cluster/pulsar/templates/cluster.yaml @@ -9,7 +9,7 @@ metadata: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} spec: - terminationPolicy: {{ $.Values.terminationPolicy }} + terminationPolicy: {{ .Values.extra.terminationPolicy }} {{- $topologyEnable := ne .Values.mode "" | default false }} {{- if $topologyEnable}} clusterDef: pulsar diff --git a/addons-cluster/pulsar/tests/fail/bookies-replicas-invalid.yaml b/addons-cluster/pulsar/tests/fail/bookies-replicas-invalid.yaml new file mode 100644 index 000000000..0f62bb9fd --- /dev/null +++ b/addons-cluster/pulsar/tests/fail/bookies-replicas-invalid.yaml @@ -0,0 +1,2 @@ +bookies: + replicaCount: 2 diff --git a/addons-cluster/pulsar/tests/fail/broker-replicas-too-high.yaml b/addons-cluster/pulsar/tests/fail/broker-replicas-too-high.yaml new file mode 100644 index 000000000..4169d9f84 --- /dev/null +++ b/addons-cluster/pulsar/tests/fail/broker-replicas-too-high.yaml @@ -0,0 +1,2 @@ +broker: + replicaCount: 6 diff --git a/addons-cluster/pulsar/tests/fail/broker-replicas-too-low.yaml b/addons-cluster/pulsar/tests/fail/broker-replicas-too-low.yaml new file mode 100644 index 000000000..e42cf98da --- /dev/null +++ b/addons-cluster/pulsar/tests/fail/broker-replicas-too-low.yaml @@ -0,0 +1,2 @@ +broker: + replicaCount: 0 diff --git a/addons-cluster/pulsar/tests/fail/invalid-mode.yaml b/addons-cluster/pulsar/tests/fail/invalid-mode.yaml new file mode 100644 index 000000000..fc7b62207 --- /dev/null +++ b/addons-cluster/pulsar/tests/fail/invalid-mode.yaml @@ -0,0 +1 @@ +mode: invalid diff --git a/addons-cluster/pulsar/tests/fail/proxy-replicas-too-high.yaml b/addons-cluster/pulsar/tests/fail/proxy-replicas-too-high.yaml new file mode 100644 index 000000000..12ea3988f --- /dev/null +++ b/addons-cluster/pulsar/tests/fail/proxy-replicas-too-high.yaml @@ -0,0 +1,2 @@ +proxy: + replicaCount: 6 diff --git a/addons-cluster/pulsar/tests/fail/proxy-replicas-too-low.yaml b/addons-cluster/pulsar/tests/fail/proxy-replicas-too-low.yaml new file mode 100644 index 000000000..72585fbb4 --- /dev/null +++ b/addons-cluster/pulsar/tests/fail/proxy-replicas-too-low.yaml @@ -0,0 +1,2 @@ +proxy: + replicaCount: 0 diff --git a/addons-cluster/pulsar/tests/fail/replicas-too-high.yaml b/addons-cluster/pulsar/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..87f592571 --- /dev/null +++ b/addons-cluster/pulsar/tests/fail/replicas-too-high.yaml @@ -0,0 +1,2 @@ +bookies: + replicaCount: 6 diff --git a/addons-cluster/pulsar/tests/pass/basic-cluster.yaml b/addons-cluster/pulsar/tests/pass/basic-cluster.yaml new file mode 100644 index 000000000..7d1fdc8c1 --- /dev/null +++ b/addons-cluster/pulsar/tests/pass/basic-cluster.yaml @@ -0,0 +1 @@ +mode: pulsar-basic-cluster diff --git a/addons-cluster/pulsar/tests/pass/bookies-replicas-3.yaml b/addons-cluster/pulsar/tests/pass/bookies-replicas-3.yaml new file mode 100644 index 000000000..7f628f267 --- /dev/null +++ b/addons-cluster/pulsar/tests/pass/bookies-replicas-3.yaml @@ -0,0 +1,2 @@ +bookies: + replicaCount: 3 diff --git a/addons-cluster/pulsar/tests/pass/bookies-replicas-5.yaml b/addons-cluster/pulsar/tests/pass/bookies-replicas-5.yaml new file mode 100644 index 000000000..08cbf8f01 --- /dev/null +++ b/addons-cluster/pulsar/tests/pass/bookies-replicas-5.yaml @@ -0,0 +1,2 @@ +bookies: + replicaCount: 5 diff --git a/addons-cluster/pulsar/tests/pass/defaults.yaml b/addons-cluster/pulsar/tests/pass/defaults.yaml new file mode 100644 index 000000000..49372dec2 --- /dev/null +++ b/addons-cluster/pulsar/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (mode: pulsar-enhanced-cluster) diff --git a/addons-cluster/pulsar/tests/pass/external-zookeeper.yaml b/addons-cluster/pulsar/tests/pass/external-zookeeper.yaml new file mode 100644 index 000000000..197ec6007 --- /dev/null +++ b/addons-cluster/pulsar/tests/pass/external-zookeeper.yaml @@ -0,0 +1,5 @@ +serviceReference: + enabled: true + zookeeper: + clusterServiceSelector: + cluster: my-zk diff --git a/addons-cluster/pulsar/tests/pass/ha.yaml b/addons-cluster/pulsar/tests/pass/ha.yaml new file mode 100644 index 000000000..e7f64cc77 --- /dev/null +++ b/addons-cluster/pulsar/tests/pass/ha.yaml @@ -0,0 +1,4 @@ +broker: + replicaCount: 3 +proxy: + replicaCount: 3 diff --git a/addons-cluster/pulsar/tests/pass/nodeport.yaml b/addons-cluster/pulsar/tests/pass/nodeport.yaml new file mode 100644 index 000000000..9ac3e0433 --- /dev/null +++ b/addons-cluster/pulsar/tests/pass/nodeport.yaml @@ -0,0 +1 @@ +nodePortEnabled: true diff --git a/addons-cluster/pulsar/values.schema.json b/addons-cluster/pulsar/values.schema.json index 478121a8a..1263112d8 100644 --- a/addons-cluster/pulsar/values.schema.json +++ b/addons-cluster/pulsar/values.schema.json @@ -54,7 +54,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory limit(Gi)", @@ -63,7 +67,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -77,7 +84,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory request(Gi)", @@ -86,7 +97,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -112,7 +126,10 @@ "number", "string" ], - "default": 8 + "default": 8, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -132,7 +149,10 @@ "number", "string" ], - "default": 8 + "default": 8, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -158,7 +178,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory limit(Gi)", @@ -167,7 +191,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -181,7 +208,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory request(Gi)", @@ -190,7 +221,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -222,7 +256,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory limit(Gi)", @@ -231,7 +269,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -245,7 +286,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory request(Gi)", @@ -254,7 +299,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -282,7 +330,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory limit(Gi)", @@ -291,7 +343,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -305,7 +360,11 @@ "number", "string" ], - "default": 0.1 + "default": 0.1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory request(Gi)", @@ -314,7 +373,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -343,7 +405,10 @@ "number", "string" ], - "default": 8 + "default": 8, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -363,7 +428,10 @@ "number", "string" ], - "default": 8 + "default": 8, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -401,7 +469,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory limit(Gi)", @@ -410,7 +482,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -424,7 +499,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory request(Gi)", @@ -433,7 +512,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } diff --git a/addons-cluster/pulsar/values.yaml b/addons-cluster/pulsar/values.yaml index 768e9214c..814827efc 100644 --- a/addons-cluster/pulsar/values.yaml +++ b/addons-cluster/pulsar/values.yaml @@ -6,9 +6,8 @@ nameOverride: "" fullnameOverride: "" -## @param terminationPolicy define Cluster termination policy. One of DoNotTerminate, Delete, WipeOut. -## -terminationPolicy: Delete +extra: + terminationPolicy: Delete ## Annotation configurations commonAnnotations: diff --git a/addons-cluster/qdrant/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/qdrant/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/qdrant/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/qdrant/tests/fail/cpu-too-high.yaml b/addons-cluster/qdrant/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/qdrant/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/qdrant/tests/fail/cpu-too-low.yaml b/addons-cluster/qdrant/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/qdrant/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/qdrant/tests/fail/memory-too-high.yaml b/addons-cluster/qdrant/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/qdrant/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/qdrant/tests/fail/memory-too-low.yaml b/addons-cluster/qdrant/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/qdrant/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/qdrant/tests/fail/replicas-too-high.yaml b/addons-cluster/qdrant/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..fd92c10b8 --- /dev/null +++ b/addons-cluster/qdrant/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 17 diff --git a/addons-cluster/qdrant/tests/fail/replicas-too-low.yaml b/addons-cluster/qdrant/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/qdrant/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/qdrant/tests/fail/storage-too-high.yaml b/addons-cluster/qdrant/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/qdrant/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/qdrant/tests/fail/storage-too-low.yaml b/addons-cluster/qdrant/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/qdrant/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/qdrant/tests/pass/defaults.yaml b/addons-cluster/qdrant/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/qdrant/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/qdrant/tests/pass/max-values.yaml b/addons-cluster/qdrant/tests/pass/max-values.yaml new file mode 100644 index 000000000..3c8376bae --- /dev/null +++ b/addons-cluster/qdrant/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 16 +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/qdrant/tests/pass/replicas-3.yaml b/addons-cluster/qdrant/tests/pass/replicas-3.yaml new file mode 100644 index 000000000..71ffd9f27 --- /dev/null +++ b/addons-cluster/qdrant/tests/pass/replicas-3.yaml @@ -0,0 +1 @@ +replicas: 3 diff --git a/addons-cluster/qdrant/values.schema.json b/addons-cluster/qdrant/values.schema.json index 9b8a9626c..5c113e138 100644 --- a/addons-cluster/qdrant/values.schema.json +++ b/addons-cluster/qdrant/values.schema.json @@ -26,6 +26,7 @@ "default": 1, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -37,7 +38,8 @@ ], "default": 2, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -48,12 +50,14 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", "description": "Storage class name of the data volume", - "type": "string" + "type": "string", + "default": "" } } } diff --git a/addons-cluster/qdrant/values.yaml b/addons-cluster/qdrant/values.yaml index 352ae2914..8111596bc 100644 --- a/addons-cluster/qdrant/values.yaml +++ b/addons-cluster/qdrant/values.yaml @@ -24,7 +24,7 @@ memory: 2 ## @param storage size, the unit is Gi ## storage: 20 - +storageClassName: "" ## customized default values to override kblib chart's values extra: terminationPolicy: Delete diff --git a/addons-cluster/rabbitmq/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/rabbitmq/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..133a57404 --- /dev/null +++ b/addons-cluster/rabbitmq/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.15 diff --git a/addons-cluster/rabbitmq/tests/fail/cpu-too-high.yaml b/addons-cluster/rabbitmq/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/rabbitmq/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/rabbitmq/tests/fail/cpu-too-low.yaml b/addons-cluster/rabbitmq/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..d5484a62d --- /dev/null +++ b/addons-cluster/rabbitmq/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.05 diff --git a/addons-cluster/rabbitmq/tests/fail/invalid-mode.yaml b/addons-cluster/rabbitmq/tests/fail/invalid-mode.yaml new file mode 100644 index 000000000..fc7b62207 --- /dev/null +++ b/addons-cluster/rabbitmq/tests/fail/invalid-mode.yaml @@ -0,0 +1 @@ +mode: invalid diff --git a/addons-cluster/rabbitmq/tests/fail/memory-too-high.yaml b/addons-cluster/rabbitmq/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/rabbitmq/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/rabbitmq/tests/fail/memory-too-low.yaml b/addons-cluster/rabbitmq/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..59428faa8 --- /dev/null +++ b/addons-cluster/rabbitmq/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.05 diff --git a/addons-cluster/rabbitmq/tests/fail/replicas-too-high.yaml b/addons-cluster/rabbitmq/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/rabbitmq/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/rabbitmq/tests/fail/replicas-too-low.yaml b/addons-cluster/rabbitmq/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/rabbitmq/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/rabbitmq/tests/fail/storage-too-high.yaml b/addons-cluster/rabbitmq/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/rabbitmq/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/rabbitmq/tests/fail/storage-too-low.yaml b/addons-cluster/rabbitmq/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/rabbitmq/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/rabbitmq/tests/pass/cluster-mode.yaml b/addons-cluster/rabbitmq/tests/pass/cluster-mode.yaml new file mode 100644 index 000000000..104b4dfeb --- /dev/null +++ b/addons-cluster/rabbitmq/tests/pass/cluster-mode.yaml @@ -0,0 +1,2 @@ +mode: clustermode +replicas: 3 diff --git a/addons-cluster/rabbitmq/tests/pass/defaults.yaml b/addons-cluster/rabbitmq/tests/pass/defaults.yaml new file mode 100644 index 000000000..5c0499a84 --- /dev/null +++ b/addons-cluster/rabbitmq/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (mode: singlenode) diff --git a/addons-cluster/rabbitmq/tests/pass/max-values.yaml b/addons-cluster/rabbitmq/tests/pass/max-values.yaml new file mode 100644 index 000000000..83f00ed3c --- /dev/null +++ b/addons-cluster/rabbitmq/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 5 +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/rabbitmq/values.schema.json b/addons-cluster/rabbitmq/values.schema.json index c6b570dd8..5ec4c1eec 100644 --- a/addons-cluster/rabbitmq/values.schema.json +++ b/addons-cluster/rabbitmq/values.schema.json @@ -46,6 +46,7 @@ "default": 0.5, "minimum": 0.1, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.1 }, "memory": { @@ -57,7 +58,8 @@ ], "default": 0.5, "minimum": 0.1, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -68,12 +70,14 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", "description": "Storage class name of the data volume", - "type": "string" + "type": "string", + "default": "" } } } diff --git a/addons-cluster/rabbitmq/values.yaml b/addons-cluster/rabbitmq/values.yaml index e10961cec..4b9f13148 100644 --- a/addons-cluster/rabbitmq/values.yaml +++ b/addons-cluster/rabbitmq/values.yaml @@ -28,6 +28,7 @@ requests: ## @param storage size, the unit is Gi ## storage: 20 +storageClassName: "" extra: terminationPolicy: Delete diff --git a/addons-cluster/redis/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/redis/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/redis/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/redis/tests/fail/cpu-too-high.yaml b/addons-cluster/redis/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/redis/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/redis/tests/fail/cpu-too-low.yaml b/addons-cluster/redis/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/redis/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/redis/tests/fail/invalid-mode.yaml b/addons-cluster/redis/tests/fail/invalid-mode.yaml new file mode 100644 index 000000000..fc7b62207 --- /dev/null +++ b/addons-cluster/redis/tests/fail/invalid-mode.yaml @@ -0,0 +1 @@ +mode: invalid diff --git a/addons-cluster/redis/tests/fail/invalid-redis-shards.yaml b/addons-cluster/redis/tests/fail/invalid-redis-shards.yaml new file mode 100644 index 000000000..ca6b95a1d --- /dev/null +++ b/addons-cluster/redis/tests/fail/invalid-redis-shards.yaml @@ -0,0 +1,4 @@ +mode: cluster +replicas: 2 # 1 primary, 1 secondary per shard +redisCluster: + shardCount: 2 diff --git a/addons-cluster/redis/tests/fail/memory-too-high.yaml b/addons-cluster/redis/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/redis/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/redis/tests/fail/memory-too-low.yaml b/addons-cluster/redis/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/redis/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/redis/tests/fail/redis-shards-too-high.yaml b/addons-cluster/redis/tests/fail/redis-shards-too-high.yaml new file mode 100644 index 000000000..0bc320adf --- /dev/null +++ b/addons-cluster/redis/tests/fail/redis-shards-too-high.yaml @@ -0,0 +1,3 @@ +mode: cluster +redisCluster: + shardCount: 2049 diff --git a/addons-cluster/redis/tests/fail/replicas-too-high.yaml b/addons-cluster/redis/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/redis/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/redis/tests/fail/replicas-too-low.yaml b/addons-cluster/redis/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/redis/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/redis/tests/fail/storage-too-high.yaml b/addons-cluster/redis/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/redis/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/redis/tests/fail/storage-too-low.yaml b/addons-cluster/redis/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/redis/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/redis/tests/pass/custom-secret.yaml b/addons-cluster/redis/tests/pass/custom-secret.yaml new file mode 100644 index 000000000..b03e86246 --- /dev/null +++ b/addons-cluster/redis/tests/pass/custom-secret.yaml @@ -0,0 +1,4 @@ +# Tests default replication mode with a custom secret for the password +mode: replication +customSecretName: "my-redis-secret" +customSecretNamespace: "my-app-ns" diff --git a/addons-cluster/redis/tests/pass/defaults.yaml b/addons-cluster/redis/tests/pass/defaults.yaml new file mode 100644 index 000000000..2f3bf91c7 --- /dev/null +++ b/addons-cluster/redis/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# This file is intentionally left empty to test default chart values. diff --git a/addons-cluster/redis/tests/pass/fixed-pod-ip.yaml b/addons-cluster/redis/tests/pass/fixed-pod-ip.yaml new file mode 100644 index 000000000..eb4fbe6c4 --- /dev/null +++ b/addons-cluster/redis/tests/pass/fixed-pod-ip.yaml @@ -0,0 +1 @@ +fixedPodIPEnabled: true diff --git a/addons-cluster/redis/tests/pass/hostnetwork-enabled.yaml b/addons-cluster/redis/tests/pass/hostnetwork-enabled.yaml new file mode 100644 index 000000000..a24392956 --- /dev/null +++ b/addons-cluster/redis/tests/pass/hostnetwork-enabled.yaml @@ -0,0 +1 @@ +hostNetworkEnabled: true diff --git a/addons-cluster/redis/tests/pass/max-values.yaml b/addons-cluster/redis/tests/pass/max-values.yaml new file mode 100644 index 000000000..83f00ed3c --- /dev/null +++ b/addons-cluster/redis/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 5 +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/redis/tests/pass/mode-cluster-max-shards.yaml b/addons-cluster/redis/tests/pass/mode-cluster-max-shards.yaml new file mode 100644 index 000000000..30ffabb11 --- /dev/null +++ b/addons-cluster/redis/tests/pass/mode-cluster-max-shards.yaml @@ -0,0 +1,3 @@ +mode: cluster +redisCluster: + shardCount: 2048 diff --git a/addons-cluster/redis/tests/pass/mode-cluster.yaml b/addons-cluster/redis/tests/pass/mode-cluster.yaml new file mode 100644 index 000000000..26558deae --- /dev/null +++ b/addons-cluster/redis/tests/pass/mode-cluster.yaml @@ -0,0 +1,4 @@ +mode: cluster +replicas: 2 # 1 primary, 1 secondary per shard +redisCluster: + shardCount: 3 diff --git a/addons-cluster/redis/tests/pass/mode-replication-twemproxy.yaml b/addons-cluster/redis/tests/pass/mode-replication-twemproxy.yaml new file mode 100644 index 000000000..7c670d87e --- /dev/null +++ b/addons-cluster/redis/tests/pass/mode-replication-twemproxy.yaml @@ -0,0 +1,5 @@ +mode: replication-twemproxy +replicas: 2 +twemproxy: + enabled: true + replicas: 2 diff --git a/addons-cluster/redis/tests/pass/mode-standalone.yaml b/addons-cluster/redis/tests/pass/mode-standalone.yaml new file mode 100644 index 000000000..c3dab2b97 --- /dev/null +++ b/addons-cluster/redis/tests/pass/mode-standalone.yaml @@ -0,0 +1,2 @@ +mode: standalone +replicas: 1 diff --git a/addons-cluster/redis/tests/pass/nodeport-enabled.yaml b/addons-cluster/redis/tests/pass/nodeport-enabled.yaml new file mode 100644 index 000000000..535ca37c9 --- /dev/null +++ b/addons-cluster/redis/tests/pass/nodeport-enabled.yaml @@ -0,0 +1,3 @@ +# Tests default replication mode with nodePort enabled +mode: replication +nodePortEnabled: true diff --git a/addons-cluster/redis/values.schema.json b/addons-cluster/redis/values.schema.json index 0172b5495..ee92b56b4 100644 --- a/addons-cluster/redis/values.schema.json +++ b/addons-cluster/redis/values.schema.json @@ -38,7 +38,8 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, - "multipleOf": 0.5 + "multipleOf": 0.5, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "memory": { "title": "Memory(Gi)", @@ -49,7 +50,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -60,12 +62,14 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", "description": "Storage class name of the data volume", - "type": "string" + "type": "string", + "default": "" }, "nodePortEnabled": { "type": "boolean", @@ -114,7 +118,7 @@ "replicas": { "description": "twemproxy component replicas", "title": "twemproxy replicas", - "type": "number", + "type": "integer", "default": 3, "minimum": 1, "maximum": 5 @@ -171,7 +175,8 @@ "type": "number", "default": 20, "minimum": 1, - "maximum": 1024 + "maximum": 1024, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "description": "Sentinel component storage class name", @@ -182,7 +187,7 @@ "replicas": { "description": "Sentinel component replicas", "title": "sentinel replicas", - "type": "number", + "type": "integer", "default": 3, "minimum": 1, "maximum": 5 @@ -196,10 +201,11 @@ "shardCount": { "description": "The number of shards in the redis cluster", "title": "shardCount", - "type": "number", + "type": "integer", "default": 3, "minimum": 3, - "maximum": 2048 + "maximum": 2048, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "customSecretName": { "title": "the secret name for Redis Cluster default user's password", diff --git a/addons-cluster/redis/values.yaml b/addons-cluster/redis/values.yaml index 43ea9acaf..2ac5ae4ca 100644 --- a/addons-cluster/redis/values.yaml +++ b/addons-cluster/redis/values.yaml @@ -37,6 +37,7 @@ requests: ## @param storage size, the unit is Gi ## storage: 20 +storageClassName: "" # custom password of default user for redis by passing a secret # the secret must contain keys named 'username' and 'password' @@ -97,6 +98,7 @@ redisCluster: customSecretNamespace: "" extra: + terminationPolicy: Delete disableExporter: true prometheus: diff --git a/addons-cluster/risingwave/tests/fail/compactor-replicas-too-low.yaml b/addons-cluster/risingwave/tests/fail/compactor-replicas-too-low.yaml new file mode 100644 index 000000000..df043ade8 --- /dev/null +++ b/addons-cluster/risingwave/tests/fail/compactor-replicas-too-low.yaml @@ -0,0 +1,3 @@ +risingwave: + compactor: + replicas: 0 diff --git a/addons-cluster/risingwave/tests/fail/compute-replicas-too-low.yaml b/addons-cluster/risingwave/tests/fail/compute-replicas-too-low.yaml new file mode 100644 index 000000000..fcc333fa5 --- /dev/null +++ b/addons-cluster/risingwave/tests/fail/compute-replicas-too-low.yaml @@ -0,0 +1,3 @@ +risingwave: + compute: + replicas: 0 diff --git a/addons-cluster/risingwave/tests/fail/connector-replicas-too-low.yaml b/addons-cluster/risingwave/tests/fail/connector-replicas-too-low.yaml new file mode 100644 index 000000000..2b96b370f --- /dev/null +++ b/addons-cluster/risingwave/tests/fail/connector-replicas-too-low.yaml @@ -0,0 +1,3 @@ +risingwave: + connector: + replicas: 0 diff --git a/addons-cluster/risingwave/tests/fail/frontend-replicas-too-low.yaml b/addons-cluster/risingwave/tests/fail/frontend-replicas-too-low.yaml new file mode 100644 index 000000000..de88484b5 --- /dev/null +++ b/addons-cluster/risingwave/tests/fail/frontend-replicas-too-low.yaml @@ -0,0 +1,3 @@ +risingwave: + frontend: + replicas: 0 diff --git a/addons-cluster/risingwave/tests/fail/invalid-replicas.yaml b/addons-cluster/risingwave/tests/fail/invalid-replicas.yaml new file mode 100644 index 000000000..1ab17430f --- /dev/null +++ b/addons-cluster/risingwave/tests/fail/invalid-replicas.yaml @@ -0,0 +1,3 @@ +risingwave: + meta: + replicas: "invalid" diff --git a/addons-cluster/risingwave/tests/fail/meta-replicas-too-low.yaml b/addons-cluster/risingwave/tests/fail/meta-replicas-too-low.yaml new file mode 100644 index 000000000..e820750d5 --- /dev/null +++ b/addons-cluster/risingwave/tests/fail/meta-replicas-too-low.yaml @@ -0,0 +1,3 @@ +risingwave: + meta: + replicas: 0 diff --git a/addons-cluster/risingwave/tests/pass/defaults.yaml b/addons-cluster/risingwave/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/risingwave/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/risingwave/tests/pass/ha.yaml b/addons-cluster/risingwave/tests/pass/ha.yaml new file mode 100644 index 000000000..16bf9b008 --- /dev/null +++ b/addons-cluster/risingwave/tests/pass/ha.yaml @@ -0,0 +1,9 @@ +risingwave: + meta: + replicas: 3 + frontend: + replicas: 2 + compute: + replicas: 2 + compactor: + replicas: 2 diff --git a/addons-cluster/risingwave/values.schema.json b/addons-cluster/risingwave/values.schema.json index d01528585..4515d6897 100644 --- a/addons-cluster/risingwave/values.schema.json +++ b/addons-cluster/risingwave/values.schema.json @@ -11,8 +11,10 @@ "type": "object", "properties": { "replicas": { + "title": "Replicas", "type": "integer", "default": 1, + "minimum": 1, "description": "Number of meta replicas." }, "resources": { @@ -28,7 +30,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory request(Gi)", @@ -37,7 +43,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -51,7 +60,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory limit(Gi)", @@ -60,7 +73,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -72,8 +88,10 @@ "type": "object", "properties": { "replicas": { + "title": "Replicas", "type": "integer", "default": 1, + "minimum": 1, "description": "Number of frontend replicas." }, "resources": { @@ -89,7 +107,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory request(Gi)", @@ -98,7 +120,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -112,7 +137,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory limit(Gi)", @@ -121,7 +150,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -133,8 +165,10 @@ "type": "object", "properties": { "replicas": { + "title": "Replicas", "type": "integer", "default": 1, + "minimum": 1, "description": "Number of compute replicas." }, "resources": { @@ -150,7 +184,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory request(Gi)", @@ -159,7 +197,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -173,7 +214,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory limit(Gi)", @@ -182,7 +227,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -194,8 +242,10 @@ "type": "object", "properties": { "replicas": { + "title": "Replicas", "type": "integer", "default": 1, + "minimum": 1, "description": "Number of compactor replicas." }, "resources": { @@ -211,7 +261,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory request(Gi)", @@ -220,7 +274,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -234,7 +291,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory limit(Gi)", @@ -243,7 +304,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -255,8 +319,10 @@ "type": "object", "properties": { "replicas": { + "title": "Replicas", "type": "integer", "default": 1, + "minimum": 1, "description": "Number of connector replicas." }, "resources": { @@ -272,7 +338,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory request(Gi)", @@ -281,7 +351,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -295,7 +368,11 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory limit(Gi)", @@ -304,7 +381,10 @@ "number", "string" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -319,6 +399,7 @@ "type": "object", "properties": { "endpoints": { + "title": "Endpoints", "type": "string", "default": "REPLACE-WITH-YOUR-ETCD-ENDPOINT:2379", "description": "etcd endpoint." @@ -327,16 +408,19 @@ "type": "object", "properties": { "enabled": { + "title": "Enabled", "type": "boolean", "default": false, "description": "Enable authentication or not." }, "username": { + "title": "Username", "type": "string", "default": "", "description": "etcd username. Leave it empty for no authentication." }, "password": { + "title": "Password", "type": "string", "default": "", "description": "etcd password. Leave it empty for no authentication." @@ -351,6 +435,7 @@ "type": "object", "properties": { "dataDirectory": { + "title": "Data Directory", "type": "string", "default": "risingwave", "description": "data directory." @@ -359,16 +444,20 @@ "type": "object", "properties": { "endpoint": { + "title": "Endpoint", "type": "string", "default": "https://s3.REPLACE-WITH-YOUR-REGION.amazonaws.com.cn", "description": "Endpoint for S3 compatible services. Leave it empty for standard AWS S3." }, "region": { + "title": "Region", "type": "string", "default": "REPLACE-WITH-YOUR-REGION", "description": "Region of S3 bucket." + }, "bucket": { + "title": "Bucket", "type": "string", "default": "REPLACE-WITH-YOUR-BUCKET", "description": "S3 bucket name." @@ -377,16 +466,19 @@ "type": "object", "properties": { "serviceAccountName": { + "title": "Service Account Name", "type": "string", "default": "", "description": "Use IAM role on service account for authentication. If set, accessKey and secretAccessKey will be ignored." }, "accessKey": { + "title": "Access Key", "type": "string", "default": "REPLACE-WITH-YOUR-AK", "description": "S3 access key." }, "secretAccessKey": { + "title": "Secret Access Key", "type": "string", "default": "REPLACE-WITH-YOUR-SK", "description": "S3 secret access key." diff --git a/addons-cluster/starrocks-ce/tests/fail/be-replicas-too-high.yaml b/addons-cluster/starrocks-ce/tests/fail/be-replicas-too-high.yaml new file mode 100644 index 000000000..b98b52d8d --- /dev/null +++ b/addons-cluster/starrocks-ce/tests/fail/be-replicas-too-high.yaml @@ -0,0 +1,2 @@ +be: + replicas: 6 diff --git a/addons-cluster/starrocks-ce/tests/fail/be-replicas-too-low.yaml b/addons-cluster/starrocks-ce/tests/fail/be-replicas-too-low.yaml new file mode 100644 index 000000000..b1177be2e --- /dev/null +++ b/addons-cluster/starrocks-ce/tests/fail/be-replicas-too-low.yaml @@ -0,0 +1,2 @@ +be: + replicas: 0 diff --git a/addons-cluster/starrocks-ce/tests/fail/fe-replicas-too-high.yaml b/addons-cluster/starrocks-ce/tests/fail/fe-replicas-too-high.yaml new file mode 100644 index 000000000..3dce2105e --- /dev/null +++ b/addons-cluster/starrocks-ce/tests/fail/fe-replicas-too-high.yaml @@ -0,0 +1,2 @@ +fe: + replicas: 6 diff --git a/addons-cluster/starrocks-ce/tests/fail/fe-replicas-too-low.yaml b/addons-cluster/starrocks-ce/tests/fail/fe-replicas-too-low.yaml new file mode 100644 index 000000000..ed9bf528c --- /dev/null +++ b/addons-cluster/starrocks-ce/tests/fail/fe-replicas-too-low.yaml @@ -0,0 +1,2 @@ +fe: + replicas: 0 diff --git a/addons-cluster/starrocks-ce/tests/pass/defaults.yaml b/addons-cluster/starrocks-ce/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/starrocks-ce/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/starrocks-ce/tests/pass/ha.yaml b/addons-cluster/starrocks-ce/tests/pass/ha.yaml new file mode 100644 index 000000000..d7e38a684 --- /dev/null +++ b/addons-cluster/starrocks-ce/tests/pass/ha.yaml @@ -0,0 +1,4 @@ +fe: + replicas: 3 +be: + replicas: 3 diff --git a/addons-cluster/starrocks-ce/tests/pass/max-replicas.yaml b/addons-cluster/starrocks-ce/tests/pass/max-replicas.yaml new file mode 100644 index 000000000..a88b73759 --- /dev/null +++ b/addons-cluster/starrocks-ce/tests/pass/max-replicas.yaml @@ -0,0 +1,4 @@ +fe: + replicas: 5 +be: + replicas: 5 diff --git a/addons-cluster/starrocks-ce/values.schema.json b/addons-cluster/starrocks-ce/values.schema.json index 493bb39e1..aea640483 100644 --- a/addons-cluster/starrocks-ce/values.schema.json +++ b/addons-cluster/starrocks-ce/values.schema.json @@ -29,6 +29,7 @@ "default": 1, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -40,7 +41,8 @@ ], "default": 2, "minimum": 1, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "FE Storage(Gi)", @@ -51,7 +53,8 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", @@ -82,6 +85,7 @@ "default": 1, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -93,7 +97,8 @@ ], "default": 2, "minimum": 1, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "BE Storage(Gi)", @@ -104,7 +109,8 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", diff --git a/addons-cluster/tdengine/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/tdengine/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/tdengine/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/tdengine/tests/fail/cpu-too-high.yaml b/addons-cluster/tdengine/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/tdengine/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/tdengine/tests/fail/cpu-too-low.yaml b/addons-cluster/tdengine/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/tdengine/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/tdengine/tests/fail/invalid-mode.yaml b/addons-cluster/tdengine/tests/fail/invalid-mode.yaml new file mode 100644 index 000000000..fc7b62207 --- /dev/null +++ b/addons-cluster/tdengine/tests/fail/invalid-mode.yaml @@ -0,0 +1 @@ +mode: invalid diff --git a/addons-cluster/tdengine/tests/fail/memory-too-high.yaml b/addons-cluster/tdengine/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/tdengine/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/tdengine/tests/fail/memory-too-low.yaml b/addons-cluster/tdengine/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/tdengine/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/tdengine/tests/fail/replicas-too-high.yaml b/addons-cluster/tdengine/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/tdengine/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/tdengine/tests/fail/replicas-too-low.yaml b/addons-cluster/tdengine/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/tdengine/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/tdengine/tests/fail/storage-too-high.yaml b/addons-cluster/tdengine/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/tdengine/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/tdengine/tests/fail/storage-too-low.yaml b/addons-cluster/tdengine/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/tdengine/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/tdengine/tests/pass/defaults.yaml b/addons-cluster/tdengine/tests/pass/defaults.yaml new file mode 100644 index 000000000..709678ca0 --- /dev/null +++ b/addons-cluster/tdengine/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (mode: raftGroup) diff --git a/addons-cluster/tdengine/tests/pass/max-values.yaml b/addons-cluster/tdengine/tests/pass/max-values.yaml new file mode 100644 index 000000000..83f00ed3c --- /dev/null +++ b/addons-cluster/tdengine/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 5 +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/tdengine/tests/pass/standalone.yaml b/addons-cluster/tdengine/tests/pass/standalone.yaml new file mode 100644 index 000000000..c3dab2b97 --- /dev/null +++ b/addons-cluster/tdengine/tests/pass/standalone.yaml @@ -0,0 +1,2 @@ +mode: standalone +replicas: 1 diff --git a/addons-cluster/tdengine/values.schema.json b/addons-cluster/tdengine/values.schema.json index 10d3b560c..ef60e9a52 100644 --- a/addons-cluster/tdengine/values.schema.json +++ b/addons-cluster/tdengine/values.schema.json @@ -36,6 +36,7 @@ "default": 1, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -47,7 +48,8 @@ ], "default": 1, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -58,12 +60,14 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", "description": "Storage class name of the data volume", - "type": "string" + "type": "string", + "default": "" } } } diff --git a/addons-cluster/tdengine/values.yaml b/addons-cluster/tdengine/values.yaml index d95186394..2a5c827bf 100644 --- a/addons-cluster/tdengine/values.yaml +++ b/addons-cluster/tdengine/values.yaml @@ -32,3 +32,4 @@ requests: ## @param storage size, the unit is Gi ## storage: 10 +storageClassName: "" \ No newline at end of file diff --git a/addons-cluster/tidb/tests/fail/pd-replicas-not-odd.yaml b/addons-cluster/tidb/tests/fail/pd-replicas-not-odd.yaml new file mode 100644 index 000000000..400bb1f8d --- /dev/null +++ b/addons-cluster/tidb/tests/fail/pd-replicas-not-odd.yaml @@ -0,0 +1,2 @@ +pd: + replicas: 2 diff --git a/addons-cluster/tidb/tests/fail/pd-replicas-too-low.yaml b/addons-cluster/tidb/tests/fail/pd-replicas-too-low.yaml new file mode 100644 index 000000000..60f910b46 --- /dev/null +++ b/addons-cluster/tidb/tests/fail/pd-replicas-too-low.yaml @@ -0,0 +1,2 @@ +pd: + replicas: 0 diff --git a/addons-cluster/tidb/tests/fail/tidb-replicas-too-low.yaml b/addons-cluster/tidb/tests/fail/tidb-replicas-too-low.yaml new file mode 100644 index 000000000..c11a1962e --- /dev/null +++ b/addons-cluster/tidb/tests/fail/tidb-replicas-too-low.yaml @@ -0,0 +1,2 @@ +tidb: + replicas: 0 diff --git a/addons-cluster/tidb/tests/fail/tikv-replicas-too-low.yaml b/addons-cluster/tidb/tests/fail/tikv-replicas-too-low.yaml new file mode 100644 index 000000000..b3e7514cf --- /dev/null +++ b/addons-cluster/tidb/tests/fail/tikv-replicas-too-low.yaml @@ -0,0 +1,2 @@ +tikv: + replicas: 0 diff --git a/addons-cluster/tidb/tests/pass/defaults.yaml b/addons-cluster/tidb/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/tidb/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/tidb/tests/pass/scaled.yaml b/addons-cluster/tidb/tests/pass/scaled.yaml new file mode 100644 index 000000000..002721ceb --- /dev/null +++ b/addons-cluster/tidb/tests/pass/scaled.yaml @@ -0,0 +1,6 @@ +pd: + replicas: 5 +tikv: + replicas: 5 +tidb: + replicas: 3 diff --git a/addons-cluster/tidb/values.schema.json b/addons-cluster/tidb/values.schema.json index bdd5289eb..af584a98d 100644 --- a/addons-cluster/tidb/values.schema.json +++ b/addons-cluster/tidb/values.schema.json @@ -7,7 +7,15 @@ "pd": { "type": "object", "properties": { - "replicas": { "type": "integer", "default": 3, "description": "Number of PD replicas." }, + "replicas": { + "type": "integer", + "default": 3, + "description": "Number of PD replicas. Must be an odd number for consensus.", + "minimum": 1, + "not": { + "multipleOf": 2 + } + }, "resources": { "type": "object", "properties": { @@ -21,7 +29,9 @@ "number", "string" ], - "default": 2 + "default": 2, + "minimum": 1, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "memory": { "title": "Memory limit(Gi)", @@ -30,7 +40,9 @@ "number", "string" ], - "default": 8 + "default": 8, + "minimum": 1, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -44,7 +56,9 @@ "number", "string" ], - "default": 2 + "default": 2, + "minimum": 1, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "memory": { "title": "Memory request(Gi)", @@ -53,7 +67,9 @@ "number", "string" ], - "default": 8 + "default": 8, + "minimum": 1, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -68,8 +84,8 @@ "storageClassName": { "title": "Storage Class Name", "description": "Storage class name for persistent volumes.", - "type": "string", - "default": "" + "type": ["string", "null"], + "default": null }, "size": { "title": "Size of persistent volume claim(Gi)", @@ -78,7 +94,10 @@ "number", "string" ], - "default": 20 + "default": 20, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -95,7 +114,12 @@ "tikv": { "type": "object", "properties": { - "replicas": { "type": "integer", "default": 3, "description": "Number of TiKV replicas." }, + "replicas": { + "type": "integer", + "default": 3, + "description": "Number of TiKV replicas. Must be an odd number for consensus.", + "minimum": 1 + }, "resources": { "type": "object", "properties": { @@ -109,7 +133,9 @@ "number", "string" ], - "default": 4 + "default": 4, + "minimum": 1, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "memory": { "title": "Memory limit(Gi)", @@ -118,7 +144,9 @@ "number", "string" ], - "default": 16 + "default": 16, + "minimum": 1, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -132,7 +160,9 @@ "number", "string" ], - "default": 4 + "default": 4, + "minimum": 1, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "memory": { "title": "Memory request(Gi)", @@ -141,7 +171,9 @@ "number", "string" ], - "default": 16 + "default": 16, + "minimum": 1, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -156,8 +188,8 @@ "storageClassName": { "title": "Storage Class Name", "description": "Storage class name for persistent volumes.", - "type": "string", - "default": "" + "type": ["string", "null"], + "default": null }, "size": { "title": "Size of persistent volume claim(Gi)", @@ -166,7 +198,10 @@ "number", "string" ], - "default": 500 + "default": 500, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -186,7 +221,8 @@ "replicas": { "type": "integer", "default": 2, - "description": "Number of TiDB replicas." + "description": "Number of TiDB replicas.", + "minimum": 1 }, "resources": { "type": "object", @@ -201,7 +237,9 @@ "number", "string" ], - "default": 4 + "default": 4, + "minimum": 1, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "memory": { "title": "Memory limit(Gi)", @@ -210,7 +248,9 @@ "number", "string" ], - "default": 16 + "default": 16, + "minimum": 1, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -224,7 +264,9 @@ "number", "string" ], - "default": 4 + "default": 4, + "minimum": 1, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "memory": { "title": "Memory request(Gi)", @@ -233,7 +275,9 @@ "number", "string" ], - "default": 16 + "default": 16, + "minimum": 1, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } diff --git a/addons-cluster/vanilla-postgresql/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/vanilla-postgresql/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/vanilla-postgresql/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/vanilla-postgresql/tests/fail/cpu-too-high.yaml b/addons-cluster/vanilla-postgresql/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/vanilla-postgresql/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/vanilla-postgresql/tests/fail/cpu-too-low.yaml b/addons-cluster/vanilla-postgresql/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/vanilla-postgresql/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/vanilla-postgresql/tests/fail/memory-too-high.yaml b/addons-cluster/vanilla-postgresql/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/vanilla-postgresql/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/vanilla-postgresql/tests/fail/memory-too-low.yaml b/addons-cluster/vanilla-postgresql/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/vanilla-postgresql/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/vanilla-postgresql/tests/fail/replicas-too-high.yaml b/addons-cluster/vanilla-postgresql/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/vanilla-postgresql/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/vanilla-postgresql/tests/fail/replicas-too-low.yaml b/addons-cluster/vanilla-postgresql/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/vanilla-postgresql/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/vanilla-postgresql/tests/fail/storage-too-high.yaml b/addons-cluster/vanilla-postgresql/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/vanilla-postgresql/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/vanilla-postgresql/tests/fail/storage-too-low.yaml b/addons-cluster/vanilla-postgresql/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/vanilla-postgresql/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/vanilla-postgresql/tests/pass/defaults.yaml b/addons-cluster/vanilla-postgresql/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/vanilla-postgresql/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/vanilla-postgresql/tests/pass/max-values.yaml b/addons-cluster/vanilla-postgresql/tests/pass/max-values.yaml new file mode 100644 index 000000000..83f00ed3c --- /dev/null +++ b/addons-cluster/vanilla-postgresql/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 5 +cpu: 64 +memory: 1000 +storage: 10000 diff --git a/addons-cluster/vanilla-postgresql/tests/pass/replicas-3.yaml b/addons-cluster/vanilla-postgresql/tests/pass/replicas-3.yaml new file mode 100644 index 000000000..71ffd9f27 --- /dev/null +++ b/addons-cluster/vanilla-postgresql/tests/pass/replicas-3.yaml @@ -0,0 +1 @@ +replicas: 3 diff --git a/addons-cluster/vanilla-postgresql/values.schema.json b/addons-cluster/vanilla-postgresql/values.schema.json index 2b707d154..64152bb3c 100644 --- a/addons-cluster/vanilla-postgresql/values.schema.json +++ b/addons-cluster/vanilla-postgresql/values.schema.json @@ -26,6 +26,7 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -37,7 +38,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -48,12 +50,14 @@ ], "default": 20, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", "description": "Storage class name of the data volume", - "type": "string" + "type": "string", + "default": "" } } } diff --git a/addons-cluster/vanilla-postgresql/values.yaml b/addons-cluster/vanilla-postgresql/values.yaml index 0c5bb68e9..a700f9da4 100644 --- a/addons-cluster/vanilla-postgresql/values.yaml +++ b/addons-cluster/vanilla-postgresql/values.yaml @@ -28,3 +28,4 @@ requests: ## @param storage size, the unit is Gi ## storage: 20 +storageClassName: "" \ No newline at end of file diff --git a/addons-cluster/victoria-metrics/tests/fail/invalid-replicas.yaml b/addons-cluster/victoria-metrics/tests/fail/invalid-replicas.yaml new file mode 100644 index 000000000..e2b2f9773 --- /dev/null +++ b/addons-cluster/victoria-metrics/tests/fail/invalid-replicas.yaml @@ -0,0 +1,2 @@ +vminsert: + replicas: "invalid" diff --git a/addons-cluster/victoria-metrics/tests/fail/invalid-storage.yaml b/addons-cluster/victoria-metrics/tests/fail/invalid-storage.yaml new file mode 100644 index 000000000..74c804bf0 --- /dev/null +++ b/addons-cluster/victoria-metrics/tests/fail/invalid-storage.yaml @@ -0,0 +1,2 @@ +vmstorage: + storage: "invalid" diff --git a/addons-cluster/victoria-metrics/tests/fail/vminsert-replicas-too-high.yaml b/addons-cluster/victoria-metrics/tests/fail/vminsert-replicas-too-high.yaml new file mode 100644 index 000000000..07d9f2187 --- /dev/null +++ b/addons-cluster/victoria-metrics/tests/fail/vminsert-replicas-too-high.yaml @@ -0,0 +1,2 @@ +vminsert: + replicas: 6 diff --git a/addons-cluster/victoria-metrics/tests/fail/vminsert-replicas-too-low.yaml b/addons-cluster/victoria-metrics/tests/fail/vminsert-replicas-too-low.yaml new file mode 100644 index 000000000..099c2cc8b --- /dev/null +++ b/addons-cluster/victoria-metrics/tests/fail/vminsert-replicas-too-low.yaml @@ -0,0 +1,2 @@ +vminsert: + replicas: 0 diff --git a/addons-cluster/victoria-metrics/tests/fail/vmselect-replicas-too-high.yaml b/addons-cluster/victoria-metrics/tests/fail/vmselect-replicas-too-high.yaml new file mode 100644 index 000000000..713740961 --- /dev/null +++ b/addons-cluster/victoria-metrics/tests/fail/vmselect-replicas-too-high.yaml @@ -0,0 +1,2 @@ +vmselect: + replicas: 6 diff --git a/addons-cluster/victoria-metrics/tests/fail/vmselect-replicas-too-low.yaml b/addons-cluster/victoria-metrics/tests/fail/vmselect-replicas-too-low.yaml new file mode 100644 index 000000000..092006f1a --- /dev/null +++ b/addons-cluster/victoria-metrics/tests/fail/vmselect-replicas-too-low.yaml @@ -0,0 +1,2 @@ +vmselect: + replicas: 0 diff --git a/addons-cluster/victoria-metrics/tests/fail/vmstorage-replicas-too-high.yaml b/addons-cluster/victoria-metrics/tests/fail/vmstorage-replicas-too-high.yaml new file mode 100644 index 000000000..bdd8200fa --- /dev/null +++ b/addons-cluster/victoria-metrics/tests/fail/vmstorage-replicas-too-high.yaml @@ -0,0 +1,2 @@ +vmstorage: + replicas: 6 diff --git a/addons-cluster/victoria-metrics/tests/fail/vmstorage-replicas-too-low.yaml b/addons-cluster/victoria-metrics/tests/fail/vmstorage-replicas-too-low.yaml new file mode 100644 index 000000000..ac57f4d5f --- /dev/null +++ b/addons-cluster/victoria-metrics/tests/fail/vmstorage-replicas-too-low.yaml @@ -0,0 +1,2 @@ +vmstorage: + replicas: 0 diff --git a/addons-cluster/victoria-metrics/tests/pass/defaults.yaml b/addons-cluster/victoria-metrics/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/victoria-metrics/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/victoria-metrics/tests/pass/ha.yaml b/addons-cluster/victoria-metrics/tests/pass/ha.yaml new file mode 100644 index 000000000..d388a1990 --- /dev/null +++ b/addons-cluster/victoria-metrics/tests/pass/ha.yaml @@ -0,0 +1,6 @@ +vminsert: + replicas: 3 +vmselect: + replicas: 3 +vmstorage: + replicas: 3 diff --git a/addons-cluster/victoria-metrics/tests/pass/termination-policy-wipeout.yaml b/addons-cluster/victoria-metrics/tests/pass/termination-policy-wipeout.yaml new file mode 100644 index 000000000..b69b320fa --- /dev/null +++ b/addons-cluster/victoria-metrics/tests/pass/termination-policy-wipeout.yaml @@ -0,0 +1 @@ +terminationPolicy: WipeOut diff --git a/addons-cluster/victoria-metrics/values.schema.json b/addons-cluster/victoria-metrics/values.schema.json index 59e6da484..fc0ae199d 100644 --- a/addons-cluster/victoria-metrics/values.schema.json +++ b/addons-cluster/victoria-metrics/values.schema.json @@ -14,27 +14,13 @@ "type": "string", "default": "" }, - "terminationPolicy": { - "title": "TerminationPolicy", - "description": "The policy of termination.", - "type": "string", - "default": "Delete", - "enum": [ - "Delete", - "DoNotTerminate", - "WipeOut" - ] - }, "vminsert": { "type": "object", "properties": { "replicas": { "title": "Replicas for vminsert", "description": "The number of replicas for vminsert component.", - "type": [ - "number", - "string" - ], + "type": "integer", "default": 1, "minimum": 1, "maximum": 5 @@ -54,7 +40,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "cpu": { "title": "CPU for vminsert", @@ -66,7 +53,8 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, - "multipleOf": 0.5 + "multipleOf": 0.5, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -82,7 +70,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "cpu": { "title": "CPU for vminsert", @@ -94,7 +83,8 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, - "multipleOf": 0.5 + "multipleOf": 0.5, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -108,10 +98,7 @@ "replicas": { "title": "Replicas for vmselect", "description": "The number of replicas for vmselect component.", - "type": [ - "number", - "string" - ], + "type": "integer", "default": 1, "minimum": 1, "maximum": 5 @@ -131,7 +118,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "cpu": { "title": "CPU for vmselect", @@ -143,7 +131,8 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, - "multipleOf": 0.5 + "multipleOf": 0.5, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -159,7 +148,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "cpu": { "title": "CPU for vmselect", @@ -171,7 +161,8 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, - "multipleOf": 0.5 + "multipleOf": 0.5, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -185,10 +176,7 @@ "replicas": { "title": "Replicas for vmstorage", "description": "The number of replicas for vmstorage component.", - "type": [ - "number", - "string" - ], + "type": "integer", "default": 1, "minimum": 1, "maximum": 5 @@ -208,7 +196,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "cpu": { "title": "CPU for vmstorage", @@ -220,7 +209,8 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, - "multipleOf": 0.5 + "multipleOf": 0.5, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } }, @@ -236,7 +226,8 @@ ], "default": 0.5, "minimum": 0.5, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "cpu": { "title": "CPU for vmstorage", @@ -248,7 +239,8 @@ "default": 0.5, "minimum": 0.5, "maximum": 64, - "multipleOf": 0.5 + "multipleOf": 0.5, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } @@ -257,8 +249,8 @@ "storageClassName": { "title": "Storage Class Name", "description": "Storage class name for persistent volumes.", - "type": "string", - "default": "" + "type": ["string", "null"], + "default": null }, "storage": { "title": "Storage(Gi)", @@ -269,7 +261,8 @@ ], "default": 10, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } diff --git a/addons-cluster/weaviate/templates/cluster.yaml b/addons-cluster/weaviate/templates/cluster.yaml index 19305fb77..8e6adbb8c 100644 --- a/addons-cluster/weaviate/templates/cluster.yaml +++ b/addons-cluster/weaviate/templates/cluster.yaml @@ -5,7 +5,7 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{ include "weaviate.labels" . | nindent 4 }} spec: - terminationPolicy: {{ .Values.terminationPolicy }} + terminationPolicy: {{ .Values.extra.terminationPolicy }} componentSpecs: - name: weaviate componentDef: weaviate diff --git a/addons-cluster/weaviate/tests/fail/invalid-replicas.yaml b/addons-cluster/weaviate/tests/fail/invalid-replicas.yaml new file mode 100644 index 000000000..d294b81dd --- /dev/null +++ b/addons-cluster/weaviate/tests/fail/invalid-replicas.yaml @@ -0,0 +1 @@ +replicaCount: "invalid" diff --git a/addons-cluster/weaviate/tests/fail/invalid-storage.yaml b/addons-cluster/weaviate/tests/fail/invalid-storage.yaml new file mode 100644 index 000000000..c15ce2d19 --- /dev/null +++ b/addons-cluster/weaviate/tests/fail/invalid-storage.yaml @@ -0,0 +1,3 @@ +persistence: + data: + size: "invalid" diff --git a/addons-cluster/weaviate/tests/fail/replicas-too-low.yaml b/addons-cluster/weaviate/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..87e7aef9a --- /dev/null +++ b/addons-cluster/weaviate/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicaCount: 0 diff --git a/addons-cluster/weaviate/tests/pass/defaults.yaml b/addons-cluster/weaviate/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/weaviate/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/weaviate/tests/pass/no-persistence.yaml b/addons-cluster/weaviate/tests/pass/no-persistence.yaml new file mode 100644 index 000000000..4d6af8b22 --- /dev/null +++ b/addons-cluster/weaviate/tests/pass/no-persistence.yaml @@ -0,0 +1,2 @@ +persistence: + enabled: false diff --git a/addons-cluster/weaviate/tests/pass/replicas-3.yaml b/addons-cluster/weaviate/tests/pass/replicas-3.yaml new file mode 100644 index 000000000..6bc803e90 --- /dev/null +++ b/addons-cluster/weaviate/tests/pass/replicas-3.yaml @@ -0,0 +1 @@ +replicaCount: 3 diff --git a/addons-cluster/weaviate/values.schema.json b/addons-cluster/weaviate/values.schema.json index f4b8f1959..c61d335df 100644 --- a/addons-cluster/weaviate/values.schema.json +++ b/addons-cluster/weaviate/values.schema.json @@ -18,7 +18,11 @@ "string", "number" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory limit(Gi)", @@ -27,7 +31,11 @@ "string", "number" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } }, @@ -41,7 +49,11 @@ "string", "number" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "memory": { "title": "Memory request(Gi)", @@ -50,7 +62,11 @@ "string", "number" ], - "default": 1 + "default": 1, + "minimum": 0.5, + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 } } } @@ -70,8 +86,8 @@ "storageClassName": { "title": "Storage Class Name", "description": "Storage class name for persistent volumes.", - "type":"string", - "default": "" + "type": ["string", "null"], + "default": null }, "size": { "title": "Size of persistent volume claim(Gi)", @@ -80,7 +96,10 @@ "number", "string" ], - "default": 10 + "default": 10, + "minimum": 1, + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" } } } diff --git a/addons-cluster/weaviate/values.yaml b/addons-cluster/weaviate/values.yaml index 803f2ed8e..17bf0eb25 100644 --- a/addons-cluster/weaviate/values.yaml +++ b/addons-cluster/weaviate/values.yaml @@ -4,7 +4,8 @@ replicaCount: 1 -terminationPolicy: Delete +extra: + terminationPolicy: Delete nameOverride: "" diff --git a/addons-cluster/xinference/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/xinference/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/xinference/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/xinference/tests/fail/cpu-too-high.yaml b/addons-cluster/xinference/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/xinference/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/xinference/tests/fail/gpu-not-multiple-of.yaml b/addons-cluster/xinference/tests/fail/gpu-not-multiple-of.yaml new file mode 100644 index 000000000..beac6628b --- /dev/null +++ b/addons-cluster/xinference/tests/fail/gpu-not-multiple-of.yaml @@ -0,0 +1 @@ +gpu: 1.5 diff --git a/addons-cluster/xinference/tests/fail/gpu-too-high.yaml b/addons-cluster/xinference/tests/fail/gpu-too-high.yaml new file mode 100644 index 000000000..48ab454ec --- /dev/null +++ b/addons-cluster/xinference/tests/fail/gpu-too-high.yaml @@ -0,0 +1 @@ +gpu: 65 diff --git a/addons-cluster/xinference/tests/fail/memory-too-high.yaml b/addons-cluster/xinference/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/xinference/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/xinference/tests/fail/replicas-too-high.yaml b/addons-cluster/xinference/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/xinference/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/xinference/tests/fail/replicas-too-low.yaml b/addons-cluster/xinference/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/xinference/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/xinference/tests/pass/cpu-mode.yaml b/addons-cluster/xinference/tests/pass/cpu-mode.yaml new file mode 100644 index 000000000..c0ba3fb18 --- /dev/null +++ b/addons-cluster/xinference/tests/pass/cpu-mode.yaml @@ -0,0 +1 @@ +cpuMode: true diff --git a/addons-cluster/xinference/tests/pass/defaults.yaml b/addons-cluster/xinference/tests/pass/defaults.yaml new file mode 100644 index 000000000..d13e19e34 --- /dev/null +++ b/addons-cluster/xinference/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values (cpuMode: false) diff --git a/addons-cluster/xinference/tests/pass/max-values.yaml b/addons-cluster/xinference/tests/pass/max-values.yaml new file mode 100644 index 000000000..c31987a9e --- /dev/null +++ b/addons-cluster/xinference/tests/pass/max-values.yaml @@ -0,0 +1,4 @@ +replicas: 5 +cpu: 64 +memory: 1000 +gpu: 64 diff --git a/addons-cluster/xinference/values.schema.json b/addons-cluster/xinference/values.schema.json index 5f271090d..b3f2c7e5a 100644 --- a/addons-cluster/xinference/values.schema.json +++ b/addons-cluster/xinference/values.schema.json @@ -26,6 +26,7 @@ "default": 0, "minimum": 0, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -37,7 +38,8 @@ ], "default": 0, "minimum": 0, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "gpu": { "title": "GPU", @@ -49,6 +51,7 @@ "default": 1, "minimum": 0, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 1 } } diff --git a/addons-cluster/yashandb/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/yashandb/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..26017a5c0 --- /dev/null +++ b/addons-cluster/yashandb/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.6 diff --git a/addons-cluster/yashandb/tests/fail/cpu-too-high.yaml b/addons-cluster/yashandb/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/yashandb/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/yashandb/tests/fail/cpu-too-low.yaml b/addons-cluster/yashandb/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..c78ac689f --- /dev/null +++ b/addons-cluster/yashandb/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.1 diff --git a/addons-cluster/yashandb/tests/fail/memory-too-high.yaml b/addons-cluster/yashandb/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..f8914e93d --- /dev/null +++ b/addons-cluster/yashandb/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 129 diff --git a/addons-cluster/yashandb/tests/fail/memory-too-low.yaml b/addons-cluster/yashandb/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..6cb54b7d6 --- /dev/null +++ b/addons-cluster/yashandb/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.1 diff --git a/addons-cluster/yashandb/tests/fail/replicas-too-high.yaml b/addons-cluster/yashandb/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..eb5c26739 --- /dev/null +++ b/addons-cluster/yashandb/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 2 diff --git a/addons-cluster/yashandb/tests/fail/replicas-too-low.yaml b/addons-cluster/yashandb/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/yashandb/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/yashandb/tests/fail/storage-too-high.yaml b/addons-cluster/yashandb/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..eb14a23d1 --- /dev/null +++ b/addons-cluster/yashandb/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 501 diff --git a/addons-cluster/yashandb/tests/fail/storage-too-low.yaml b/addons-cluster/yashandb/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/yashandb/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/yashandb/tests/pass/defaults.yaml b/addons-cluster/yashandb/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/yashandb/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/yashandb/tests/pass/max-values.yaml b/addons-cluster/yashandb/tests/pass/max-values.yaml new file mode 100644 index 000000000..7436a7346 --- /dev/null +++ b/addons-cluster/yashandb/tests/pass/max-values.yaml @@ -0,0 +1,3 @@ +cpu: 64 +memory: 128 +storage: 500 diff --git a/addons-cluster/yashandb/values.schema.json b/addons-cluster/yashandb/values.schema.json index ac225787d..092c7f5ed 100644 --- a/addons-cluster/yashandb/values.schema.json +++ b/addons-cluster/yashandb/values.schema.json @@ -26,6 +26,7 @@ "default": 1, "minimum": 0.5, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.5 }, "memory": { @@ -37,7 +38,9 @@ ], "default": 1, "minimum": 0.5, - "maximum": 128 + "maximum": 128, + "pattern": "^[0-9]+(\\.[0-9]+)?$", + "multipleOf": 0.5 }, "storage": { "title": "Storage(Gi)", @@ -48,12 +51,14 @@ ], "default": 20, "minimum": 1, - "maximum": 500 + "maximum": 500, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", "description": "Storage class name of the data volume", - "type": "string" + "type": "string", + "default": "" } } } diff --git a/addons-cluster/yashandb/values.yaml b/addons-cluster/yashandb/values.yaml index 3b3f78f61..7ba8208aa 100644 --- a/addons-cluster/yashandb/values.yaml +++ b/addons-cluster/yashandb/values.yaml @@ -16,4 +16,5 @@ memory: 1 ## @param storage size, the unit is Gi ## -storage: 20 \ No newline at end of file +storage: 20 +storageClassName: "" \ No newline at end of file diff --git a/addons-cluster/zookeeper/tests/fail/cpu-not-multiple-of.yaml b/addons-cluster/zookeeper/tests/fail/cpu-not-multiple-of.yaml new file mode 100644 index 000000000..133a57404 --- /dev/null +++ b/addons-cluster/zookeeper/tests/fail/cpu-not-multiple-of.yaml @@ -0,0 +1 @@ +cpu: 0.15 diff --git a/addons-cluster/zookeeper/tests/fail/cpu-too-high.yaml b/addons-cluster/zookeeper/tests/fail/cpu-too-high.yaml new file mode 100644 index 000000000..8fccc9307 --- /dev/null +++ b/addons-cluster/zookeeper/tests/fail/cpu-too-high.yaml @@ -0,0 +1 @@ +cpu: 65 diff --git a/addons-cluster/zookeeper/tests/fail/cpu-too-low.yaml b/addons-cluster/zookeeper/tests/fail/cpu-too-low.yaml new file mode 100644 index 000000000..d5484a62d --- /dev/null +++ b/addons-cluster/zookeeper/tests/fail/cpu-too-low.yaml @@ -0,0 +1 @@ +cpu: 0.05 diff --git a/addons-cluster/zookeeper/tests/fail/log-storage-too-high.yaml b/addons-cluster/zookeeper/tests/fail/log-storage-too-high.yaml new file mode 100644 index 000000000..d69a6d9f7 --- /dev/null +++ b/addons-cluster/zookeeper/tests/fail/log-storage-too-high.yaml @@ -0,0 +1 @@ +logStorage: 10001 diff --git a/addons-cluster/zookeeper/tests/fail/log-storage-too-low.yaml b/addons-cluster/zookeeper/tests/fail/log-storage-too-low.yaml new file mode 100644 index 000000000..a27607f3c --- /dev/null +++ b/addons-cluster/zookeeper/tests/fail/log-storage-too-low.yaml @@ -0,0 +1 @@ +logStorage: 0 diff --git a/addons-cluster/zookeeper/tests/fail/memory-too-high.yaml b/addons-cluster/zookeeper/tests/fail/memory-too-high.yaml new file mode 100644 index 000000000..3e9a5f24d --- /dev/null +++ b/addons-cluster/zookeeper/tests/fail/memory-too-high.yaml @@ -0,0 +1 @@ +memory: 1001 diff --git a/addons-cluster/zookeeper/tests/fail/memory-too-low.yaml b/addons-cluster/zookeeper/tests/fail/memory-too-low.yaml new file mode 100644 index 000000000..59428faa8 --- /dev/null +++ b/addons-cluster/zookeeper/tests/fail/memory-too-low.yaml @@ -0,0 +1 @@ +memory: 0.05 diff --git a/addons-cluster/zookeeper/tests/fail/replicas-too-high.yaml b/addons-cluster/zookeeper/tests/fail/replicas-too-high.yaml new file mode 100644 index 000000000..9355acb37 --- /dev/null +++ b/addons-cluster/zookeeper/tests/fail/replicas-too-high.yaml @@ -0,0 +1 @@ +replicas: 6 diff --git a/addons-cluster/zookeeper/tests/fail/replicas-too-low.yaml b/addons-cluster/zookeeper/tests/fail/replicas-too-low.yaml new file mode 100644 index 000000000..b9b76219a --- /dev/null +++ b/addons-cluster/zookeeper/tests/fail/replicas-too-low.yaml @@ -0,0 +1 @@ +replicas: 0 diff --git a/addons-cluster/zookeeper/tests/fail/storage-too-high.yaml b/addons-cluster/zookeeper/tests/fail/storage-too-high.yaml new file mode 100644 index 000000000..31c6d4dc7 --- /dev/null +++ b/addons-cluster/zookeeper/tests/fail/storage-too-high.yaml @@ -0,0 +1 @@ +storage: 10001 diff --git a/addons-cluster/zookeeper/tests/fail/storage-too-low.yaml b/addons-cluster/zookeeper/tests/fail/storage-too-low.yaml new file mode 100644 index 000000000..57504f029 --- /dev/null +++ b/addons-cluster/zookeeper/tests/fail/storage-too-low.yaml @@ -0,0 +1 @@ +storage: 0 diff --git a/addons-cluster/zookeeper/tests/pass/defaults.yaml b/addons-cluster/zookeeper/tests/pass/defaults.yaml new file mode 100644 index 000000000..feb75a4e5 --- /dev/null +++ b/addons-cluster/zookeeper/tests/pass/defaults.yaml @@ -0,0 +1 @@ +# Test default values diff --git a/addons-cluster/zookeeper/tests/pass/max-values.yaml b/addons-cluster/zookeeper/tests/pass/max-values.yaml new file mode 100644 index 000000000..ad183488b --- /dev/null +++ b/addons-cluster/zookeeper/tests/pass/max-values.yaml @@ -0,0 +1,5 @@ +replicas: 5 +cpu: 64 +memory: 1000 +storage: 10000 +logStorage: 10000 diff --git a/addons-cluster/zookeeper/tests/pass/replicas-5.yaml b/addons-cluster/zookeeper/tests/pass/replicas-5.yaml new file mode 100644 index 000000000..fd99c27e3 --- /dev/null +++ b/addons-cluster/zookeeper/tests/pass/replicas-5.yaml @@ -0,0 +1 @@ +replicas: 5 diff --git a/addons-cluster/zookeeper/values.schema.json b/addons-cluster/zookeeper/values.schema.json index 38a11a8c8..d8d668a00 100644 --- a/addons-cluster/zookeeper/values.schema.json +++ b/addons-cluster/zookeeper/values.schema.json @@ -33,6 +33,7 @@ "default": 0.5, "minimum": 0.1, "maximum": 64, + "pattern": "^[0-9]+(\\.[0-9]+)?$", "multipleOf": 0.1 }, "memory": { @@ -44,7 +45,8 @@ ], "default": 0.5, "minimum": 0.1, - "maximum": 1000 + "maximum": 1000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storage": { "title": "Storage(Gi)", @@ -55,7 +57,8 @@ ], "default": 10, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "logStorage": { "title": "LogStorage(Gi)", @@ -66,12 +69,14 @@ ], "default": 2, "minimum": 1, - "maximum": 10000 + "maximum": 10000, + "pattern": "^[0-9]+(\\.[0-9]+)?$" }, "storageClassName": { "title": "Storage Class Name", "description": "Storage class name of the data volume", - "type": "string" + "type": "string", + "default": "" } } } diff --git a/addons-cluster/zookeeper/values.yaml b/addons-cluster/zookeeper/values.yaml index f89fe5405..de272eff8 100644 --- a/addons-cluster/zookeeper/values.yaml +++ b/addons-cluster/zookeeper/values.yaml @@ -30,6 +30,7 @@ memory: 2 ## @param storage, the unit is Gi storage: 10 +storageClassName: "" ## @param log storage, the unit is Gi logStorage: 2 diff --git a/addons/apecloud-mysql/values.schema.json b/addons/apecloud-mysql/values.schema.json deleted file mode 100644 index 4b372d4c3..000000000 --- a/addons/apecloud-mysql/values.schema.json +++ /dev/null @@ -1,499 +0,0 @@ -{ - "$schema": "https://json-schema.org/schema#", - "type": "object", - "properties": { - "image": { - "title": "Image", - "description": "Image.", - "type": "object", - "default": { - "image": { - "registry": "", - "repository": "apecloud/apecloud-mysql-server", - "pullPolicy": "IfNotPresent", - "tag": "8.0.30-5.beta2.20230830.g4ca1eb8.13" - } - }, - "properties": { - "registry": { - "title": "Registry", - "description": "Registry to download the image.", - "type": "string", - "default": "" - }, - "repository": { - "title": "Repository.", - "description": "Image repository under the registry", - "type": "string", - "default": "apecloud/apecloud-mysql-server" - }, - "pullPolicy": { - "title": "PullPolicy", - "description": "Image pull policy.", - "type": "string", - "default": "IfNotPresent", - "enum": [ - "IfNotPresent", - "Always", - "Never" - ] - }, - "tag": { - "title": "Tag", - "description": "Overrides the image tag whose default is the chart appVersion.", - "type": "string", - "default": "8.0.30-5.beta2.20230830.g4ca1eb8.13" - } - } - }, - "cluster": { - "title": "Cluster", - "description": "MySQL Cluster parameters.", - "type": "object", - "default": { - "clusterId": "1", - "clusterStartIndex": "1", - "replicaSetCount": 3, - "templateConfig": null, - "customConfig": null, - "dynamicConfig": null, - "kbWeSQLImage": "1" - }, - "properties": { - "clusterId": { - "title": "ClusterId", - "description": "CLUSTER_ID", - "type": "string", - "default": "1" - }, - "clusterStartIndex": { - "title": "ClusterStartIndex", - "description": "CLUSTER_START_INDEX", - "type": "string", - "default": "1" - }, - "replicaSetCount": { - "title": "ReplicaSetCount", - "description": "cluster.replicaSetCount.", - "type": "integer", - "default": 3 - }, - "templateConfig": { - "title": "TemplateConfig", - "description": "MYSQL_TEMPLATE_CONFIG.", - "type": [ - "string", - "null" - ], - "default": null - }, - "customConfig": { - "title": "CustomConfig", - "description": "MYSQL_CUSTOM_CONFIG.", - "type": [ - "string", - "null" - ], - "default": null - }, - "dynamicConfig": { - "title": "DynamicConfig", - "description": "MYSQL_DYNAMIC_CONFIG.", - "type": [ - "string", - "null" - ], - "default": null - }, - "kbWeSQLImage": { - "title": "KbWeSQLImage", - "description": "KB_EMBEDDED_WESQL.", - "type": "string", - "default": "1" - } - } - }, - "auth": { - "title": "Auth", - "description": "MySQL Authentication parameters.", - "type": "object", - "default": { - "rootHost": "%", - "createDatabase": true, - "database": "mydb" - }, - "properties": { - "rootHost": { - "title": "RootHost", - "description": "MYSQL_ROOT_HOST.", - "type": "string", - "default": "%" - }, - "createDatabase": { - "title": "CreateDatabase", - "description": "Whether to create the .Values.auth.database or not.", - "type": "boolean", - "default": true - }, - "database": { - "title": "Database", - "description": "Name for a custom database to create.", - "type": "string", - "default": "mydb" - } - } - }, - "nameOverride": { - "title": "NameOverride", - "description": "Override name for K8s object metadata name.", - "type": "string", - "default": "" - }, - "fullnameOverride": { - "title": "FullnameOverride", - "description": "Override fullname for fully qualified app name.", - "type": "string", - "default": "" - }, - "mysqlConfigs": { - "title": "MysqlConfigs", - "description": "Data path configs for MySQL.", - "type": "object", - "default": { - "dataMountPath": "/data/mysql", - "dataDir": "/data/mysql/data", - "logBin": "/data/mysql/binlog/mysql-bin" - }, - "properties": { - "dataMountPath": { - "title": "DataMountPath", - "description": "MySQL data path to mount.", - "type": "string", - "default": "/data/mysql" - }, - "dataDir": { - "title": "DataDir", - "description": "Absolute path of the MySQL data.", - "type": "string", - "default": "/data/mysql/data" - }, - "logBin": { - "title": "LogBin", - "description": "Absolute path for the MySQL binlog.", - "type": "string", - "default": "/data/mysql/binlog/mysql-bin" - } - } - }, - "logConfigs": { - "title": "LogConfigs", - "description": "Log path configs for MySQL.", - "type": "object", - "default": { - "error": "/data/mysql/log/mysqld-error.log", - "slow": "/data/mysql/log/mysqld-slowquery.log", - "general": "/data/mysql/log/mysqld.log" - }, - "properties": { - "error": { - "title": "Error", - "description": "Absolute path for the error log.", - "type": "string", - "default": "/data/mysql/log/mysqld-error.log" - }, - "slow": { - "title": "Slow", - "description": "Absolute path for the slow log.", - "type": "string", - "default": "/data/mysql/log/mysqld-slowquery.log" - }, - "general": { - "title": "General", - "description": "Absolute path for the general log.", - "type": "string", - "default": "/data/mysql/log/mysqld.log" - } - } - }, - "vtgateLogConfigs": { - "title": "VtgateLogConfigs", - "description": "Log path configs for vtgate", - "type": "object", - "default": { - "error": "/vtdataroot/vtgate.ERROR", - "warning": "/vtdataroot/vtgate.WARNING", - "info": "/vtdataroot/vtgate.INFO", - "queryLog": "/vtdataroot/vtgate_querylog.txt" - }, - "properties": { - "error": { - "title": "Error", - "description": "Absolute path for the error log.", - "type": "string", - "default": "/vtdataroot/vtgate.ERROR" - }, - "warning": { - "title": "Warning", - "description": "Absolute path for the warning log.", - "type": "string", - "default": "/vtdataroot/vtgate.WARNING" - }, - "info": { - "title": "Info", - "description": "Absolute path for the info log.", - "type": "string", - "default": "/vtdataroot/vtgate.INFO" - }, - "queryLog": { - "title": "QueryLog", - "description": "Absolute path for the query log.", - "type": "string", - "default": "/vtdataroot/vtgate_querylog.txt" - } - } - }, - "roleProbe": { - "title": "RoleProbe", - "description": "Probe config for MySQL", - "type": "object", - "default": { - "failureThreshold": 2, - "periodSeconds": 1, - "timeoutSeconds": 1 - }, - "properties": { - "failureThreshold": { - "title": "FailureThreshold", - "description": "Number of times to retry before marking this probe as failed.", - "type": "integer", - "default": 2 - }, - "periodSeconds": { - "title": "PeriodSeconds", - "description": "How often (in seconds) to perform the probe.", - "type": "integer", - "default": 1 - }, - "timeoutSeconds": { - "title": "TimeoutSeconds", - "description": "Number of seconds after which the probe times out.", - "type": "integer", - "default": 1 - } - } - }, - "logCollector": { - "title": "LogCollector", - "description": "LogCollector config for MySQL", - "type": "object", - "default": { - "enabled": false - }, - "properties": { - "enabled": { - "title": "Enabled", - "description": "Whether to enable log collector or not.", - "type": "boolean", - "default": false - } - } - }, - "metrics": { - "title": "Metrics", - "description": "Configs for metrics container of MySQL", - "type": "object", - "default": { - "image": { - "registry": "", - "repository": "apecloud/agamotto", - "tag": "0.1.2-beta.1", - "pullPolicy": "IfNotPresent" - }, - "service": { - "port": 9104 - } - }, - "properties": { - "image": { - "title": "Image", - "description": "Image.", - "type": "object", - "default": { - "registry": "", - "repository": "apecloud/agamotto", - "tag": "0.1.2-beta.1", - "pullPolicy": "IfNotPresent" - }, - "properties": { - "registry": { - "title": "Registry", - "description": "Registry to download the image.", - "type": "string", - "default": "" - }, - "repository": { - "title": "Repository.", - "description": "Image repository under the registry", - "type": "string", - "default": "apecloud/agamotto" - }, - "pullPolicy": { - "title": "PullPolicy", - "description": "Image pull policy.", - "type": "string", - "default": "IfNotPresent", - "enum": [ - "IfNotPresent", - "Always", - "Never" - ] - }, - "tag": { - "title": "Tag", - "description": "Image tag.", - "type": "string", - "default": "0.1.2-beta.1" - } - } - }, - "service": { - "title": "Service", - "description": "Service configs for the metrics.", - "type": "object", - "default": { - "port": 9104 - }, - "properties": { - "port": { - "title": "Port", - "description": "Port for the metrics.", - "type": "integer", - "default": 9104 - } - } - } - } - }, - "backupTool": { - "title": "BackupTool", - "description": "Configs for backup tool container of MySQL", - "type": "object", - "default": { - "image": { - "registry": "", - "repository": "apecloud/apecloud-xtrabackup", - "tag": "8.0", - "pullPolicy": "IfNotPresent" - } - }, - "properties": { - "image": { - "title": "Image", - "description": "Image.", - "type": "object", - "default": { - "registry": "", - "repository": "apecloud/apecloud-xtrabackup", - "tag": "8.0", - "pullPolicy": "IfNotPresent" - }, - "properties": { - "registry": { - "title": "Registry", - "description": "Registry to download the image.", - "type": "string", - "default": "" - }, - "repository": { - "title": "Repository.", - "description": "Image repository under the registry", - "type": "string", - "default": "apecloud/apecloud-xtrabackup" - }, - "pullPolicy": { - "title": "PullPolicy", - "description": "Image pull policy.", - "type": "string", - "default": "IfNotPresent", - "enum": [ - "IfNotPresent", - "Always", - "Never" - ] - }, - "tag": { - "title": "Tag", - "description": "Image tag.", - "type": "string", - "default": "8.0" - } - } - } - } - }, - "wesqlscale": { - "title": "Wesqlscale", - "description": "Configs for wesqlscale container of MySQL", - "type": "object", - "default": { - "cell": "zone1", - "image": { - "registry": "", - "repository": "apecloud/apecloud-mysql-scale", - "tag": "0.1.1", - "pullPolicy": "IfNotPresent" - } - }, - "properties": { - "cell": { - "title": "Cell", - "description": "Cell.", - "type": "string", - "default": "zone1" - }, - "image": { - "title": "Image", - "description": "Image.", - "type": "object", - "default": { - "registry": "", - "repository": "apecloud/apecloud-mysql-scale", - "tag": "0.1.1", - "pullPolicy": "IfNotPresent" - }, - "properties": { - "registry": { - "title": "Registry", - "description": "Registry to download the image.", - "type": "string", - "default": "" - }, - "repository": { - "title": "Repository.", - "description": "Image repository under the registry", - "type": "string", - "default": "apecloud/apecloud-mysql-scale" - }, - "pullPolicy": { - "title": "PullPolicy", - "description": "Image pull policy.", - "type": "string", - "default": "IfNotPresent", - "enum": [ - "IfNotPresent", - "Always", - "Never" - ] - }, - "tag": { - "title": "Tag", - "description": "Image tag.", - "type": "string", - "default": "0.1.1" - } - } - } - } - } - } -} \ No newline at end of file diff --git a/addons/zookeeper/values.yaml b/addons/zookeeper/values.yaml index 6b6a16f1a..0f7f435e2 100644 --- a/addons/zookeeper/values.yaml +++ b/addons/zookeeper/values.yaml @@ -36,7 +36,4 @@ metrics: zookeeper: dataDir: /bitnami/zookeeper/data - dataLogDir: /bitnami/zookeeper/log - -extra: - terminationPolicy: Delete \ No newline at end of file + dataLogDir: /bitnami/zookeeper/log \ No newline at end of file diff --git a/hack/test-charts.sh b/hack/test-charts.sh new file mode 100755 index 000000000..afb72c4e8 --- /dev/null +++ b/hack/test-charts.sh @@ -0,0 +1,192 @@ +#!/bin/bash +# +# This script runs template-level unit tests for all Helm charts +# in the addons-cluster directory that have a tests/pass or tests/fail directory. + +set -euo pipefail + +# Color codes +RED='\033[0;31m' +GREEN='\033[0;32m' +NC='\033[0m' # No Color + +SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +PROJECT_ROOT=$(cd "${SCRIPT_DIR}/.." && pwd) +ADDONS_CLUSTER_DIR="${PROJECT_ROOT}/addons-cluster" +FAILURES=0 +TOTAL_TESTS=0 + +# Get folder name from command line argument +FOLDER_TO_TEST=${1:-""} +if [ -n "$FOLDER_TO_TEST" ]; then + if [ ! -d "${ADDONS_CLUSTER_DIR}/${FOLDER_TO_TEST}" ]; then + echo -e "${RED}Error: Folder '${FOLDER_TO_TEST}' not found in ${ADDONS_CLUSTER_DIR}${NC}" + exit 1 + fi +fi + +echo "Starting Helm chart template tests..." +echo "=====================================" + +# Find all chart directories +if [ -n "$FOLDER_TO_TEST" ]; then + chart_dirs=("${ADDONS_CLUSTER_DIR}/${FOLDER_TO_TEST}") +else + chart_dirs=("${ADDONS_CLUSTER_DIR}"/*) +fi + +for chart_dir in "${chart_dirs[@]}"; do + if [ -d "${chart_dir}" ]; then + chart_name=$(basename "${chart_dir}") + pass_dir="${chart_dir}/tests/pass" + fail_dir="${chart_dir}/tests/fail" + chart_yaml="${chart_dir}/Chart.yaml" + + has_pass_tests=false + if [ -d "${pass_dir}" ] && [ -n "$(find "${pass_dir}" -maxdepth 1 -name '*.yaml' -print -quit)" ]; then + has_pass_tests=true + fi + + has_fail_tests=false + if [ -d "${fail_dir}" ] && [ -n "$(find "${fail_dir}" -maxdepth 1 -name '*.yaml' -print -quit)" ]; then + has_fail_tests=true + fi + + if [ "$has_pass_tests" = true ] || [ "$has_fail_tests" = true ]; then + echo -e "\n--- Testing Chart: ${chart_name} ---" + + # 1. Build dependencies if Chart.yaml has them + if [ -f "${chart_yaml}" ] && grep -q "^dependencies:" "${chart_yaml}"; then + echo " - Running helm dependency build..." + if ! helm dependency build "${chart_dir}" --skip-refresh; then + echo -e " ${RED}[FAIL] Helm dependency build failed for ${chart_name}${NC}" + FAILURES=$((FAILURES + 1)) + # Count all tests in this chart as failed since we can't proceed + PASS_TEST_COUNT=0 + if [ "$has_pass_tests" = true ]; then + PASS_TEST_COUNT=$(find "${pass_dir}" -maxdepth 1 -name '*.yaml' | wc -l | tr -d ' ') + fi + FAIL_TEST_COUNT=0 + if [ "$has_fail_tests" = true ]; then + FAIL_TEST_COUNT=$(find "${fail_dir}" -maxdepth 1 -name '*.yaml' | wc -l | tr -d ' ') + fi + CHART_TEST_COUNT=$((PASS_TEST_COUNT + FAIL_TEST_COUNT)) + TOTAL_TESTS=$((TOTAL_TESTS + CHART_TEST_COUNT)) + continue # Skip to the next chart + else + echo " [OK] Helm dependencies built" + fi + fi + + # 2. Lint the chart + echo " - Running helm lint..." + if ! helm lint "${chart_dir}"; then + echo -e " ${RED}[FAIL] Helm lint failed for ${chart_name}${NC}" + FAILURES=$((FAILURES + 1)) + # Count all tests in this chart as failed since we can't proceed + PASS_TEST_COUNT=0 + if [ "$has_pass_tests" = true ]; then + PASS_TEST_COUNT=$(find "${pass_dir}" -maxdepth 1 -name '*.yaml' | wc -l | tr -d ' ') + fi + FAIL_TEST_COUNT=0 + if [ "$has_fail_tests" = true ]; then + FAIL_TEST_COUNT=$(find "${fail_dir}" -maxdepth 1 -name '*.yaml' | wc -l | tr -d ' ') + fi + CHART_TEST_COUNT=$((PASS_TEST_COUNT + FAIL_TEST_COUNT)) + TOTAL_TESTS=$((TOTAL_TESTS + CHART_TEST_COUNT)) + continue # Skip to the next chart + else + echo " [OK] Helm lint passed" + fi + + # 3. Loop through all passing test value files + if [ "$has_pass_tests" = true ]; then + echo " - Running passing test cases..." + for test_file in "${pass_dir}"/*.yaml; do + TOTAL_TESTS=$((TOTAL_TESTS + 1)) + test_name=$(basename "${test_file}" .yaml) + # Run helm template and capture output + if ! output=$(helm template "test" "${chart_dir}" --namespace "test-ns" --values "${test_file}"); then + echo -e " ${RED}[FAIL] Expected pass, but failed: '${test_name}'${NC}" + FAILURES=$((FAILURES + 1)) + continue + fi + + # using yq to parse 'asserts' section + asserts=$(yq -r '.asserts' "${test_file}") + # if asserts is not nil, then it is an array + if [ "$asserts" == "null" ]; then + # echo "asserts is not an array" + continue + fi + + # Get number of assertions + num_asserts=$(echo "$asserts" | yq -r 'length') + # echo "num_asserts: $num_asserts" + # Loop through each assertion by index + for i in $(seq 0 $((num_asserts-1))); do + assertion=$(echo "$asserts" | yq -r ".[$i]") + # echo "assertion: $assertion" + ## - equal: + ## path: ".spec.componentSpecs[0].volumeClaimTemplates[0].spec.storageClassName" + ## value: "my-storage-class2" + + # parse operator 'equal' or 'notEqual' + operator=$(echo "$assertion" | yq -r 'keys[0]') + + # parse path + path=$(echo "$assertion" | yq -r ".${operator}.path") + + # parse value + value=$(echo "$assertion" | yq -r ".${operator}.value") + + # parse actual value + actual=$(echo "$output" | yq -r "$path") + + # compare w.r.t operators + if [ "$operator" == "equal" ]; then + if [ "$actual" != "$value" ]; then + echo -e " ${RED}[FAIL] Assertion failed for '${test_name}': expected '${value}' at path '${path}' but got '${actual}'${NC}" + FAILURES=$((FAILURES + 1)) + continue + fi + elif [ "$operator" == "notEqual" ]; then + if [ "$actual" == "$value" ]; then + echo -e " ${RED}[FAIL] Assertion failed for '${test_name}': expected '${value}' at path '${path}' but got '${actual}'${NC}" + FAILURES=$((FAILURES + 1)) + continue + fi + fi + done + + echo -e " ${GREEN}[OK] Test case '${test_name}' passed as expected${NC}" + done + fi + + # 4. Loop through all failing test value files + if [ "$has_fail_tests" = true ]; then + echo " - Running failing test cases..." + for test_file in "${fail_dir}"/*.yaml; do + TOTAL_TESTS=$((TOTAL_TESTS + 1)) + test_name=$(basename "${test_file}" .yaml) + if helm template "test" "${chart_dir}" --namespace "test-ns" --values "${test_file}" > /dev/null 2>&1; then + echo -e " ${RED}[FAIL] Expected failure, but passed: '${test_name}'${NC}" + FAILURES=$((FAILURES + 1)) + else + echo -e " ${GREEN}[OK] Test case '${test_name}' failed as expected${NC}" + fi + done + fi + else + echo -e "\n--- Skipping Chart: ${chart_name} (no test files found) ---" + fi + fi +done + +echo "=====================================" +if [ "${FAILURES}" -gt 0 ]; then + echo -e "${RED}${FAILURES}/${TOTAL_TESTS} test(s) failed.${NC}" + exit 1 +else + echo -e "${GREEN}All ${TOTAL_TESTS} chart tests passed successfully.${NC}" +fi \ No newline at end of file