From 45869ad76429f62ace1310d9e0ee4ac1b6d2f745 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Fri, 21 Apr 2023 14:47:38 +0000 Subject: [PATCH 1/3] CockroachDB database - CLUSTER mode: - Updated Cockroach Operator from v2.9.0 to v2.10.0 - Updated CockroachDB from v22.2.0 to v22.2.8 - Updated per-node requested and limit resources --- .../cockroachdb/client-secure-operator.yaml | 4 +- manifests/cockroachdb/cluster.yaml | 15 +- manifests/cockroachdb/crds.yaml | 268 ++++++++++++++++-- manifests/cockroachdb/operator.yaml | 30 +- 4 files changed, 288 insertions(+), 29 deletions(-) diff --git a/manifests/cockroachdb/client-secure-operator.yaml b/manifests/cockroachdb/client-secure-operator.yaml index f7f81c833..ee3afbc5a 100644 --- a/manifests/cockroachdb/client-secure-operator.yaml +++ b/manifests/cockroachdb/client-secure-operator.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ spec: serviceAccountName: cockroachdb-sa containers: - name: cockroachdb-client-secure - image: cockroachdb/cockroach:v22.2.0 + image: cockroachdb/cockroach:v22.2.8 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/manifests/cockroachdb/cluster.yaml b/manifests/cockroachdb/cluster.yaml index b618c6f17..4d9ef0f84 100644 --- a/manifests/cockroachdb/cluster.yaml +++ b/manifests/cockroachdb/cluster.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -33,17 +33,16 @@ spec: resources: requests: # This is intentionally low to make it work on local k3d clusters. - cpu: 100m - memory: 1Gi - limits: - cpu: 1 + cpu: 4 memory: 4Gi + limits: + cpu: 8 + memory: 8Gi tlsEnabled: true # You can set either a version of the db or a specific image name -# cockroachDBVersion: v22.2.0 +# cockroachDBVersion: v22.2.8 image: - #name: cockroachdb/cockroach:v22.2.0 - name: cockroachdb/cockroach:latest-v22.2 + name: cockroachdb/cockroach:v22.2.8 # nodes refers to the number of crdb pods that are created # via the statefulset nodes: 3 diff --git a/manifests/cockroachdb/crds.yaml b/manifests/cockroachdb/crds.yaml index 1b5cd89ae..2ef998392 100644 --- a/manifests/cockroachdb/crds.yaml +++ b/manifests/cockroachdb/crds.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -354,10 +354,71 @@ spec: The requirements are ANDed. type: object type: object + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces field. + null selector and null or empty namespaces list + means "this pod's namespace". An empty selector + ({}) matches all namespaces. This field is alpha-level + and is only honored when PodAffinityNamespaceSelector + feature is enabled. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. + type: object + type: object namespaces: - description: namespaces specifies which namespaces - the labelSelector applies to (matches against); - null or empty list means "this pod's namespace" + description: namespaces specifies a static list + of namespace names that the term applies to. The + term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces list + and null namespaceSelector means "this pod's namespace" items: type: string type: array @@ -449,10 +510,66 @@ spec: requirements are ANDed. type: object type: object + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied to the + union of the namespaces selected by this field and + the ones listed in the namespaces field. null selector + and null or empty namespaces list means "this pod's + namespace". An empty selector ({}) matches all namespaces. + This field is alpha-level and is only honored when + PodAffinityNamespaceSelector feature is enabled. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object namespaces: - description: namespaces specifies which namespaces the - labelSelector applies to (matches against); null or - empty list means "this pod's namespace" + description: namespaces specifies a static list of namespace + names that the term applies to. The term is applied + to the union of the namespaces listed in this field + and the ones selected by namespaceSelector. null or + empty namespaces list and null namespaceSelector means + "this pod's namespace" items: type: string type: array @@ -546,10 +663,71 @@ spec: The requirements are ANDed. type: object type: object + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces field. + null selector and null or empty namespaces list + means "this pod's namespace". An empty selector + ({}) matches all namespaces. This field is alpha-level + and is only honored when PodAffinityNamespaceSelector + feature is enabled. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. + type: object + type: object namespaces: - description: namespaces specifies which namespaces - the labelSelector applies to (matches against); - null or empty list means "this pod's namespace" + description: namespaces specifies a static list + of namespace names that the term applies to. The + term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces list + and null namespaceSelector means "this pod's namespace" items: type: string type: array @@ -641,10 +819,66 @@ spec: requirements are ANDed. type: object type: object + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied to the + union of the namespaces selected by this field and + the ones listed in the namespaces field. null selector + and null or empty namespaces list means "this pod's + namespace". An empty selector ({}) matches all namespaces. + This field is alpha-level and is only honored when + PodAffinityNamespaceSelector feature is enabled. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object namespaces: - description: namespaces specifies which namespaces the - labelSelector applies to (matches against); null or - empty list means "this pod's namespace" + description: namespaces specifies a static list of namespace + names that the term applies to. The term is applied + to the union of the namespaces listed in this field + and the ones selected by namespaceSelector. null or + empty namespaces list and null namespaceSelector means + "this pod's namespace" items: type: string type: array @@ -767,7 +1001,7 @@ spec: pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Limits describes the maximum amount - of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object requests: additionalProperties: @@ -780,7 +1014,7 @@ spec: of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined - value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object selector: @@ -1138,7 +1372,7 @@ spec: pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Limits describes the maximum amount of compute resources - allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object requests: additionalProperties: @@ -1150,7 +1384,7 @@ spec: description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise - to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object sqlPort: diff --git a/manifests/cockroachdb/operator.yaml b/manifests/cockroachdb/operator.yaml index 2be72d329..59d515061 100644 --- a/manifests/cockroachdb/operator.yaml +++ b/manifests/cockroachdb/operator.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -538,8 +538,34 @@ spec: value: cockroachdb/cockroach:v22.1.11 - name: RELATED_IMAGE_COCKROACH_v22_1_12 value: cockroachdb/cockroach:v22.1.12 + - name: RELATED_IMAGE_COCKROACH_v22_1_13 + value: cockroachdb/cockroach:v22.1.13 + - name: RELATED_IMAGE_COCKROACH_v22_1_14 + value: cockroachdb/cockroach:v22.1.14 + - name: RELATED_IMAGE_COCKROACH_v22_1_15 + value: cockroachdb/cockroach:v22.1.15 + - name: RELATED_IMAGE_COCKROACH_v22_1_16 + value: cockroachdb/cockroach:v22.1.16 + - name: RELATED_IMAGE_COCKROACH_v22_1_18 + value: cockroachdb/cockroach:v22.1.18 - name: RELATED_IMAGE_COCKROACH_v22_2_0 value: cockroachdb/cockroach:v22.2.0 + - name: RELATED_IMAGE_COCKROACH_v22_2_1 + value: cockroachdb/cockroach:v22.2.1 + - name: RELATED_IMAGE_COCKROACH_v22_2_2 + value: cockroachdb/cockroach:v22.2.2 + - name: RELATED_IMAGE_COCKROACH_v22_2_3 + value: cockroachdb/cockroach:v22.2.3 + - name: RELATED_IMAGE_COCKROACH_v22_2_4 + value: cockroachdb/cockroach:v22.2.4 + - name: RELATED_IMAGE_COCKROACH_v22_2_5 + value: cockroachdb/cockroach:v22.2.5 + - name: RELATED_IMAGE_COCKROACH_v22_2_6 + value: cockroachdb/cockroach:v22.2.6 + - name: RELATED_IMAGE_COCKROACH_v22_2_7 + value: cockroachdb/cockroach:v22.2.7 + - name: RELATED_IMAGE_COCKROACH_v22_2_8 + value: cockroachdb/cockroach:v22.2.8 - name: OPERATOR_NAME value: cockroachdb - name: WATCH_NAMESPACE @@ -552,7 +578,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: cockroachdb/cockroach-operator:v2.9.0 + image: cockroachdb/cockroach-operator:v2.10.0 imagePullPolicy: IfNotPresent name: cockroach-operator resources: -- GitLab From 78c29ce97d551ed697364d2e2b704af2829d1d8f Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Fri, 21 Apr 2023 14:49:48 +0000 Subject: [PATCH 2/3] Deploy specs: - Defined cluster-mode specs for testing --- my_deploy.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/my_deploy.sh b/my_deploy.sh index d6f3513e9..dca379481 100755 --- a/my_deploy.sh +++ b/my_deploy.sh @@ -60,13 +60,13 @@ export CRDB_DATABASE="tfs" # Set CockroachDB installation mode to 'single'. This option is convenient for development and testing. # See ./deploy/all.sh or ./deploy/crdb.sh for additional details -export CRDB_DEPLOY_MODE="single" +export CRDB_DEPLOY_MODE="cluster" # Disable flag for dropping database, if it exists. -export CRDB_DROP_DATABASE_IF_EXISTS="" +export CRDB_DROP_DATABASE_IF_EXISTS="YES" # Disable flag for re-deploying CockroachDB from scratch. -export CRDB_REDEPLOY="" +export CRDB_REDEPLOY="YES" # ----- NATS ------------------------------------------------------------------- @@ -111,10 +111,10 @@ export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis" export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups" # Disable flag for dropping tables if they exist. -export QDB_DROP_TABLES_IF_EXIST="" +export QDB_DROP_TABLES_IF_EXIST="YES" # Disable flag for re-deploying QuestDB from scratch. -export QDB_REDEPLOY="" +export QDB_REDEPLOY="YES" # ----- K8s Observability ------------------------------------------------------ -- GitLab From 065b9255c82b5429644fe82af8ab13ff0e2e94c4 Mon Sep 17 00:00:00 2001 From: Lluis Gifre Renom Date: Wed, 26 Apr 2023 13:43:26 +0000 Subject: [PATCH 3/3] - Removed test-specific values --- my_deploy.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/my_deploy.sh b/my_deploy.sh index dca379481..d6f3513e9 100755 --- a/my_deploy.sh +++ b/my_deploy.sh @@ -60,13 +60,13 @@ export CRDB_DATABASE="tfs" # Set CockroachDB installation mode to 'single'. This option is convenient for development and testing. # See ./deploy/all.sh or ./deploy/crdb.sh for additional details -export CRDB_DEPLOY_MODE="cluster" +export CRDB_DEPLOY_MODE="single" # Disable flag for dropping database, if it exists. -export CRDB_DROP_DATABASE_IF_EXISTS="YES" +export CRDB_DROP_DATABASE_IF_EXISTS="" # Disable flag for re-deploying CockroachDB from scratch. -export CRDB_REDEPLOY="YES" +export CRDB_REDEPLOY="" # ----- NATS ------------------------------------------------------------------- @@ -111,10 +111,10 @@ export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis" export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups" # Disable flag for dropping tables if they exist. -export QDB_DROP_TABLES_IF_EXIST="YES" +export QDB_DROP_TABLES_IF_EXIST="" # Disable flag for re-deploying QuestDB from scratch. -export QDB_REDEPLOY="YES" +export QDB_REDEPLOY="" # ----- K8s Observability ------------------------------------------------------ -- GitLab