From f45d0657c8a70d24e85082df6a4adfc215cb806d Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Sat, 13 Apr 2024 18:34:04 +0200 Subject: [PATCH] switch kubernetes provider for annotation patching --- oci-managed/oke/longhorn.tf | 2 +- oci-managed/oke/provider.tf | 8 ++++---- oci-managed/provider.tf | 8 ++++++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/oci-managed/oke/longhorn.tf b/oci-managed/oke/longhorn.tf index 393fd68..864d8b7 100644 --- a/oci-managed/oke/longhorn.tf +++ b/oci-managed/oke/longhorn.tf @@ -14,10 +14,10 @@ resource "helm_release" "longhorn" { } resource "kubernetes_annotations" "patch_oci-bv" { - count = var.install_longhorn ? 1 : 0 depends_on = [helm_release.longhorn] api_version = "storage.k8s.io/v1" kind = "StorageClass" + force = true metadata { name = "oci-bv" diff --git a/oci-managed/oke/provider.tf b/oci-managed/oke/provider.tf index 09cf1d9..40539e9 100644 --- a/oci-managed/oke/provider.tf +++ b/oci-managed/oke/provider.tf @@ -2,15 +2,15 @@ terraform { required_providers { oci = { source = "oracle/oci" - version = ">= 5.36.0" + version = ">= 5.3.0" } helm = { source = "hashicorp/helm" version = ">= 2.12.1" } - kubectl = { - source = "gavinbunney/kubectl" - version = ">= 1.14.0" + kubernetes = { + source = "hashicorp/kubernetes" + version = ">= 2.28.0" } } } diff --git a/oci-managed/provider.tf b/oci-managed/provider.tf index df4131b..6a60893 100644 --- a/oci-managed/provider.tf +++ b/oci-managed/provider.tf @@ -12,6 +12,10 @@ terraform { source = "cloudflare/cloudflare" version = "~> 4.0" } + kubernetes = { + source = "hashicorp/kubernetes" + version = "2.28.0" + } kubectl = { source = "gavinbunney/kubectl" version = ">= 1.14.0" @@ -39,6 +43,10 @@ provider "cloudflare" { api_key = var.cloudflare_api_key } +provider "kubernetes" { + config_path = "oke/kubeconfig" +} + provider "kubectl" { config_path = "oke/kubeconfig" } \ No newline at end of file