From 8146350b11c3bbf1f14f0f4255a5a5a43da90a07 Mon Sep 17 00:00:00 2001 From: Vladislav Klimenko Date: Wed, 22 Nov 2023 20:49:08 +0300 Subject: [PATCH 01/19] 0.22.1 --- release | 2 +- releases | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/release b/release index 215740905..a723ece79 100644 --- a/release +++ b/release @@ -1 +1 @@ -0.22.0 +0.22.1 diff --git a/releases b/releases index 9155c81e7..1b1a2490b 100644 --- a/releases +++ b/releases @@ -1,3 +1,4 @@ +0.22.0 0.21.3 0.21.2 0.21.1 From cd7da8fa958b9098fd42ce222099fba624ee92ab Mon Sep 17 00:00:00 2001 From: Vladislav Klimenko Date: Wed, 22 Nov 2023 20:53:29 +0300 Subject: [PATCH 02/19] env: manifests --- deploy/helm/Chart.yaml | 4 +- deploy/helm/README.md | 2 +- ...installations.clickhouse.altinity.com.yaml | 4 +- ...tiontemplates.clickhouse.altinity.com.yaml | 4 +- ...onfigurations.clickhouse.altinity.com.yaml | 2 +- .../Deployment-clickhouse-operator.yaml | 4 +- .../generated/Secret-clickhouse-operator.yaml | 2 +- .../clickhouse-operator-install-ansible.yaml | 42 +++++++++---------- ...house-operator-install-bundle-v1beta1.yaml | 42 +++++++++---------- .../clickhouse-operator-install-bundle.yaml | 42 +++++++++---------- ...use-operator-install-template-v1beta1.yaml | 34 +++++++-------- .../clickhouse-operator-install-template.yaml | 34 +++++++-------- .../clickhouse-operator-install-tf.yaml | 42 +++++++++---------- deploy/operator/parts/crd.yaml | 10 ++--- 14 files changed, 134 insertions(+), 134 deletions(-) diff --git a/deploy/helm/Chart.yaml b/deploy/helm/Chart.yaml index 1fa7c059d..b3750b9af 100644 --- a/deploy/helm/Chart.yaml +++ b/deploy/helm/Chart.yaml @@ -12,8 +12,8 @@ description: |- kubectl apply -f https://github.com/Altinity/clickhouse-operator/raw/master/deploy/helm/crds/CustomResourceDefinition-clickhouseoperatorconfigurations.clickhouse.altinity.com.yaml ``` type: application -version: 0.22.0 -appVersion: 0.22.0 +version: 0.22.1 +appVersion: 0.22.1 home: https://github.com/Altinity/clickhouse-operator icon: https://logosandtypes.com/wp-content/uploads/2020/12/altinity.svg maintainers: diff --git a/deploy/helm/README.md b/deploy/helm/README.md index 19a5bb8eb..990c6d039 100644 --- a/deploy/helm/README.md +++ b/deploy/helm/README.md @@ -1,6 +1,6 @@ # altinity-clickhouse-operator -![Version: 0.22.0](https://img.shields.io/badge/Version-0.22.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.22.0](https://img.shields.io/badge/AppVersion-0.22.0-informational?style=flat-square) +![Version: 0.22.1](https://img.shields.io/badge/Version-0.22.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.22.1](https://img.shields.io/badge/AppVersion-0.22.1-informational?style=flat-square) Helm chart to deploy [altinity-clickhouse-operator](https://github.com/Altinity/clickhouse-operator). diff --git a/deploy/helm/crds/CustomResourceDefinition-clickhouseinstallations.clickhouse.altinity.com.yaml b/deploy/helm/crds/CustomResourceDefinition-clickhouseinstallations.clickhouse.altinity.com.yaml index f84abd64e..c3abc4645 100644 --- a/deploy/helm/crds/CustomResourceDefinition-clickhouseinstallations.clickhouse.altinity.com.yaml +++ b/deploy/helm/crds/CustomResourceDefinition-clickhouseinstallations.clickhouse.altinity.com.yaml @@ -4,14 +4,14 @@ # SINGULAR=clickhouseinstallation # PLURAL=clickhouseinstallations # SHORT=chi -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: clickhouseinstallations.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced diff --git a/deploy/helm/crds/CustomResourceDefinition-clickhouseinstallationtemplates.clickhouse.altinity.com.yaml b/deploy/helm/crds/CustomResourceDefinition-clickhouseinstallationtemplates.clickhouse.altinity.com.yaml index 43dd55fa3..be634b9b6 100644 --- a/deploy/helm/crds/CustomResourceDefinition-clickhouseinstallationtemplates.clickhouse.altinity.com.yaml +++ b/deploy/helm/crds/CustomResourceDefinition-clickhouseinstallationtemplates.clickhouse.altinity.com.yaml @@ -4,14 +4,14 @@ # SINGULAR=clickhouseinstallationtemplate # PLURAL=clickhouseinstallationtemplates # SHORT=chit -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: clickhouseinstallationtemplates.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced diff --git a/deploy/helm/crds/CustomResourceDefinition-clickhouseoperatorconfigurations.clickhouse.altinity.com.yaml b/deploy/helm/crds/CustomResourceDefinition-clickhouseoperatorconfigurations.clickhouse.altinity.com.yaml index 125bcba13..082362cd5 100644 --- a/deploy/helm/crds/CustomResourceDefinition-clickhouseoperatorconfigurations.clickhouse.altinity.com.yaml +++ b/deploy/helm/crds/CustomResourceDefinition-clickhouseoperatorconfigurations.clickhouse.altinity.com.yaml @@ -7,7 +7,7 @@ kind: CustomResourceDefinition metadata: name: clickhouseoperatorconfigurations.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced diff --git a/deploy/helm/templates/generated/Deployment-clickhouse-operator.yaml b/deploy/helm/templates/generated/Deployment-clickhouse-operator.yaml index 28c4fcb58..b8c785154 100644 --- a/deploy/helm/templates/generated/Deployment-clickhouse-operator.yaml +++ b/deploy/helm/templates/generated/Deployment-clickhouse-operator.yaml @@ -2,9 +2,9 @@ # # NAMESPACE=kube-system # COMMENT= -# OPERATOR_IMAGE=altinity/clickhouse-operator:0.22.0 +# OPERATOR_IMAGE=altinity/clickhouse-operator:0.22.1 # OPERATOR_IMAGE_PULL_POLICY=Always -# METRICS_EXPORTER_IMAGE=altinity/metrics-exporter:0.22.0 +# METRICS_EXPORTER_IMAGE=altinity/metrics-exporter:0.22.1 # METRICS_EXPORTER_IMAGE_PULL_POLICY=Always # # Setup Deployment for clickhouse-operator diff --git a/deploy/helm/templates/generated/Secret-clickhouse-operator.yaml b/deploy/helm/templates/generated/Secret-clickhouse-operator.yaml index e288a828b..604b75992 100644 --- a/deploy/helm/templates/generated/Secret-clickhouse-operator.yaml +++ b/deploy/helm/templates/generated/Secret-clickhouse-operator.yaml @@ -3,7 +3,7 @@ # Template parameters available: # NAMESPACE=kube-system # COMMENT= -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # CH_USERNAME_SECRET_PLAIN=clickhouse_operator # CH_PASSWORD_SECRET_PLAIN=clickhouse_operator_password # diff --git a/deploy/operator/clickhouse-operator-install-ansible.yaml b/deploy/operator/clickhouse-operator-install-ansible.yaml index ab7dc38dc..dd95d17f5 100644 --- a/deploy/operator/clickhouse-operator-install-ansible.yaml +++ b/deploy/operator/clickhouse-operator-install-ansible.yaml @@ -11,14 +11,14 @@ # SINGULAR=clickhouseinstallation # PLURAL=clickhouseinstallations # SHORT=chi -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: clickhouseinstallations.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -1198,14 +1198,14 @@ spec: # SINGULAR=clickhouseinstallationtemplate # PLURAL=clickhouseinstallationtemplates # SHORT=chit -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: clickhouseinstallationtemplates.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -2388,7 +2388,7 @@ kind: CustomResourceDefinition metadata: name: clickhouseoperatorconfigurations.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -2802,7 +2802,7 @@ metadata: name: clickhouse-operator namespace: {{ namespace }} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 --- # Template Parameters: # @@ -2819,7 +2819,7 @@ metadata: name: clickhouse-operator namespace: {{ namespace }} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 rules: - apiGroups: - "" @@ -2977,7 +2977,7 @@ metadata: name: clickhouse-operator namespace: {{ namespace }} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 roleRef: apiGroup: rbac.authorization.k8s.io kind: Role @@ -2999,7 +2999,7 @@ metadata: name: etc-clickhouse-operator-files namespace: {{ namespace }} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: config.yaml: | @@ -3354,7 +3354,7 @@ metadata: name: etc-clickhouse-operator-confd-files namespace: {{ namespace }} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: --- @@ -3370,7 +3370,7 @@ metadata: name: etc-clickhouse-operator-configd-files namespace: {{ namespace }} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 01-clickhouse-01-listen.xml: | @@ -3469,7 +3469,7 @@ metadata: name: etc-clickhouse-operator-templatesd-files namespace: {{ namespace }} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 001-templates.json.example: | @@ -3569,7 +3569,7 @@ metadata: name: etc-clickhouse-operator-usersd-files namespace: {{ namespace }} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 01-clickhouse-operator-profile.xml: | @@ -3622,7 +3622,7 @@ data: # Template parameters available: # NAMESPACE={{ namespace }} # COMMENT= -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # CH_USERNAME_SECRET_PLAIN=clickhouse_operator # CH_PASSWORD_SECRET_PLAIN={{ password }} # @@ -3632,7 +3632,7 @@ metadata: name: clickhouse-operator namespace: {{ namespace }} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator type: Opaque stringData: @@ -3643,9 +3643,9 @@ stringData: # # NAMESPACE={{ namespace }} # COMMENT= -# OPERATOR_IMAGE=altinity/clickhouse-operator:0.22.0 +# OPERATOR_IMAGE=altinity/clickhouse-operator:0.22.1 # OPERATOR_IMAGE_PULL_POLICY=Always -# METRICS_EXPORTER_IMAGE=altinity/metrics-exporter:0.22.0 +# METRICS_EXPORTER_IMAGE=altinity/metrics-exporter:0.22.1 # METRICS_EXPORTER_IMAGE_PULL_POLICY=Always # # Setup Deployment for clickhouse-operator @@ -3656,7 +3656,7 @@ metadata: name: clickhouse-operator namespace: {{ namespace }} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator spec: replicas: 1 @@ -3690,7 +3690,7 @@ spec: name: etc-clickhouse-operator-usersd-files containers: - name: clickhouse-operator - image: altinity/clickhouse-operator:0.22.0 + image: altinity/clickhouse-operator:0.22.1 imagePullPolicy: Always volumeMounts: - name: etc-clickhouse-operator-folder @@ -3758,7 +3758,7 @@ spec: name: metrics - name: metrics-exporter - image: altinity/metrics-exporter:0.22.0 + image: altinity/metrics-exporter:0.22.1 imagePullPolicy: Always volumeMounts: - name: etc-clickhouse-operator-folder @@ -3841,7 +3841,7 @@ metadata: name: clickhouse-operator-metrics namespace: {{ namespace }} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator spec: ports: diff --git a/deploy/operator/clickhouse-operator-install-bundle-v1beta1.yaml b/deploy/operator/clickhouse-operator-install-bundle-v1beta1.yaml index a1be10100..d241c4fac 100644 --- a/deploy/operator/clickhouse-operator-install-bundle-v1beta1.yaml +++ b/deploy/operator/clickhouse-operator-install-bundle-v1beta1.yaml @@ -4,14 +4,14 @@ # SINGULAR=clickhouseinstallation # PLURAL=clickhouseinstallations # SHORT=chi -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: clickhouseinstallations.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -1181,14 +1181,14 @@ spec: # SINGULAR=clickhouseinstallationtemplate # PLURAL=clickhouseinstallationtemplates # SHORT=chit -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: clickhouseinstallationtemplates.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -2359,7 +2359,7 @@ kind: CustomResourceDefinition metadata: name: clickhouseoperatorconfigurations.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -2763,7 +2763,7 @@ metadata: name: clickhouse-operator namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 --- # Template Parameters: # @@ -2780,7 +2780,7 @@ metadata: name: clickhouse-operator-kube-system #namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 rules: - apiGroups: - "" @@ -2938,7 +2938,7 @@ metadata: name: clickhouse-operator-kube-system #namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -2960,7 +2960,7 @@ metadata: name: etc-clickhouse-operator-files namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: config.yaml: | @@ -3314,7 +3314,7 @@ metadata: name: etc-clickhouse-operator-confd-files namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: --- @@ -3330,7 +3330,7 @@ metadata: name: etc-clickhouse-operator-configd-files namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 01-clickhouse-01-listen.xml: | @@ -3424,7 +3424,7 @@ metadata: name: etc-clickhouse-operator-templatesd-files namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 001-templates.json.example: | @@ -3522,7 +3522,7 @@ metadata: name: etc-clickhouse-operator-usersd-files namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 01-clickhouse-operator-profile.xml: | @@ -3574,7 +3574,7 @@ data: # Template parameters available: # NAMESPACE=kube-system # COMMENT= -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # CH_USERNAME_SECRET_PLAIN=clickhouse_operator # CH_PASSWORD_SECRET_PLAIN=clickhouse_operator_password # @@ -3584,7 +3584,7 @@ metadata: name: clickhouse-operator namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator type: Opaque stringData: @@ -3595,9 +3595,9 @@ stringData: # # NAMESPACE=kube-system # COMMENT= -# OPERATOR_IMAGE=altinity/clickhouse-operator:0.22.0 +# OPERATOR_IMAGE=altinity/clickhouse-operator:0.22.1 # OPERATOR_IMAGE_PULL_POLICY=Always -# METRICS_EXPORTER_IMAGE=altinity/metrics-exporter:0.22.0 +# METRICS_EXPORTER_IMAGE=altinity/metrics-exporter:0.22.1 # METRICS_EXPORTER_IMAGE_PULL_POLICY=Always # # Setup Deployment for clickhouse-operator @@ -3608,7 +3608,7 @@ metadata: name: clickhouse-operator namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator spec: replicas: 1 @@ -3642,7 +3642,7 @@ spec: name: etc-clickhouse-operator-usersd-files containers: - name: clickhouse-operator - image: altinity/clickhouse-operator:0.22.0 + image: altinity/clickhouse-operator:0.22.1 imagePullPolicy: Always volumeMounts: - name: etc-clickhouse-operator-folder @@ -3708,7 +3708,7 @@ spec: - containerPort: 9999 name: metrics - name: metrics-exporter - image: altinity/metrics-exporter:0.22.0 + image: altinity/metrics-exporter:0.22.1 imagePullPolicy: Always volumeMounts: - name: etc-clickhouse-operator-folder @@ -3790,7 +3790,7 @@ metadata: name: clickhouse-operator-metrics namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator spec: ports: diff --git a/deploy/operator/clickhouse-operator-install-bundle.yaml b/deploy/operator/clickhouse-operator-install-bundle.yaml index 2600c168d..12a9e8191 100644 --- a/deploy/operator/clickhouse-operator-install-bundle.yaml +++ b/deploy/operator/clickhouse-operator-install-bundle.yaml @@ -4,14 +4,14 @@ # SINGULAR=clickhouseinstallation # PLURAL=clickhouseinstallations # SHORT=chi -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: clickhouseinstallations.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -1191,14 +1191,14 @@ spec: # SINGULAR=clickhouseinstallationtemplate # PLURAL=clickhouseinstallationtemplates # SHORT=chit -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: clickhouseinstallationtemplates.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -2381,7 +2381,7 @@ kind: CustomResourceDefinition metadata: name: clickhouseoperatorconfigurations.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -2795,7 +2795,7 @@ metadata: name: clickhouse-operator namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 --- # Template Parameters: # @@ -2812,7 +2812,7 @@ metadata: name: clickhouse-operator-kube-system #namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 rules: - apiGroups: - "" @@ -2970,7 +2970,7 @@ metadata: name: clickhouse-operator-kube-system #namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -2992,7 +2992,7 @@ metadata: name: etc-clickhouse-operator-files namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: config.yaml: | @@ -3347,7 +3347,7 @@ metadata: name: etc-clickhouse-operator-confd-files namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: --- @@ -3363,7 +3363,7 @@ metadata: name: etc-clickhouse-operator-configd-files namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 01-clickhouse-01-listen.xml: | @@ -3462,7 +3462,7 @@ metadata: name: etc-clickhouse-operator-templatesd-files namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 001-templates.json.example: | @@ -3562,7 +3562,7 @@ metadata: name: etc-clickhouse-operator-usersd-files namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 01-clickhouse-operator-profile.xml: | @@ -3615,7 +3615,7 @@ data: # Template parameters available: # NAMESPACE=kube-system # COMMENT= -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # CH_USERNAME_SECRET_PLAIN=clickhouse_operator # CH_PASSWORD_SECRET_PLAIN=clickhouse_operator_password # @@ -3625,7 +3625,7 @@ metadata: name: clickhouse-operator namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator type: Opaque stringData: @@ -3636,9 +3636,9 @@ stringData: # # NAMESPACE=kube-system # COMMENT= -# OPERATOR_IMAGE=altinity/clickhouse-operator:0.22.0 +# OPERATOR_IMAGE=altinity/clickhouse-operator:0.22.1 # OPERATOR_IMAGE_PULL_POLICY=Always -# METRICS_EXPORTER_IMAGE=altinity/metrics-exporter:0.22.0 +# METRICS_EXPORTER_IMAGE=altinity/metrics-exporter:0.22.1 # METRICS_EXPORTER_IMAGE_PULL_POLICY=Always # # Setup Deployment for clickhouse-operator @@ -3649,7 +3649,7 @@ metadata: name: clickhouse-operator namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator spec: replicas: 1 @@ -3683,7 +3683,7 @@ spec: name: etc-clickhouse-operator-usersd-files containers: - name: clickhouse-operator - image: altinity/clickhouse-operator:0.22.0 + image: altinity/clickhouse-operator:0.22.1 imagePullPolicy: Always volumeMounts: - name: etc-clickhouse-operator-folder @@ -3751,7 +3751,7 @@ spec: name: metrics - name: metrics-exporter - image: altinity/metrics-exporter:0.22.0 + image: altinity/metrics-exporter:0.22.1 imagePullPolicy: Always volumeMounts: - name: etc-clickhouse-operator-folder @@ -3834,7 +3834,7 @@ metadata: name: clickhouse-operator-metrics namespace: kube-system labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator spec: ports: diff --git a/deploy/operator/clickhouse-operator-install-template-v1beta1.yaml b/deploy/operator/clickhouse-operator-install-template-v1beta1.yaml index 32fbc9f70..5f6afb645 100644 --- a/deploy/operator/clickhouse-operator-install-template-v1beta1.yaml +++ b/deploy/operator/clickhouse-operator-install-template-v1beta1.yaml @@ -4,14 +4,14 @@ # SINGULAR=clickhouseinstallation # PLURAL=clickhouseinstallations # SHORT=chi -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: clickhouseinstallations.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -1181,14 +1181,14 @@ spec: # SINGULAR=clickhouseinstallationtemplate # PLURAL=clickhouseinstallationtemplates # SHORT=chit -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: clickhouseinstallationtemplates.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -2359,7 +2359,7 @@ kind: CustomResourceDefinition metadata: name: clickhouseoperatorconfigurations.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -2763,7 +2763,7 @@ metadata: name: clickhouse-operator namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 --- # Template Parameters: # @@ -2780,7 +2780,7 @@ metadata: name: clickhouse-operator-${OPERATOR_NAMESPACE} #namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 rules: - apiGroups: - "" @@ -2938,7 +2938,7 @@ metadata: name: clickhouse-operator-${OPERATOR_NAMESPACE} #namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -2960,7 +2960,7 @@ metadata: name: etc-clickhouse-operator-files namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: config.yaml: | @@ -3314,7 +3314,7 @@ metadata: name: etc-clickhouse-operator-confd-files namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: --- @@ -3330,7 +3330,7 @@ metadata: name: etc-clickhouse-operator-configd-files namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 01-clickhouse-01-listen.xml: | @@ -3424,7 +3424,7 @@ metadata: name: etc-clickhouse-operator-templatesd-files namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 001-templates.json.example: | @@ -3522,7 +3522,7 @@ metadata: name: etc-clickhouse-operator-usersd-files namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 01-clickhouse-operator-profile.xml: | @@ -3574,7 +3574,7 @@ data: # Template parameters available: # NAMESPACE=${OPERATOR_NAMESPACE} # COMMENT= -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # CH_USERNAME_SECRET_PLAIN=clickhouse_operator # CH_PASSWORD_SECRET_PLAIN=clickhouse_operator_password # @@ -3584,7 +3584,7 @@ metadata: name: clickhouse-operator namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator type: Opaque stringData: @@ -3608,7 +3608,7 @@ metadata: name: clickhouse-operator namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator spec: replicas: 1 @@ -3790,7 +3790,7 @@ metadata: name: clickhouse-operator-metrics namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator spec: ports: diff --git a/deploy/operator/clickhouse-operator-install-template.yaml b/deploy/operator/clickhouse-operator-install-template.yaml index 72953f19f..8d5760c22 100644 --- a/deploy/operator/clickhouse-operator-install-template.yaml +++ b/deploy/operator/clickhouse-operator-install-template.yaml @@ -4,14 +4,14 @@ # SINGULAR=clickhouseinstallation # PLURAL=clickhouseinstallations # SHORT=chi -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: clickhouseinstallations.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -1191,14 +1191,14 @@ spec: # SINGULAR=clickhouseinstallationtemplate # PLURAL=clickhouseinstallationtemplates # SHORT=chit -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: clickhouseinstallationtemplates.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -2381,7 +2381,7 @@ kind: CustomResourceDefinition metadata: name: clickhouseoperatorconfigurations.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -2795,7 +2795,7 @@ metadata: name: clickhouse-operator namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 --- # Template Parameters: # @@ -2812,7 +2812,7 @@ metadata: name: clickhouse-operator-${OPERATOR_NAMESPACE} #namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 rules: - apiGroups: - "" @@ -2970,7 +2970,7 @@ metadata: name: clickhouse-operator-${OPERATOR_NAMESPACE} #namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -2992,7 +2992,7 @@ metadata: name: etc-clickhouse-operator-files namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: config.yaml: | @@ -3347,7 +3347,7 @@ metadata: name: etc-clickhouse-operator-confd-files namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: --- @@ -3363,7 +3363,7 @@ metadata: name: etc-clickhouse-operator-configd-files namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 01-clickhouse-01-listen.xml: | @@ -3462,7 +3462,7 @@ metadata: name: etc-clickhouse-operator-templatesd-files namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 001-templates.json.example: | @@ -3562,7 +3562,7 @@ metadata: name: etc-clickhouse-operator-usersd-files namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 01-clickhouse-operator-profile.xml: | @@ -3615,7 +3615,7 @@ data: # Template parameters available: # NAMESPACE=${OPERATOR_NAMESPACE} # COMMENT= -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # CH_USERNAME_SECRET_PLAIN=clickhouse_operator # CH_PASSWORD_SECRET_PLAIN=clickhouse_operator_password # @@ -3625,7 +3625,7 @@ metadata: name: clickhouse-operator namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator type: Opaque stringData: @@ -3649,7 +3649,7 @@ metadata: name: clickhouse-operator namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator spec: replicas: 1 @@ -3834,7 +3834,7 @@ metadata: name: clickhouse-operator-metrics namespace: ${OPERATOR_NAMESPACE} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator spec: ports: diff --git a/deploy/operator/clickhouse-operator-install-tf.yaml b/deploy/operator/clickhouse-operator-install-tf.yaml index f4ba1de77..b43fb9d55 100644 --- a/deploy/operator/clickhouse-operator-install-tf.yaml +++ b/deploy/operator/clickhouse-operator-install-tf.yaml @@ -11,14 +11,14 @@ # SINGULAR=clickhouseinstallation # PLURAL=clickhouseinstallations # SHORT=chi -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: clickhouseinstallations.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -1198,14 +1198,14 @@ spec: # SINGULAR=clickhouseinstallationtemplate # PLURAL=clickhouseinstallationtemplates # SHORT=chit -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: clickhouseinstallationtemplates.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -2388,7 +2388,7 @@ kind: CustomResourceDefinition metadata: name: clickhouseoperatorconfigurations.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -2802,7 +2802,7 @@ metadata: name: clickhouse-operator namespace: ${namespace} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 --- # Template Parameters: # @@ -2819,7 +2819,7 @@ metadata: name: clickhouse-operator namespace: ${namespace} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 rules: - apiGroups: - "" @@ -2977,7 +2977,7 @@ metadata: name: clickhouse-operator namespace: ${namespace} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 roleRef: apiGroup: rbac.authorization.k8s.io kind: Role @@ -2999,7 +2999,7 @@ metadata: name: etc-clickhouse-operator-files namespace: ${namespace} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: config.yaml: | @@ -3354,7 +3354,7 @@ metadata: name: etc-clickhouse-operator-confd-files namespace: ${namespace} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: --- @@ -3370,7 +3370,7 @@ metadata: name: etc-clickhouse-operator-configd-files namespace: ${namespace} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 01-clickhouse-01-listen.xml: | @@ -3469,7 +3469,7 @@ metadata: name: etc-clickhouse-operator-templatesd-files namespace: ${namespace} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 001-templates.json.example: | @@ -3569,7 +3569,7 @@ metadata: name: etc-clickhouse-operator-usersd-files namespace: ${namespace} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator data: 01-clickhouse-operator-profile.xml: | @@ -3622,7 +3622,7 @@ data: # Template parameters available: # NAMESPACE=${namespace} # COMMENT= -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # CH_USERNAME_SECRET_PLAIN=clickhouse_operator # CH_PASSWORD_SECRET_PLAIN=${password} # @@ -3632,7 +3632,7 @@ metadata: name: clickhouse-operator namespace: ${namespace} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator type: Opaque stringData: @@ -3643,9 +3643,9 @@ stringData: # # NAMESPACE=${namespace} # COMMENT= -# OPERATOR_IMAGE=altinity/clickhouse-operator:0.22.0 +# OPERATOR_IMAGE=altinity/clickhouse-operator:0.22.1 # OPERATOR_IMAGE_PULL_POLICY=Always -# METRICS_EXPORTER_IMAGE=altinity/metrics-exporter:0.22.0 +# METRICS_EXPORTER_IMAGE=altinity/metrics-exporter:0.22.1 # METRICS_EXPORTER_IMAGE_PULL_POLICY=Always # # Setup Deployment for clickhouse-operator @@ -3656,7 +3656,7 @@ metadata: name: clickhouse-operator namespace: ${namespace} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator spec: replicas: 1 @@ -3690,7 +3690,7 @@ spec: name: etc-clickhouse-operator-usersd-files containers: - name: clickhouse-operator - image: altinity/clickhouse-operator:0.22.0 + image: altinity/clickhouse-operator:0.22.1 imagePullPolicy: Always volumeMounts: - name: etc-clickhouse-operator-folder @@ -3758,7 +3758,7 @@ spec: name: metrics - name: metrics-exporter - image: altinity/metrics-exporter:0.22.0 + image: altinity/metrics-exporter:0.22.1 imagePullPolicy: Always volumeMounts: - name: etc-clickhouse-operator-folder @@ -3841,7 +3841,7 @@ metadata: name: clickhouse-operator-metrics namespace: ${namespace} labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 app: clickhouse-operator spec: ports: diff --git a/deploy/operator/parts/crd.yaml b/deploy/operator/parts/crd.yaml index 0e8b1413c..c7249054a 100644 --- a/deploy/operator/parts/crd.yaml +++ b/deploy/operator/parts/crd.yaml @@ -4,14 +4,14 @@ # SINGULAR=clickhouseinstallation # PLURAL=clickhouseinstallations # SHORT=chi -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: clickhouseinstallations.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -1191,14 +1191,14 @@ spec: # SINGULAR=clickhouseinstallationtemplate # PLURAL=clickhouseinstallationtemplates # SHORT=chit -# OPERATOR_VERSION=0.22.0 +# OPERATOR_VERSION=0.22.1 # apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: clickhouseinstallationtemplates.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced @@ -2381,7 +2381,7 @@ kind: CustomResourceDefinition metadata: name: clickhouseoperatorconfigurations.clickhouse.altinity.com labels: - clickhouse.altinity.com/chop: 0.22.0 + clickhouse.altinity.com/chop: 0.22.1 spec: group: clickhouse.altinity.com scope: Namespaced From 0a13e1da6dfc4866eb3302d61b589b9a11f50d30 Mon Sep 17 00:00:00 2001 From: alz Date: Wed, 22 Nov 2023 21:27:00 +0300 Subject: [PATCH 03/19] Remove delays and excessive logging. --- pkg/controller/chi/worker-chi-reconciler.go | 2 +- pkg/controller/chi/worker.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/controller/chi/worker-chi-reconciler.go b/pkg/controller/chi/worker-chi-reconciler.go index 8e6965d7a..609f41462 100644 --- a/pkg/controller/chi/worker-chi-reconciler.go +++ b/pkg/controller/chi/worker-chi-reconciler.go @@ -665,7 +665,7 @@ func (w *worker) reconcileHost(ctx context.Context, host *chiV1.ChiHost) error { host.GetReconcileAttributes().UnsetAdd() // Sometimes service needs some time to start after creation before being accessible for usage - time.Sleep(30 * time.Second) + // time.Sleep(30 * time.Second) _ = w.migrateTables(ctx, host, migrateTableOpts) if err := w.includeHost(ctx, host); err != nil { diff --git a/pkg/controller/chi/worker.go b/pkg/controller/chi/worker.go index ba3e7e49f..3a5a8bece 100644 --- a/pkg/controller/chi/worker.go +++ b/pkg/controller/chi/worker.go @@ -259,8 +259,9 @@ func (w *worker) processReconcilePod(ctx context.Context, cmd *ReconcilePod) err metricsPodAdd(ctx) return nil case reconcileUpdate: - w.a.V(1).M(cmd.new).F().Info("Update Pod. %s/%s", cmd.new.Namespace, cmd.new.Name) - metricsPodUpdate(ctx) + //ignore + //w.a.V(1).M(cmd.new).F().Info("Update Pod. %s/%s", cmd.new.Namespace, cmd.new.Name) + //metricsPodUpdate(ctx) return nil case reconcileDelete: w.a.V(1).M(cmd.old).F().Info("Delete Pod. %s/%s", cmd.old.Namespace, cmd.old.Name) From 90829a1238652b128dab3f815fa7bf8ee557e09f Mon Sep 17 00:00:00 2001 From: alz Date: Fri, 24 Nov 2023 14:33:19 +0300 Subject: [PATCH 04/19] Make tests more reliable --- .../chi/test-008-operator-restart-3-1.yaml | 8 +-- .../chi/test-008-operator-restart-3-2.yaml | 8 +-- tests/e2e/test_operator.py | 65 ++++++++++--------- 3 files changed, 38 insertions(+), 43 deletions(-) diff --git a/tests/e2e/manifests/chi/test-008-operator-restart-3-1.yaml b/tests/e2e/manifests/chi/test-008-operator-restart-3-1.yaml index 37f081dd3..c9718675a 100644 --- a/tests/e2e/manifests/chi/test-008-operator-restart-3-1.yaml +++ b/tests/e2e/manifests/chi/test-008-operator-restart-3-1.yaml @@ -7,6 +7,7 @@ metadata: spec: useTemplates: - name: persistent-volume + - name: clickhouse-version configuration: zookeeper: nodes: @@ -24,10 +25,3 @@ spec: templates: dataVolumeClaimTemplate: default podTemplate: default - templates: - podTemplates: - - name: default - spec: - containers: - - name: clickhouse-pod - image: clickhouse/clickhouse-server:22.3 diff --git a/tests/e2e/manifests/chi/test-008-operator-restart-3-2.yaml b/tests/e2e/manifests/chi/test-008-operator-restart-3-2.yaml index edaf2d687..c9718675a 100644 --- a/tests/e2e/manifests/chi/test-008-operator-restart-3-2.yaml +++ b/tests/e2e/manifests/chi/test-008-operator-restart-3-2.yaml @@ -7,6 +7,7 @@ metadata: spec: useTemplates: - name: persistent-volume + - name: clickhouse-version configuration: zookeeper: nodes: @@ -24,10 +25,3 @@ spec: templates: dataVolumeClaimTemplate: default podTemplate: default - templates: - podTemplates: - - name: default - spec: - containers: - - name: clickhouse-pod - image: clickhouse/clickhouse-server:22.8 diff --git a/tests/e2e/test_operator.py b/tests/e2e/test_operator.py index 47d449273..04ee530da 100644 --- a/tests/e2e/test_operator.py +++ b/tests/e2e/test_operator.py @@ -355,6 +355,7 @@ def test_operator_restart(self, manifest, service, version=None): "CREATE TABLE IF NOT EXISTS test_dist as test_local Engine = Distributed('{cluster}', default, test_local, a)", host=h, ) + wait_for_cluster(2, chi, cluster) trigger_event = threading.Event() @@ -454,6 +455,7 @@ def check_remote_servers(self, chi, shards, trigger_event, shell=None, cluster=" @TestScenario @Name("test_008_1. Test operator restart") +@Tags("NO_PARALLEL") @Requirements(RQ_SRS_026_ClickHouseOperator_Managing_RestartingOperator("1.0")) def test_008_1(self): create_shell_namespace_clickhouse_template() @@ -471,6 +473,7 @@ def test_008_1(self): @TestScenario @Name("test_008_2. Test operator restart") +@Tags("NO_PARALLEL") def test_008_2(self): create_shell_namespace_clickhouse_template() @@ -487,6 +490,7 @@ def test_008_2(self): @TestScenario @Name("test_008_3. Test operator restart in the middle of reconcile") +@Tags("NO_PARALLEL") def test_008_3(self): create_shell_namespace_clickhouse_template() @@ -558,7 +562,8 @@ def test_008_3(self): @TestScenario @Name("test_009_1. Test operator upgrade") @Requirements(RQ_SRS_026_ClickHouseOperator_Managing_UpgradingOperator("1.0")) -def test_009_1(self, version_from="0.20.1", version_to=None): +@Tags("NO_PARALLEL") +def test_009_1(self, version_from="0.21.0", version_to=None): if version_to is None: version_to = self.context.operator_version @@ -579,7 +584,8 @@ def test_009_1(self, version_from="0.20.1", version_to=None): @TestScenario @Name("test_009_2. Test operator upgrade") -def test_009_2(self, version_from="0.20.1", version_to=None): +@Tags("NO_PARALLEL") +def test_009_2(self, version_from="0.21.0", version_to=None): if version_to is None: version_to = self.context.operator_version @@ -1249,6 +1255,27 @@ def get_shards_from_remote_servers(chi, cluster, shell=None): return chi_shards +def wait_for_cluster(n_shards, chi, cluster): + with Given(f"Cluster {cluster} is properly configured"): + with By(f"remote_servers have {n_shards} shards"): + assert n_shards == get_shards_from_remote_servers(chi, cluster) + with By(f"ClickHouse recognizes {n_shards} shards in the cluster"): + cnt = "" + for i in range(1, 10): + cnt = clickhouse.query( + chi, + f"select count() from system.clusters where cluster ='{cluster}'", + host=f"chi-{chi}-{cluster}-0-0", + ) + if cnt == str(n_shards): + break + with Then("Not ready. Wait for " + str(i * 5) + " seconds"): + time.sleep(i * 5) + assert str(n_shards) == clickhouse.query( + chi, + f"select count() from system.clusters where cluster ='{cluster}'", + host=f"chi-{chi}-{cluster}-0-0", + ) @TestScenario @Name("test_014_0. Test that schema is correctly propagated on replicas") @@ -1320,30 +1347,11 @@ def test_014_0(self): "CREATE MATERIALIZED VIEW test_atomic_014.test_mv2_014 ON CLUSTER '{cluster}' Engine = ReplicatedMergeTree ORDER BY tuple() PARTITION BY tuple() as SELECT * from test_atomic_014.test_local2_014", "CREATE FUNCTION test_014 ON CLUSTER '{cluster}' AS (x, k, b) -> ((k * x) + b)" ] - with Given(f"Cluster {cluster} is properly configured"): - with By(f"remote_servers have {n_shards} shards"): - assert n_shards == get_shards_from_remote_servers(chi_name, cluster) - with By(f"ClickHouse recognizes {n_shards} shards in the cluster"): - cnt = "" - for i in range(1, 10): - cnt = clickhouse.query( - chi_name, - f"select count() from system.clusters where cluster ='{cluster}'", - host=f"chi-{chi_name}-{cluster}-0-0", - ) - if cnt == str(n_shards): - break - with Then("Not ready. Wait for " + str(i * 5) + " seconds"): - time.sleep(i * 5) - assert str(n_shards) == clickhouse.query( - chi_name, - f"select count() from system.clusters where cluster ='{cluster}'", - host=f"chi-{chi_name}-{cluster}-0-0", - ) + wait_for_cluster(nshards, chi_name, cluster) - with Then("Create schema objects"): - for q in create_ddls: - clickhouse.query(chi_name, q, host=f"chi-{chi_name}-{cluster}-0-0") + with Then("Create schema objects"): + for q in create_ddls: + clickhouse.query(chi_name, q, host=f"chi-{chi_name}-{cluster}-0-0") with Given("Replicated table is created on a first replica and data is inserted"): for table in replicated_tables: @@ -1548,14 +1556,13 @@ def test_014_1(self): timeout=600, ) - create_table = "CREATE TABLE test_local_014_1 ON CLUSTER '{cluster}' (a Int8, r UInt64) Engine = ReplicatedMergeTree('/clickhouse/{cluster}/tables/{database}/{table}', '{replica}') ORDER BY tuple()" + create_table = "CREATE TABLE test_local_014_1 (a Int8, r UInt64) Engine = ReplicatedMergeTree('/clickhouse/{cluster}/tables/{database}/{table}', '{replica}') ORDER BY tuple()" table = "test_local_014_1" replicas = [0, 1] with Given("Create schema objects"): - clickhouse.query(chi, create_table) - # Give some time for replication to catch up - time.sleep(30) + for replica in replicas: + clickhouse.query(chi, create_table, host=f"chi-{chi}-{cluster}-0-{replica}") def check_data_is_replicated(replicas, v): with When("Data is inserted on two replicas"): From ba5e52fb68c6195ddb0633b9fe8fa6256f851726 Mon Sep 17 00:00:00 2001 From: alz Date: Fri, 24 Nov 2023 15:19:29 +0300 Subject: [PATCH 05/19] typo --- tests/e2e/test_operator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/test_operator.py b/tests/e2e/test_operator.py index 04ee530da..8925c81ab 100644 --- a/tests/e2e/test_operator.py +++ b/tests/e2e/test_operator.py @@ -1347,7 +1347,7 @@ def test_014_0(self): "CREATE MATERIALIZED VIEW test_atomic_014.test_mv2_014 ON CLUSTER '{cluster}' Engine = ReplicatedMergeTree ORDER BY tuple() PARTITION BY tuple() as SELECT * from test_atomic_014.test_local2_014", "CREATE FUNCTION test_014 ON CLUSTER '{cluster}' AS (x, k, b) -> ((k * x) + b)" ] - wait_for_cluster(nshards, chi_name, cluster) + wait_for_cluster(n_shards, chi_name, cluster) with Then("Create schema objects"): for q in create_ddls: From 883f845d7f2af74e8e39646dc568497291c829aa Mon Sep 17 00:00:00 2001 From: alz Date: Fri, 24 Nov 2023 19:47:48 +0300 Subject: [PATCH 06/19] Fix tests --- .../chi/test-041-secure-zookeeper.yaml | 18 ++--- tests/e2e/test_operator.py | 66 +++++++++++-------- 2 files changed, 49 insertions(+), 35 deletions(-) diff --git a/tests/e2e/manifests/chi/test-041-secure-zookeeper.yaml b/tests/e2e/manifests/chi/test-041-secure-zookeeper.yaml index 7aa972b7f..56ec526dd 100644 --- a/tests/e2e/manifests/chi/test-041-secure-zookeeper.yaml +++ b/tests/e2e/manifests/chi/test-041-secure-zookeeper.yaml @@ -19,7 +19,7 @@ spec: - -x - -c - | - + cat << EOF > /usr/local/share/ca-certificates/my_own_ca.crt && -----BEGIN CERTIFICATE----- MIIDljCCAn6gAwIBAgIUWCSwiZeH4eBrc+WT3cYqX6pUrjYwDQYJKoZIhvcNAQEL @@ -44,11 +44,11 @@ spec: /Fa9ElbT45l+4g== -----END CERTIFICATE----- EOF - + update-ca-certificates && - + openssl verify -x509_strict -CAfile /usr/local/share/ca-certificates/my_own_ca.crt /etc/clickhouse-server/config.d/server.crt && - + cat << EOF > /client.crt && -----BEGIN CERTIFICATE----- MIIDIDCCAggCFCKfcPe/PGW8TtarQJwRTgXRkrEYMA0GCSqGSIb3DQEBCwUAMFQx @@ -70,7 +70,7 @@ spec: U6T8Pt3rU1lBqAWIVAxtH4DoTvLtwWc9pr9AJBSfRQmvseSB -----END CERTIFICATE----- EOF - + cat << EOF > /client.key && -----BEGIN PRIVATE KEY----- MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDBHg6uXdw/w3RI @@ -101,9 +101,9 @@ spec: ciPq4SysQPk8R3R/kQ5RvQ== -----END PRIVATE KEY----- EOF - + openssl verify -x509_strict -CAfile /usr/local/share/ca-certificates/my_own_ca.crt /client.crt && - + /entrypoint.sh configuration: @@ -115,8 +115,8 @@ spec: clusters: - name: "default" layout: - shardsCount: 2 - replicasCount: 1 + shardsCount: 1 + replicasCount: 2 settings: tcp_port: 9000 # keep for localhost tcp_port_secure: 9440 diff --git a/tests/e2e/test_operator.py b/tests/e2e/test_operator.py index 8925c81ab..40fc71912 100644 --- a/tests/e2e/test_operator.py +++ b/tests/e2e/test_operator.py @@ -355,7 +355,7 @@ def test_operator_restart(self, manifest, service, version=None): "CREATE TABLE IF NOT EXISTS test_dist as test_local Engine = Distributed('{cluster}', default, test_local, a)", host=h, ) - wait_for_cluster(2, chi, cluster) + wait_for_cluster(chi, cluster, 2) trigger_event = threading.Event() @@ -1255,25 +1255,35 @@ def get_shards_from_remote_servers(chi, cluster, shell=None): return chi_shards -def wait_for_cluster(n_shards, chi, cluster): +def wait_for_cluster(chi, cluster, num_shards, num_replicas=0): with Given(f"Cluster {cluster} is properly configured"): - with By(f"remote_servers have {n_shards} shards"): - assert n_shards == get_shards_from_remote_servers(chi, cluster) - with By(f"ClickHouse recognizes {n_shards} shards in the cluster"): + with By(f"remote_servers have {num_shards} shards"): + assert num_shards == get_shards_from_remote_servers(chi, cluster) + with By(f"ClickHouse recognizes {num_shards} shards in the cluster"): cnt = "" for i in range(1, 10): - cnt = clickhouse.query( + shards = clickhouse.query( chi, - f"select count() from system.clusters where cluster ='{cluster}'", + f"select uniq(shard_num) from system.clusters where cluster ='{cluster}'", host=f"chi-{chi}-{cluster}-0-0", ) - if cnt == str(n_shards): + replicas = clickhouse.query( + chi, + f"select uniq(replica_num) from system.clusters where cluster ='{cluster}'", + host=f"chi-{chi}-{cluster}-0-0", + ) + if shards == str(num_shards) and (num_replicas==0 or replicas == str(num_replicas)): break with Then("Not ready. Wait for " + str(i * 5) + " seconds"): time.sleep(i * 5) - assert str(n_shards) == clickhouse.query( + assert str(num_shards) == clickhouse.query( + chi, + f"select uniq(shard_num) from system.clusters where cluster ='{cluster}'", + host=f"chi-{chi}-{cluster}-0-0", + ) + assert num_replicas==0 or str(num_replicas) == clickhouse.query( chi, - f"select count() from system.clusters where cluster ='{cluster}'", + f"select uniq(replica_num) from system.clusters where cluster ='{cluster}'", host=f"chi-{chi}-{cluster}-0-0", ) @@ -1347,7 +1357,7 @@ def test_014_0(self): "CREATE MATERIALIZED VIEW test_atomic_014.test_mv2_014 ON CLUSTER '{cluster}' Engine = ReplicatedMergeTree ORDER BY tuple() PARTITION BY tuple() as SELECT * from test_atomic_014.test_local2_014", "CREATE FUNCTION test_014 ON CLUSTER '{cluster}' AS (x, k, b) -> ((k * x) + b)" ] - wait_for_cluster(n_shards, chi_name, cluster) + wait_for_cluster(chi_name, cluster, n_shards) with Then("Create schema objects"): for q in create_ddls: @@ -2674,6 +2684,8 @@ def test_026(self): ) with When("Cluster is ready"): + wait_for_cluster(chi, 'default', 1, 2) + with Then("Check that first replica has one disk"): out = clickhouse.query( chi, @@ -3196,6 +3208,8 @@ def test_032(self): numbers = 100 + wait_for_cluster(chi, 'default', 2, 2) + with Given("Create replicated and distributed tables"): clickhouse.query(chi, create_table) clickhouse.query( @@ -3469,6 +3483,8 @@ def test_036(self): }, ) + wait_for_cluster(chi, cluster, 1, 2) + with And("I create replicated table with some data"): create_table = """ CREATE TABLE test_local_036 ON CLUSTER '{cluster}' (a UInt32) @@ -3691,6 +3707,8 @@ def test_039(self, step=0, delete_chi=0): }, ) + wait_for_cluster(chi, cluster, 2) + with When("I create distributed table that use secure port and insert data into it"): clickhouse.query( chi, @@ -3846,7 +3864,9 @@ def test_041(self): }, ) - with When("I create distributed table and insert data into it"): + wait_for_cluster(chi, cluster, 1, 2) + + with When("I create replicated table and insert data into it"): clickhouse.query( chi, "CREATE TABLE secure_repl on cluster '{cluster}' (a UInt32) " @@ -3855,24 +3875,18 @@ def test_041(self): ) clickhouse.query( chi, - "CREATE TABLE secure on cluster '{cluster}' (a UInt32) " - "ENGINE = MergeTree() PARTITION BY tuple() ORDER BY a" - ) - clickhouse.query( - chi, - "CREATE TABLE secure_dist on cluster '{cluster}' as secure " - "ENGINE = Distributed('{cluster}', default, secure, a%2)" - ) - clickhouse.query( - chi, - "INSERT INTO secure_dist select number as a from numbers(10)" + "INSERT INTO secure_repl select number as a from numbers(10)", + host = f"chi-{chi}-{cluster}-0-0-0" ) with Then("I check clickhouse can successfully connect to zookeeper"): clickhouse.query(chi, "SELECT * FROM system.zookeeper WHERE path = '/'") - with And("I check data is distributed"): - r = clickhouse.query(chi, "SELECT count(*) FROM secure_dist") + with And("I check data is replicated"): + r = clickhouse.query( + chi, + "SELECT count(*) FROM secure_repl", + host = f"chi-{chi}-{cluster}-0-1-0") assert r == "10" with And("I check connection is secured"): @@ -4079,7 +4093,7 @@ def test_044(self): with When("I create replicated table on the first replica"): clickhouse.query( chi, - """CREATE TABLE test_local ON CLUSTER 'default' (a UInt32) + """CREATE TABLE test_local (a UInt32) Engine = ReplicatedMergeTree('/clickhouse/{installation}/tables/{shard}/{database}/{table}', '{replica}') PARTITION BY tuple() ORDER BY a""" ) From 4189cab1d3f22ddc4c1c45e75d69104d12e4f7d6 Mon Sep 17 00:00:00 2001 From: alz Date: Fri, 24 Nov 2023 23:42:51 +0300 Subject: [PATCH 07/19] Fix waiting for cluster to be up when default user protected --- tests/e2e/test_operator.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/e2e/test_operator.py b/tests/e2e/test_operator.py index 40fc71912..7d43feb60 100644 --- a/tests/e2e/test_operator.py +++ b/tests/e2e/test_operator.py @@ -1255,7 +1255,7 @@ def get_shards_from_remote_servers(chi, cluster, shell=None): return chi_shards -def wait_for_cluster(chi, cluster, num_shards, num_replicas=0): +def wait_for_cluster(chi, cluster, num_shards, num_replicas=0, pwd=""): with Given(f"Cluster {cluster} is properly configured"): with By(f"remote_servers have {num_shards} shards"): assert num_shards == get_shards_from_remote_servers(chi, cluster) @@ -1266,11 +1266,13 @@ def wait_for_cluster(chi, cluster, num_shards, num_replicas=0): chi, f"select uniq(shard_num) from system.clusters where cluster ='{cluster}'", host=f"chi-{chi}-{cluster}-0-0", + pwd=pwd, ) replicas = clickhouse.query( chi, f"select uniq(replica_num) from system.clusters where cluster ='{cluster}'", host=f"chi-{chi}-{cluster}-0-0", + pwd=pwd, ) if shards == str(num_shards) and (num_replicas==0 or replicas == str(num_replicas)): break @@ -1280,11 +1282,13 @@ def wait_for_cluster(chi, cluster, num_shards, num_replicas=0): chi, f"select uniq(shard_num) from system.clusters where cluster ='{cluster}'", host=f"chi-{chi}-{cluster}-0-0", + pwd=pwd, ) assert num_replicas==0 or str(num_replicas) == clickhouse.query( chi, f"select uniq(replica_num) from system.clusters where cluster ='{cluster}'", host=f"chi-{chi}-{cluster}-0-0", + pwd=pwd, ) @TestScenario @@ -3707,7 +3711,7 @@ def test_039(self, step=0, delete_chi=0): }, ) - wait_for_cluster(chi, cluster, 2) + wait_for_cluster(chi, cluster, 2, pwd="qkrq") with When("I create distributed table that use secure port and insert data into it"): clickhouse.query( From 67e9c52195feb2ee6d7bd2cc4ea547f5bdc93fd9 Mon Sep 17 00:00:00 2001 From: alz Date: Sat, 25 Nov 2023 11:35:49 +0300 Subject: [PATCH 08/19] tests reliability --- tests/e2e/kubectl.py | 7 +++-- tests/e2e/test_operator.py | 53 ++++++++++++++++---------------------- 2 files changed, 25 insertions(+), 35 deletions(-) diff --git a/tests/e2e/kubectl.py b/tests/e2e/kubectl.py index e1fa9fdc5..060dbe397 100644 --- a/tests/e2e/kubectl.py +++ b/tests/e2e/kubectl.py @@ -133,13 +133,12 @@ def create_and_check(manifest, check, ns=None, shell=None, timeout=1800): apply_chi(util.get_full_path(manifest, False), ns=ns, timeout=timeout, shell=shell) - # Wait for reconcile to start before performing other checks. In some cases it does not start, so we can pass - # wait_field_changed("chi", chi_name, state_field, prev_state, ns) - wait_chi_status(chi_name, "InProgress", ns=ns, retries=3, throw_error=False, shell=shell) - if "chi_status" in check: wait_chi_status(chi_name, check["chi_status"], ns=ns, shell=shell) else: + # Wait for reconcile to start before performing other checks. In some cases it does not start, so we can pass + # wait_field_changed("chi", chi_name, state_field, prev_state, ns) + wait_chi_status(chi_name, "InProgress", ns=ns, retries=3, throw_error=False, shell=shell) wait_chi_status(chi_name, "Completed", ns=ns, shell=shell) if "object_counts" in check: diff --git a/tests/e2e/test_operator.py b/tests/e2e/test_operator.py index 7d43feb60..9a049dd8b 100644 --- a/tests/e2e/test_operator.py +++ b/tests/e2e/test_operator.py @@ -146,7 +146,6 @@ def test_005(self): @TestScenario @Name("test_006. Test clickhouse version upgrade from one version to another using podTemplate change") -@Tags("NO_PARALLEL") @Requirements(RQ_SRS_026_ClickHouseOperator_Managing_VersionUpgrades("1.0")) def test_006(self): create_shell_namespace_clickhouse_template() @@ -1260,36 +1259,28 @@ def wait_for_cluster(chi, cluster, num_shards, num_replicas=0, pwd=""): with By(f"remote_servers have {num_shards} shards"): assert num_shards == get_shards_from_remote_servers(chi, cluster) with By(f"ClickHouse recognizes {num_shards} shards in the cluster"): - cnt = "" - for i in range(1, 10): - shards = clickhouse.query( - chi, - f"select uniq(shard_num) from system.clusters where cluster ='{cluster}'", - host=f"chi-{chi}-{cluster}-0-0", - pwd=pwd, - ) - replicas = clickhouse.query( - chi, - f"select uniq(replica_num) from system.clusters where cluster ='{cluster}'", - host=f"chi-{chi}-{cluster}-0-0", - pwd=pwd, - ) - if shards == str(num_shards) and (num_replicas==0 or replicas == str(num_replicas)): - break - with Then("Not ready. Wait for " + str(i * 5) + " seconds"): - time.sleep(i * 5) - assert str(num_shards) == clickhouse.query( - chi, - f"select uniq(shard_num) from system.clusters where cluster ='{cluster}'", - host=f"chi-{chi}-{cluster}-0-0", - pwd=pwd, - ) - assert num_replicas==0 or str(num_replicas) == clickhouse.query( - chi, - f"select uniq(replica_num) from system.clusters where cluster ='{cluster}'", - host=f"chi-{chi}-{cluster}-0-0", - pwd=pwd, - ) + for shard in range(1, num_shards): + shards = "" + replicas = "" + for i in range(1, 10): + shards = clickhouse.query( + chi, + f"select uniq(shard_num) from system.clusters where cluster ='{cluster}'", + host=f"chi-{chi}-{cluster}-{shard}-0", + pwd=pwd, + ) + replicas = clickhouse.query( + chi, + f"select uniq(replica_num) from system.clusters where cluster ='{cluster}'", + host=f"chi-{chi}-{cluster}-{shard}-0", + pwd=pwd, + ) + if shards == str(num_shards) and (num_replicas==0 or replicas == str(num_replicas)): + break + with Then("Not ready. Wait for " + str(i * 5) + " seconds"): + time.sleep(i * 5) + assert str(num_shards) == shards + assert num_replicas==0 or str(num_replicas) == replicas @TestScenario @Name("test_014_0. Test that schema is correctly propagated on replicas") From 64e64d51f21a723bdf78f61a569d73b57d0a6a08 Mon Sep 17 00:00:00 2001 From: alz Date: Sat, 25 Nov 2023 15:38:12 +0300 Subject: [PATCH 09/19] Fix test_026 --- tests/e2e/test_operator.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/e2e/test_operator.py b/tests/e2e/test_operator.py index 9a049dd8b..0f21dd48c 100644 --- a/tests/e2e/test_operator.py +++ b/tests/e2e/test_operator.py @@ -2700,7 +2700,13 @@ def test_026(self): with When("Create a table and generate several inserts"): clickhouse.query( chi, - sql="DROP TABLE IF EXISTS test_disks ON CLUSTER '{cluster}' SYNC; CREATE TABLE test_disks ON CLUSTER '{cluster}' (a Int64) Engine = ReplicatedMergeTree('/clickhouse/{installation}/tables/{shard}/{database}/{table}', '{replica}') PARTITION BY (a%10) ORDER BY a", + host="chi-test-026-mixed-replicas-default-0-0", + sql="CREATE TABLE test_disks (a Int64) Engine = ReplicatedMergeTree('/clickhouse/tables/{database}/{table}', '{replica}') PARTITION BY (a%10) ORDER BY a", + ) + clickhouse.query( + chi, + host="chi-test-026-mixed-replicas-default-0-1", + sql="CREATE TABLE test_disks (a Int64) Engine = ReplicatedMergeTree('/clickhouse/tables/{database}/{table}', '{replica}') PARTITION BY (a%10) ORDER BY a", ) clickhouse.query( chi, From 7e023fe84b4ff80295be1d68ffef099c592a6138 Mon Sep 17 00:00:00 2001 From: alz Date: Sat, 25 Nov 2023 23:50:43 +0300 Subject: [PATCH 10/19] Fix test_041 --- tests/e2e/test_operator.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/tests/e2e/test_operator.py b/tests/e2e/test_operator.py index 0f21dd48c..c1f5b89ce 100644 --- a/tests/e2e/test_operator.py +++ b/tests/e2e/test_operator.py @@ -1261,7 +1261,7 @@ def wait_for_cluster(chi, cluster, num_shards, num_replicas=0, pwd=""): with By(f"ClickHouse recognizes {num_shards} shards in the cluster"): for shard in range(1, num_shards): shards = "" - replicas = "" + nodes = "" for i in range(1, 10): shards = clickhouse.query( chi, @@ -1269,18 +1269,20 @@ def wait_for_cluster(chi, cluster, num_shards, num_replicas=0, pwd=""): host=f"chi-{chi}-{cluster}-{shard}-0", pwd=pwd, ) - replicas = clickhouse.query( + nodes = clickhouse.query( chi, - f"select uniq(replica_num) from system.clusters where cluster ='{cluster}'", + "SELECT count() FROM cluster('all-sharded', cluster('all-sharded', system.one))", host=f"chi-{chi}-{cluster}-{shard}-0", pwd=pwd, - ) - if shards == str(num_shards) and (num_replicas==0 or replicas == str(num_replicas)): + ) + if shards == str(num_shards): + break + if num_replicas==0 or nodes == str(num_replicas*num_shards): break with Then("Not ready. Wait for " + str(i * 5) + " seconds"): time.sleep(i * 5) assert str(num_shards) == shards - assert num_replicas==0 or str(num_replicas) == replicas + assert nodes == str(num_replicas*num_shards) @TestScenario @Name("test_014_0. Test that schema is correctly propagated on replicas") @@ -3868,12 +3870,14 @@ def test_041(self): wait_for_cluster(chi, cluster, 1, 2) with When("I create replicated table and insert data into it"): - clickhouse.query( - chi, - "CREATE TABLE secure_repl on cluster '{cluster}' (a UInt32) " - "ENGINE = ReplicatedMergeTree('/clickhouse/{cluster}/tables/{uuid}', '{replica}') " - "PARTITION BY tuple() ORDER BY a" - ) + for r in [0,1]: + clickhouse.query( + chi, + host = f"chi-{chi}-{cluster}-0-{r}-0", + sql = "CREATE TABLE secure_repl (a UInt32) " + "ENGINE = ReplicatedMergeTree('/clickhouse/{cluster}/tables/{table}', '{replica}') " + "PARTITION BY tuple() ORDER BY a" + ) clickhouse.query( chi, "INSERT INTO secure_repl select number as a from numbers(10)", From 542bda1fbfb7d06a7c6c4e279f14fcc601314cdd Mon Sep 17 00:00:00 2001 From: alz Date: Sun, 26 Nov 2023 01:14:19 +0300 Subject: [PATCH 11/19] fix tests --- tests/e2e/test_operator.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/e2e/test_operator.py b/tests/e2e/test_operator.py index c1f5b89ce..cc807f4ac 100644 --- a/tests/e2e/test_operator.py +++ b/tests/e2e/test_operator.py @@ -1276,13 +1276,12 @@ def wait_for_cluster(chi, cluster, num_shards, num_replicas=0, pwd=""): pwd=pwd, ) if shards == str(num_shards): - break - if num_replicas==0 or nodes == str(num_replicas*num_shards): - break + if num_replicas==0 or nodes == str(num_replicas*num_shards): + break with Then("Not ready. Wait for " + str(i * 5) + " seconds"): time.sleep(i * 5) assert str(num_shards) == shards - assert nodes == str(num_replicas*num_shards) + assert num_replicas==0 or nodes == str(num_replicas*num_shards) @TestScenario @Name("test_014_0. Test that schema is correctly propagated on replicas") From 4b55a4809b96b9c5de967b2423775ed2a33831e0 Mon Sep 17 00:00:00 2001 From: alz Date: Sun, 26 Nov 2023 11:28:05 +0300 Subject: [PATCH 12/19] Remove distributed query check that fails in test_039 --- tests/e2e/test_operator.py | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/tests/e2e/test_operator.py b/tests/e2e/test_operator.py index cc807f4ac..d07b098bf 100644 --- a/tests/e2e/test_operator.py +++ b/tests/e2e/test_operator.py @@ -1259,9 +1259,8 @@ def wait_for_cluster(chi, cluster, num_shards, num_replicas=0, pwd=""): with By(f"remote_servers have {num_shards} shards"): assert num_shards == get_shards_from_remote_servers(chi, cluster) with By(f"ClickHouse recognizes {num_shards} shards in the cluster"): - for shard in range(1, num_shards): + for shard in range(num_shards): shards = "" - nodes = "" for i in range(1, 10): shards = clickhouse.query( chi, @@ -1269,19 +1268,28 @@ def wait_for_cluster(chi, cluster, num_shards, num_replicas=0, pwd=""): host=f"chi-{chi}-{cluster}-{shard}-0", pwd=pwd, ) - nodes = clickhouse.query( - chi, - "SELECT count() FROM cluster('all-sharded', cluster('all-sharded', system.one))", - host=f"chi-{chi}-{cluster}-{shard}-0", - pwd=pwd, - ) if shards == str(num_shards): - if num_replicas==0 or nodes == str(num_replicas*num_shards): - break + break; with Then("Not ready. Wait for " + str(i * 5) + " seconds"): time.sleep(i * 5) - assert str(num_shards) == shards - assert num_replicas==0 or nodes == str(num_replicas*num_shards) + assert shards == str(num_shards) + + if num_replicas>0: + with By(f"ClickHouse recognizes {num_replicas} replicas in the cluster"): + for replica in range(num_replicas): + replicas = "" + for i in range(1, 10): + replicas = clickhouse.query( + chi, + f"select uniq(replica_num) from system.clusters where cluster ='{cluster}'", + host=f"chi-{chi}-{cluster}-0-{replica}", + pwd=pwd, + ) + if replicas == str(num_replicas): + break + with Then("Not ready. Wait for " + str(i * 5) + " seconds"): + time.sleep(i * 5) + assert replicas == str(num_replicas) @TestScenario @Name("test_014_0. Test that schema is correctly propagated on replicas") From c5565e6e51648b4ee4471f49696eef3fba9041c9 Mon Sep 17 00:00:00 2001 From: alz Date: Sun, 26 Nov 2023 16:14:25 +0300 Subject: [PATCH 13/19] Fix restart tests. Those can run in parallel --- .../e2e/manifests/chi/test-008-operator-restart-3-1.yaml | 8 +++++++- .../e2e/manifests/chi/test-008-operator-restart-3-2.yaml | 8 +++++++- tests/e2e/test_operator.py | 3 --- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/tests/e2e/manifests/chi/test-008-operator-restart-3-1.yaml b/tests/e2e/manifests/chi/test-008-operator-restart-3-1.yaml index c9718675a..e3b2d9fe5 100644 --- a/tests/e2e/manifests/chi/test-008-operator-restart-3-1.yaml +++ b/tests/e2e/manifests/chi/test-008-operator-restart-3-1.yaml @@ -7,7 +7,6 @@ metadata: spec: useTemplates: - name: persistent-volume - - name: clickhouse-version configuration: zookeeper: nodes: @@ -25,3 +24,10 @@ spec: templates: dataVolumeClaimTemplate: default podTemplate: default + templates: + podTemplates: + - name: default + spec: + containers: + - name: clickhouse-pod + image: clickhouse/clickhouse-server:22.8 \ No newline at end of file diff --git a/tests/e2e/manifests/chi/test-008-operator-restart-3-2.yaml b/tests/e2e/manifests/chi/test-008-operator-restart-3-2.yaml index c9718675a..1a6d06eb9 100644 --- a/tests/e2e/manifests/chi/test-008-operator-restart-3-2.yaml +++ b/tests/e2e/manifests/chi/test-008-operator-restart-3-2.yaml @@ -7,7 +7,6 @@ metadata: spec: useTemplates: - name: persistent-volume - - name: clickhouse-version configuration: zookeeper: nodes: @@ -25,3 +24,10 @@ spec: templates: dataVolumeClaimTemplate: default podTemplate: default + templates: + podTemplates: + - name: default + spec: + containers: + - name: clickhouse-pod + image: clickhouse/clickhouse-server:23.8 \ No newline at end of file diff --git a/tests/e2e/test_operator.py b/tests/e2e/test_operator.py index d07b098bf..0be2bf036 100644 --- a/tests/e2e/test_operator.py +++ b/tests/e2e/test_operator.py @@ -454,7 +454,6 @@ def check_remote_servers(self, chi, shards, trigger_event, shell=None, cluster=" @TestScenario @Name("test_008_1. Test operator restart") -@Tags("NO_PARALLEL") @Requirements(RQ_SRS_026_ClickHouseOperator_Managing_RestartingOperator("1.0")) def test_008_1(self): create_shell_namespace_clickhouse_template() @@ -472,7 +471,6 @@ def test_008_1(self): @TestScenario @Name("test_008_2. Test operator restart") -@Tags("NO_PARALLEL") def test_008_2(self): create_shell_namespace_clickhouse_template() @@ -489,7 +487,6 @@ def test_008_2(self): @TestScenario @Name("test_008_3. Test operator restart in the middle of reconcile") -@Tags("NO_PARALLEL") def test_008_3(self): create_shell_namespace_clickhouse_template() From b46a9890676edc40866db585f88560ab1b96048a Mon Sep 17 00:00:00 2001 From: alz Date: Sun, 26 Nov 2023 22:40:53 +0300 Subject: [PATCH 14/19] Fix test_036 --- tests/e2e/kubectl.py | 5 ++++- tests/e2e/test_operator.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/e2e/kubectl.py b/tests/e2e/kubectl.py index 060dbe397..6370db7fe 100644 --- a/tests/e2e/kubectl.py +++ b/tests/e2e/kubectl.py @@ -214,9 +214,12 @@ def get_count(kind, name="", label="", chi="", ns=None, shell=None): if chi != "" and label == "": label = f"-l clickhouse.altinity.com/chi={chi}" + if ns == None: + ns = current().context.test_namespace + if kind == "pv": # pv is not namespaced so need to search namespace in claimRef - out = launch(f'get pv {label} -o yaml | grep "namespace: {current().context.test_namespace}"', ok_to_fail=True, shell=shell) + out = launch(f'get pv {label} -o yaml | grep "namespace: {ns}"', ok_to_fail=True, shell=shell) else: out = launch( f"get {kind} {name} -o=custom-columns=kind:kind,name:.metadata.name {label}", diff --git a/tests/e2e/test_operator.py b/tests/e2e/test_operator.py index 0be2bf036..88d410f3f 100644 --- a/tests/e2e/test_operator.py +++ b/tests/e2e/test_operator.py @@ -3466,7 +3466,6 @@ def check_metrics_monitoring(operator_namespace, operator_pod, expect_pattern, m @TestScenario @Requirements(RQ_SRS_026_ClickHouseOperator_Managing_ReprovisioningVolume("1.0")) @Name("test_036. Check operator volume re-provisioning") -@Tags("NO_PARALLEL") def test_036(self): """Check clickhouse operator recreates volumes and schema if volume is broken.""" create_shell_namespace_clickhouse_template() @@ -3478,6 +3477,7 @@ def test_036(self): manifest = f"manifests/chi/test-036-volume-re-provisioning-1.yaml" chi = yaml_manifest.get_chi_name(util.get_full_path(manifest)) + cluster = "simple" util.require_keeper(keeper_type=self.context.keeper_type) with Given("chi exists"): From b84e083bd237439731be0570ab7b3bbe0a19d384 Mon Sep 17 00:00:00 2001 From: Vladislav Klimenko Date: Wed, 29 Nov 2023 18:29:18 +0300 Subject: [PATCH 15/19] dev: update CRD with enums spec --- ...ll-yaml-template-01-section-crd-01-chi-chit.yaml | 13 +++++++++++++ ...ll-yaml-template-01-section-crd-02-chopconf.yaml | 1 + ...mplate-04-section-deployment-with-configmap.yaml | 2 ++ ...install-yaml-template-04-section-deployment.yaml | 2 ++ 4 files changed, 18 insertions(+) diff --git a/deploy/builder/templates-install-bundle/clickhouse-operator-install-yaml-template-01-section-crd-01-chi-chit.yaml b/deploy/builder/templates-install-bundle/clickhouse-operator-install-yaml-template-01-section-crd-01-chi-chit.yaml index 9a2c6b4bc..7117e5050 100644 --- a/deploy/builder/templates-install-bundle/clickhouse-operator-install-yaml-template-01-section-crd-01-chi-chit.yaml +++ b/deploy/builder/templates-install-bundle/clickhouse-operator-install-yaml-template-01-section-crd-01-chi-chit.yaml @@ -149,11 +149,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -162,6 +164,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -170,6 +173,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -195,16 +199,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -225,11 +232,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -313,6 +322,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -350,6 +360,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -598,6 +609,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -605,6 +617,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" diff --git a/deploy/builder/templates-install-bundle/clickhouse-operator-install-yaml-template-01-section-crd-02-chopconf.yaml b/deploy/builder/templates-install-bundle/clickhouse-operator-install-yaml-template-01-section-crd-02-chopconf.yaml index 24f3f5ce0..a78e2d3c7 100644 --- a/deploy/builder/templates-install-bundle/clickhouse-operator-install-yaml-template-01-section-crd-02-chopconf.yaml +++ b/deploy/builder/templates-install-bundle/clickhouse-operator-install-yaml-template-01-section-crd-02-chopconf.yaml @@ -203,6 +203,7 @@ spec: - ReadOnStart. Accept CHIT updates on the operators start only. - ApplyOnNextReconcile. Accept CHIT updates at all time. Apply news CHITs on next regular reconcile of the CHI enum: + - "" - "ReadOnStart" - "ApplyOnNextReconcile" path: diff --git a/deploy/builder/templates-install-bundle/clickhouse-operator-install-yaml-template-04-section-deployment-with-configmap.yaml b/deploy/builder/templates-install-bundle/clickhouse-operator-install-yaml-template-04-section-deployment-with-configmap.yaml index d036737f9..af1f0a97b 100644 --- a/deploy/builder/templates-install-bundle/clickhouse-operator-install-yaml-template-04-section-deployment-with-configmap.yaml +++ b/deploy/builder/templates-install-bundle/clickhouse-operator-install-yaml-template-04-section-deployment-with-configmap.yaml @@ -29,6 +29,8 @@ spec: annotations: prometheus.io/port: '8888' prometheus.io/scrape: 'true' + clickhouse-operator-metrics/port: '9999' + clickhouse-operator-metrics/scrape: 'true' spec: serviceAccountName: clickhouse-operator volumes: diff --git a/deploy/builder/templates-install-bundle/clickhouse-operator-install-yaml-template-04-section-deployment.yaml b/deploy/builder/templates-install-bundle/clickhouse-operator-install-yaml-template-04-section-deployment.yaml index 0602be6d8..74d06a42d 100644 --- a/deploy/builder/templates-install-bundle/clickhouse-operator-install-yaml-template-04-section-deployment.yaml +++ b/deploy/builder/templates-install-bundle/clickhouse-operator-install-yaml-template-04-section-deployment.yaml @@ -29,6 +29,8 @@ spec: annotations: prometheus.io/port: '8888' prometheus.io/scrape: 'true' + clickhouse-operator-metrics/port: '9999' + clickhouse-operator-metrics/scrape: 'true' spec: serviceAccountName: clickhouse-operator containers: From dd5bd9bc0812bb9834dd3bdd55ca64911c41e7b3 Mon Sep 17 00:00:00 2001 From: Vladislav Klimenko Date: Wed, 29 Nov 2023 18:35:01 +0300 Subject: [PATCH 16/19] env: manifests --- deploy/helm/README.md | 2 +- ...installations.clickhouse.altinity.com.yaml | 13 +++++++++ ...tiontemplates.clickhouse.altinity.com.yaml | 13 +++++++++ ...onfigurations.clickhouse.altinity.com.yaml | 1 + deploy/helm/values.yaml | 2 ++ .../clickhouse-operator-install-ansible.yaml | 29 +++++++++++++++++++ ...house-operator-install-bundle-v1beta1.yaml | 29 +++++++++++++++++++ .../clickhouse-operator-install-bundle.yaml | 29 +++++++++++++++++++ ...use-operator-install-template-v1beta1.yaml | 29 +++++++++++++++++++ .../clickhouse-operator-install-template.yaml | 29 +++++++++++++++++++ .../clickhouse-operator-install-tf.yaml | 29 +++++++++++++++++++ deploy/operator/parts/crd.yaml | 27 +++++++++++++++++ 12 files changed, 231 insertions(+), 1 deletion(-) diff --git a/deploy/helm/README.md b/deploy/helm/README.md index 990c6d039..8293f4278 100644 --- a/deploy/helm/README.md +++ b/deploy/helm/README.md @@ -49,7 +49,7 @@ For upgrade please install CRDs separately: | operator.image.repository | string | `"altinity/clickhouse-operator"` | image repository | | operator.image.tag | string | `""` | image tag (chart's appVersion value will be used if not set) | | operator.resources | object | `{}` | custom resource configuration | -| podAnnotations | object | `{"prometheus.io/port":"8888","prometheus.io/scrape":"true"}` | annotations to add to the pod | +| podAnnotations | object | `{"clickhouse-operator-metrics/port":"9999","clickhouse-operator-metrics/scrape":"true","prometheus.io/port":"8888","prometheus.io/scrape":"true"}` | annotations to add to the pod | | podSecurityContext | object | `{}` | | | secret.create | bool | `true` | create a secret with operator credentials | | secret.password | string | `"clickhouse_operator_password"` | operator credentials password | diff --git a/deploy/helm/crds/CustomResourceDefinition-clickhouseinstallations.clickhouse.altinity.com.yaml b/deploy/helm/crds/CustomResourceDefinition-clickhouseinstallations.clickhouse.altinity.com.yaml index c3abc4645..f80c0f8de 100644 --- a/deploy/helm/crds/CustomResourceDefinition-clickhouseinstallations.clickhouse.altinity.com.yaml +++ b/deploy/helm/crds/CustomResourceDefinition-clickhouseinstallations.clickhouse.altinity.com.yaml @@ -145,11 +145,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -158,6 +160,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -166,6 +169,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -191,16 +195,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -221,11 +228,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -309,6 +318,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -346,6 +356,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -594,6 +605,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -601,6 +613,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" diff --git a/deploy/helm/crds/CustomResourceDefinition-clickhouseinstallationtemplates.clickhouse.altinity.com.yaml b/deploy/helm/crds/CustomResourceDefinition-clickhouseinstallationtemplates.clickhouse.altinity.com.yaml index be634b9b6..659dd9849 100644 --- a/deploy/helm/crds/CustomResourceDefinition-clickhouseinstallationtemplates.clickhouse.altinity.com.yaml +++ b/deploy/helm/crds/CustomResourceDefinition-clickhouseinstallationtemplates.clickhouse.altinity.com.yaml @@ -145,11 +145,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -158,6 +160,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -166,6 +169,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -191,16 +195,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -221,11 +228,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -309,6 +318,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -346,6 +356,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -594,6 +605,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -601,6 +613,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" diff --git a/deploy/helm/crds/CustomResourceDefinition-clickhouseoperatorconfigurations.clickhouse.altinity.com.yaml b/deploy/helm/crds/CustomResourceDefinition-clickhouseoperatorconfigurations.clickhouse.altinity.com.yaml index 082362cd5..676481a41 100644 --- a/deploy/helm/crds/CustomResourceDefinition-clickhouseoperatorconfigurations.clickhouse.altinity.com.yaml +++ b/deploy/helm/crds/CustomResourceDefinition-clickhouseoperatorconfigurations.clickhouse.altinity.com.yaml @@ -203,6 +203,7 @@ spec: - ReadOnStart. Accept CHIT updates on the operators start only. - ApplyOnNextReconcile. Accept CHIT updates at all time. Apply news CHITs on next regular reconcile of the CHI enum: + - "" - "ReadOnStart" - "ApplyOnNextReconcile" path: diff --git a/deploy/helm/values.yaml b/deploy/helm/values.yaml index bc0da389c..627181fa1 100644 --- a/deploy/helm/values.yaml +++ b/deploy/helm/values.yaml @@ -68,6 +68,8 @@ imagePullSecrets: [] podAnnotations: prometheus.io/port: '8888' prometheus.io/scrape: 'true' + clickhouse-operator-metrics/port: '9999' + clickhouse-operator-metrics/scrape: 'true' # nameOverride -- override name of the chart nameOverride: "" diff --git a/deploy/operator/clickhouse-operator-install-ansible.yaml b/deploy/operator/clickhouse-operator-install-ansible.yaml index dd95d17f5..3c40b38c2 100644 --- a/deploy/operator/clickhouse-operator-install-ansible.yaml +++ b/deploy/operator/clickhouse-operator-install-ansible.yaml @@ -156,11 +156,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -169,6 +171,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -177,6 +180,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -202,16 +206,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -232,11 +239,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -320,6 +329,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -357,6 +367,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -605,6 +616,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -612,6 +624,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" @@ -1343,11 +1356,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -1356,6 +1371,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -1364,6 +1380,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -1389,16 +1406,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -1419,11 +1439,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -1507,6 +1529,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -1544,6 +1567,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -1792,6 +1816,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -1799,6 +1824,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" @@ -2584,6 +2610,7 @@ spec: - ReadOnStart. Accept CHIT updates on the operators start only. - ApplyOnNextReconcile. Accept CHIT updates at all time. Apply news CHITs on next regular reconcile of the CHI enum: + - "" - "ReadOnStart" - "ApplyOnNextReconcile" path: @@ -3670,6 +3697,8 @@ spec: annotations: prometheus.io/port: '8888' prometheus.io/scrape: 'true' + clickhouse-operator-metrics/port: '9999' + clickhouse-operator-metrics/scrape: 'true' spec: serviceAccountName: clickhouse-operator volumes: diff --git a/deploy/operator/clickhouse-operator-install-bundle-v1beta1.yaml b/deploy/operator/clickhouse-operator-install-bundle-v1beta1.yaml index d241c4fac..ef45a8953 100644 --- a/deploy/operator/clickhouse-operator-install-bundle-v1beta1.yaml +++ b/deploy/operator/clickhouse-operator-install-bundle-v1beta1.yaml @@ -141,11 +141,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -154,6 +156,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -162,6 +165,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -187,16 +191,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -217,11 +224,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -305,6 +314,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -342,6 +352,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -590,6 +601,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -597,6 +609,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" @@ -1316,11 +1329,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -1329,6 +1344,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -1337,6 +1353,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -1362,16 +1379,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -1392,11 +1412,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -1480,6 +1502,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -1517,6 +1540,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -1765,6 +1789,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -1772,6 +1797,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" @@ -2551,6 +2577,7 @@ spec: - ReadOnStart. Accept CHIT updates on the operators start only. - ApplyOnNextReconcile. Accept CHIT updates at all time. Apply news CHITs on next regular reconcile of the CHI enum: + - "" - "ReadOnStart" - "ApplyOnNextReconcile" path: @@ -3622,6 +3649,8 @@ spec: annotations: prometheus.io/port: '8888' prometheus.io/scrape: 'true' + clickhouse-operator-metrics/port: '9999' + clickhouse-operator-metrics/scrape: 'true' spec: serviceAccountName: clickhouse-operator volumes: diff --git a/deploy/operator/clickhouse-operator-install-bundle.yaml b/deploy/operator/clickhouse-operator-install-bundle.yaml index 12a9e8191..8674aad1a 100644 --- a/deploy/operator/clickhouse-operator-install-bundle.yaml +++ b/deploy/operator/clickhouse-operator-install-bundle.yaml @@ -149,11 +149,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -162,6 +164,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -170,6 +173,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -195,16 +199,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -225,11 +232,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -313,6 +322,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -350,6 +360,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -598,6 +609,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -605,6 +617,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" @@ -1336,11 +1349,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -1349,6 +1364,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -1357,6 +1373,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -1382,16 +1399,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -1412,11 +1432,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -1500,6 +1522,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -1537,6 +1560,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -1785,6 +1809,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -1792,6 +1817,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" @@ -2577,6 +2603,7 @@ spec: - ReadOnStart. Accept CHIT updates on the operators start only. - ApplyOnNextReconcile. Accept CHIT updates at all time. Apply news CHITs on next regular reconcile of the CHI enum: + - "" - "ReadOnStart" - "ApplyOnNextReconcile" path: @@ -3663,6 +3690,8 @@ spec: annotations: prometheus.io/port: '8888' prometheus.io/scrape: 'true' + clickhouse-operator-metrics/port: '9999' + clickhouse-operator-metrics/scrape: 'true' spec: serviceAccountName: clickhouse-operator volumes: diff --git a/deploy/operator/clickhouse-operator-install-template-v1beta1.yaml b/deploy/operator/clickhouse-operator-install-template-v1beta1.yaml index 5f6afb645..0148d40c8 100644 --- a/deploy/operator/clickhouse-operator-install-template-v1beta1.yaml +++ b/deploy/operator/clickhouse-operator-install-template-v1beta1.yaml @@ -141,11 +141,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -154,6 +156,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -162,6 +165,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -187,16 +191,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -217,11 +224,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -305,6 +314,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -342,6 +352,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -590,6 +601,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -597,6 +609,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" @@ -1316,11 +1329,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -1329,6 +1344,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -1337,6 +1353,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -1362,16 +1379,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -1392,11 +1412,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -1480,6 +1502,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -1517,6 +1540,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -1765,6 +1789,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -1772,6 +1797,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" @@ -2551,6 +2577,7 @@ spec: - ReadOnStart. Accept CHIT updates on the operators start only. - ApplyOnNextReconcile. Accept CHIT updates at all time. Apply news CHITs on next regular reconcile of the CHI enum: + - "" - "ReadOnStart" - "ApplyOnNextReconcile" path: @@ -3622,6 +3649,8 @@ spec: annotations: prometheus.io/port: '8888' prometheus.io/scrape: 'true' + clickhouse-operator-metrics/port: '9999' + clickhouse-operator-metrics/scrape: 'true' spec: serviceAccountName: clickhouse-operator volumes: diff --git a/deploy/operator/clickhouse-operator-install-template.yaml b/deploy/operator/clickhouse-operator-install-template.yaml index 8d5760c22..5c7035540 100644 --- a/deploy/operator/clickhouse-operator-install-template.yaml +++ b/deploy/operator/clickhouse-operator-install-template.yaml @@ -149,11 +149,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -162,6 +164,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -170,6 +173,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -195,16 +199,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -225,11 +232,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -313,6 +322,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -350,6 +360,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -598,6 +609,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -605,6 +617,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" @@ -1336,11 +1349,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -1349,6 +1364,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -1357,6 +1373,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -1382,16 +1399,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -1412,11 +1432,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -1500,6 +1522,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -1537,6 +1560,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -1785,6 +1809,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -1792,6 +1817,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" @@ -2577,6 +2603,7 @@ spec: - ReadOnStart. Accept CHIT updates on the operators start only. - ApplyOnNextReconcile. Accept CHIT updates at all time. Apply news CHITs on next regular reconcile of the CHI enum: + - "" - "ReadOnStart" - "ApplyOnNextReconcile" path: @@ -3663,6 +3690,8 @@ spec: annotations: prometheus.io/port: '8888' prometheus.io/scrape: 'true' + clickhouse-operator-metrics/port: '9999' + clickhouse-operator-metrics/scrape: 'true' spec: serviceAccountName: clickhouse-operator volumes: diff --git a/deploy/operator/clickhouse-operator-install-tf.yaml b/deploy/operator/clickhouse-operator-install-tf.yaml index b43fb9d55..6d2640fac 100644 --- a/deploy/operator/clickhouse-operator-install-tf.yaml +++ b/deploy/operator/clickhouse-operator-install-tf.yaml @@ -156,11 +156,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -169,6 +171,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -177,6 +180,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -202,16 +206,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -232,11 +239,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -320,6 +329,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -357,6 +367,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -605,6 +616,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -612,6 +624,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" @@ -1343,11 +1356,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -1356,6 +1371,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -1364,6 +1380,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -1389,16 +1406,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -1419,11 +1439,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -1507,6 +1529,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -1544,6 +1567,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -1792,6 +1816,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -1799,6 +1824,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" @@ -2584,6 +2610,7 @@ spec: - ReadOnStart. Accept CHIT updates on the operators start only. - ApplyOnNextReconcile. Accept CHIT updates at all time. Apply news CHITs on next regular reconcile of the CHI enum: + - "" - "ReadOnStart" - "ApplyOnNextReconcile" path: @@ -3670,6 +3697,8 @@ spec: annotations: prometheus.io/port: '8888' prometheus.io/scrape: 'true' + clickhouse-operator-metrics/port: '9999' + clickhouse-operator-metrics/scrape: 'true' spec: serviceAccountName: clickhouse-operator volumes: diff --git a/deploy/operator/parts/crd.yaml b/deploy/operator/parts/crd.yaml index c7249054a..9a71a670e 100644 --- a/deploy/operator/parts/crd.yaml +++ b/deploy/operator/parts/crd.yaml @@ -149,11 +149,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -162,6 +164,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -170,6 +173,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -195,16 +199,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -225,11 +232,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -313,6 +322,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -350,6 +360,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -598,6 +609,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -605,6 +617,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" @@ -1336,11 +1349,13 @@ spec: taskIDsStarted: type: array description: "Started task ids" + nullable: true items: type: string taskIDsCompleted: type: array description: "Completed task ids" + nullable: true items: type: string action: @@ -1349,6 +1364,7 @@ spec: actions: type: array description: "Actions" + nullable: true items: type: string error: @@ -1357,6 +1373,7 @@ spec: errors: type: array description: "Errors" + nullable: true items: type: string hostsUpdated: @@ -1382,16 +1399,19 @@ spec: pods: type: array description: "Pods" + nullable: true items: type: string pod-ips: type: array description: "Pod IPs" + nullable: true items: type: string fqdns: type: array description: "Pods FQDNs" + nullable: true items: type: string endpoint: @@ -1412,11 +1432,13 @@ spec: hostsWithTablesCreated: type: array description: "List of hosts with tables created by the operator" + nullable: true items: type: string usedTemplates: type: array description: "List of templates used to build this CHI" + nullable: true x-kubernetes-preserve-unknown-fields: true items: type: object @@ -1500,6 +1522,7 @@ spec: will be auto-added into ClickHouseInstallation, selectable by `chiSelector`. Default value is `manual`, meaning ClickHouseInstallation should request this ClickhouseInstallationTemplate explicitly. enum: + - "" - "auto" - "manual" chiSelector: @@ -1537,6 +1560,7 @@ spec: description: "behavior policy for unknown StatefulSet, Delete by default" enum: # List ObjectsCleanupXXX constants from model + - "" - "Retain" - "Delete" pvc: @@ -1785,6 +1809,7 @@ spec: description: "how schema is propagated within a replica" enum: # List SchemaPolicyReplicaXXX constants from model + - "" - "None" - "All" shard: @@ -1792,6 +1817,7 @@ spec: description: "how schema is propagated between shards" enum: # List SchemaPolicyShardXXX constants from model + - "" - "None" - "All" - "DistributedTablesOnly" @@ -2577,6 +2603,7 @@ spec: - ReadOnStart. Accept CHIT updates on the operators start only. - ApplyOnNextReconcile. Accept CHIT updates at all time. Apply news CHITs on next regular reconcile of the CHI enum: + - "" - "ReadOnStart" - "ApplyOnNextReconcile" path: From 853577190b7b41b9716f996bebb9a18b6afe541e Mon Sep 17 00:00:00 2001 From: Vladislav Klimenko Date: Wed, 29 Nov 2023 21:25:04 +0300 Subject: [PATCH 17/19] dev: introduce Aborted CHI status --- pkg/apis/clickhouse.altinity.com/v1/const.go | 1 + pkg/apis/clickhouse.altinity.com/v1/type_status.go | 12 ++++++++++++ pkg/controller/chi/worker-chi-reconciler.go | 2 +- pkg/controller/chi/worker.go | 10 ++++++++-- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/pkg/apis/clickhouse.altinity.com/v1/const.go b/pkg/apis/clickhouse.altinity.com/v1/const.go index 47d944c8e..2fceff892 100644 --- a/pkg/apis/clickhouse.altinity.com/v1/const.go +++ b/pkg/apis/clickhouse.altinity.com/v1/const.go @@ -22,6 +22,7 @@ package v1 const ( StatusInProgress = "InProgress" StatusCompleted = "Completed" + StatusAborted = "Aborted" StatusTerminating = "Terminating" ) diff --git a/pkg/apis/clickhouse.altinity.com/v1/type_status.go b/pkg/apis/clickhouse.altinity.com/v1/type_status.go index 6d135d87d..44534f7a8 100644 --- a/pkg/apis/clickhouse.altinity.com/v1/type_status.go +++ b/pkg/apis/clickhouse.altinity.com/v1/type_status.go @@ -286,6 +286,18 @@ func (s *ChiStatus) ReconcileComplete() { }) } +// ReconcileAbort marks reconcile abortion +func (s *ChiStatus) ReconcileAbort() { + doWithWriteLock(s, func(s *ChiStatus) { + if s == nil { + return + } + s.Status = StatusAborted + s.Action = "" + pushTaskIDCompletedNoSync(s) + }) +} + // DeleteStart marks deletion start func (s *ChiStatus) DeleteStart() { doWithWriteLock(s, func(s *ChiStatus) { diff --git a/pkg/controller/chi/worker-chi-reconciler.go b/pkg/controller/chi/worker-chi-reconciler.go index 609f41462..8109b19e9 100644 --- a/pkg/controller/chi/worker-chi-reconciler.go +++ b/pkg/controller/chi/worker-chi-reconciler.go @@ -103,7 +103,7 @@ func (w *worker) reconcileCHI(ctx context.Context, old, new *chiV1.ClickHouseIns WithStatusError(new). M(new).F(). Error("FAILED to reconcile CHI err: %v", err) - w.markReconcileCompletedUnsuccessfully(ctx, new) + w.markReconcileCompletedUnsuccessfully(ctx, new, err) } else { // Post-process added items if util.IsContextDone(ctx) { diff --git a/pkg/controller/chi/worker.go b/pkg/controller/chi/worker.go index 3a5a8bece..2ac5edf94 100644 --- a/pkg/controller/chi/worker.go +++ b/pkg/controller/chi/worker.go @@ -16,6 +16,7 @@ package chi import ( "context" + "errors" "fmt" "time" @@ -692,13 +693,18 @@ func (w *worker) finalizeReconcileAndMarkCompleted(ctx context.Context, _chi *ch Info("reconcile completed successfully, task id: %s", _chi.Spec.GetTaskID()) } -func (w *worker) markReconcileCompletedUnsuccessfully(ctx context.Context, chi *chiV1.ClickHouseInstallation) { +func (w *worker) markReconcileCompletedUnsuccessfully(ctx context.Context, chi *chiV1.ClickHouseInstallation, err error) { if util.IsContextDone(ctx) { log.V(2).Info("task is done") return } - chi.EnsureStatus().ReconcileComplete() + switch { + case err == nil: + chi.EnsureStatus().ReconcileComplete() + case errors.Is(err, errCRUDAbort): + chi.EnsureStatus().ReconcileAbort() + } w.c.updateCHIObjectStatus(ctx, chi, UpdateCHIStatusOptions{ CopyCHIStatusOptions: chiV1.CopyCHIStatusOptions{ MainFields: true, From ad3d5001c9e4b96c9feca16c80e55e376fd9e629 Mon Sep 17 00:00:00 2001 From: Maksym Pavlov <3435678+maxistua@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:20:25 +0100 Subject: [PATCH 18/19] Fix shard weight. Now we can set it to zero (#1192) * Shard weight can be set to zero (cherry picked from commit 5033f9ec8af4c237e3df97297721c0f50297e03d) --- pkg/apis/clickhouse.altinity.com/v1/types.go | 2 +- pkg/model/ch_config_generator.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/apis/clickhouse.altinity.com/v1/types.go b/pkg/apis/clickhouse.altinity.com/v1/types.go index 76da7bc10..382e2ec57 100644 --- a/pkg/apis/clickhouse.altinity.com/v1/types.go +++ b/pkg/apis/clickhouse.altinity.com/v1/types.go @@ -571,7 +571,7 @@ type ChiTemplateNames struct { // TODO unify with ChiReplica based on HostsSet type ChiShard struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` - Weight int `json:"weight,omitempty" yaml:"weight,omitempty"` + Weight *int `json:"weight,omitempty" yaml:"weight,omitempty"` InternalReplication *StringBool `json:"internalReplication,omitempty" yaml:"internalReplication,omitempty"` Settings *Settings `json:"settings,omitempty" yaml:"settings,omitempty"` Files *Settings `json:"files,omitempty" yaml:"files,omitempty"` diff --git a/pkg/model/ch_config_generator.go b/pkg/model/ch_config_generator.go index 0b3f92ba0..bcec8902c 100644 --- a/pkg/model/ch_config_generator.go +++ b/pkg/model/ch_config_generator.go @@ -361,8 +361,8 @@ func (c *ClickHouseConfigGenerator) GetRemoteServers(options *RemoteServersGener util.Iline(b, 16, "%s", shard.InternalReplication) // X - if shard.Weight > 0 { - util.Iline(b, 16, "%d", shard.Weight) + if shard.Weight != nil && *shard.Weight >= 0 { + util.Iline(b, 16, "%d", *shard.Weight) } shard.WalkHosts(func(host *chiv1.ChiHost) error { From bb1a5db2066673cad771fbcbddda216c7c84bc58 Mon Sep 17 00:00:00 2001 From: alz Date: Thu, 30 Nov 2023 10:23:23 +0300 Subject: [PATCH 19/19] Fix test_042 for Aborted status --- tests/e2e/test_operator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/test_operator.py b/tests/e2e/test_operator.py index 88d410f3f..ea2d13f4e 100644 --- a/tests/e2e/test_operator.py +++ b/tests/e2e/test_operator.py @@ -3944,7 +3944,7 @@ def test_042(self): ) with Then("Operator should apply changes, and both pods should be created"): - kubectl.wait_chi_status(chi, "Completed", retries=20) + kubectl.wait_chi_status(chi, "Aborted", retries=20) kubectl.wait_objects(chi, {"statefulset": 2, "pod": 2, "service": 3}) with And("First node is in CrashLoopBackOff"): @@ -3973,7 +3973,7 @@ def test_042(self): ) with Then("Operator should apply changes, and both pods should be created"): - kubectl.wait_chi_status(chi, "Completed", retries=20) + kubectl.wait_chi_status(chi, "Aborted", retries=20) kubectl.wait_objects(chi, {"statefulset": 2, "pod": 2, "service": 3}) with And("First node is in CrashLoopBackOff"):