From b9d3eed02c21b4af9dab79730cc10e1cdfae43a3 Mon Sep 17 00:00:00 2001
From: gifrerenom <lluis.gifre@cttc.es>
Date: Fri, 31 Mar 2023 11:55:36 +0000
Subject: [PATCH] Deploy Scripts:

- Craete CockroachDB Operator Namespace in advance to prevent issues with Linkerd
---
 deploy/crdb.sh                          |  5 +++++
 manifests/cockroachdb/pre_operator.yaml | 19 +++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 manifests/cockroachdb/pre_operator.yaml

diff --git a/deploy/crdb.sh b/deploy/crdb.sh
index 216339117..414de523d 100755
--- a/deploy/crdb.sh
+++ b/deploy/crdb.sh
@@ -167,6 +167,11 @@ function crdb_drop_database_single() {
 }
 
 function crdb_deploy_cluster() {
+    echo "CockroachDB Operator Namespace"
+    echo ">>> Create CockroachDB Operator Namespace (if missing)"
+    kubectl apply -f "${CRDB_MANIFESTS_PATH}/pre_operator.yaml"
+    echo
+
     echo "Cockroach Operator CRDs"
     echo ">>> Apply Cockroach Operator CRDs (if they are missing)"
     cp "${CRDB_MANIFESTS_PATH}/crds.yaml" "${TMP_MANIFESTS_FOLDER}/crdb_crds.yaml"
diff --git a/manifests/cockroachdb/pre_operator.yaml b/manifests/cockroachdb/pre_operator.yaml
new file mode 100644
index 000000000..16718a779
--- /dev/null
+++ b/manifests/cockroachdb/pre_operator.yaml
@@ -0,0 +1,19 @@
+# Copyright 2022 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.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+apiVersion: v1
+kind: Namespace
+metadata:
+  labels:
+    control-plane: cockroach-operator
+  name: cockroach-operator-system
-- 
GitLab