From a73ccc55b430daeb4523bf1e88b837233ab7566d Mon Sep 17 00:00:00 2001 From: artemvmin Date: Thu, 21 Mar 2024 15:32:58 -0700 Subject: [PATCH] Wait for gmp-operator rollout before applying kuberay podmonitorings (#418) --- applications/rag/main.tf | 2 ++ applications/rag/versions.tf | 4 ++++ applications/ray/main.tf | 2 ++ applications/ray/versions.tf | 4 ++++ modules/kuberay-monitoring/main.tf | 7 +++++++ modules/kuberay-monitoring/versions.tf | 4 ++++ 6 files changed, 23 insertions(+) diff --git a/applications/rag/main.tf b/applications/rag/main.tf index 04c0ccd41..75083cec8 100644 --- a/applications/rag/main.tf +++ b/applications/rag/main.tf @@ -19,6 +19,8 @@ provider "google-beta" { project = var.project_id } +provider "time" {} + data "google_client_config" "default" {} data "google_project" "project" { diff --git a/applications/rag/versions.tf b/applications/rag/versions.tf index b8e6f2c71..db72286a9 100644 --- a/applications/rag/versions.tf +++ b/applications/rag/versions.tf @@ -28,5 +28,9 @@ terraform { source = "hashicorp/kubernetes" version = "2.18.1" } + time = { + source = "hashicorp/time" + version = "0.11.1" + } } } diff --git a/applications/ray/main.tf b/applications/ray/main.tf index 3717d929c..4d6918e88 100644 --- a/applications/ray/main.tf +++ b/applications/ray/main.tf @@ -20,6 +20,8 @@ provider "google" { project = var.project_id } +provider "time" {} + data "google_client_config" "default" {} data "google_project" "project" { diff --git a/applications/ray/versions.tf b/applications/ray/versions.tf index b8e6f2c71..db72286a9 100644 --- a/applications/ray/versions.tf +++ b/applications/ray/versions.tf @@ -28,5 +28,9 @@ terraform { source = "hashicorp/kubernetes" version = "2.18.1" } + time = { + source = "hashicorp/time" + version = "0.11.1" + } } } diff --git a/modules/kuberay-monitoring/main.tf b/modules/kuberay-monitoring/main.tf index 8a320ec81..acb865c56 100644 --- a/modules/kuberay-monitoring/main.tf +++ b/modules/kuberay-monitoring/main.tf @@ -12,6 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Temporary workaround to ensure the GMP webhook is installed before applying PodMonitorings. +resource "time_sleep" "wait_for_gmp_operator" { + create_duration = "10s" +} + # google managed prometheus engine resource "helm_release" "gmp-engine" { name = "gmp-engine" @@ -29,6 +34,8 @@ resource "helm_release" "gmp-engine" { name = "serviceAccount" value = var.k8s_service_account } + + depends_on = [time_sleep.wait_for_gmp_operator] } # grafana diff --git a/modules/kuberay-monitoring/versions.tf b/modules/kuberay-monitoring/versions.tf index 8784b626e..c4b0b8337 100644 --- a/modules/kuberay-monitoring/versions.tf +++ b/modules/kuberay-monitoring/versions.tf @@ -22,5 +22,9 @@ terraform { source = "hashicorp/kubernetes" version = "2.18.1" } + time = { + source = "hashicorp/time" + version = "0.11.1" + } } }