From 04152d9484dc3649f4e46bb6778bd0795d0b5434 Mon Sep 17 00:00:00 2001 From: rayanebel Date: Fri, 26 Jan 2024 17:13:34 +0100 Subject: [PATCH] fix: issue in google module when creating a fresh cluster in 1.27 (#2557) * fix: replace deprecated gavinbunney/kubectl provider * fix iam by replacing modules/storage_buckets_iam with google_storage_bucket_iam_member resources --------- Co-authored-by: Rayane Bellazaar --- README.md | 30 ++++++------ modules/aws/README.md | 38 +++++++-------- modules/aws/versions.tf | 4 +- modules/azure/README.md | 30 ++++++------ modules/azure/version.tf | 4 +- modules/google/README.md | 29 +++++++----- modules/google/kube-prometheus.tf | 25 +++++----- modules/google/thanos.tf | 79 ++++++++++++++++++++++--------- modules/google/versions.tf | 4 +- modules/scaleway/README.md | 22 ++++----- modules/scaleway/versions.tf | 4 +- versions.tf | 4 +- 12 files changed, 155 insertions(+), 118 deletions(-) diff --git a/README.md b/README.md index 7f9134263..83a0caab0 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ here](https://github.com/particuleio/terraform-kubernetes-addons/blob/master/.gi | [github](#requirement\_github) | ~> 5.0 | | [helm](#requirement\_helm) | ~> 2.0 | | [http](#requirement\_http) | >= 3 | -| [kubectl](#requirement\_kubectl) | ~> 1.0 | +| [kubectl](#requirement\_kubectl) | ~> 2.0 | | [kubernetes](#requirement\_kubernetes) | ~> 2.0, != 2.12 | | [tls](#requirement\_tls) | ~> 4.0 | @@ -98,7 +98,7 @@ here](https://github.com/particuleio/terraform-kubernetes-addons/blob/master/.gi | [github](#provider\_github) | ~> 5.0 | | [helm](#provider\_helm) | ~> 2.0 | | [http](#provider\_http) | >= 3 | -| [kubectl](#provider\_kubectl) | ~> 1.0 | +| [kubectl](#provider\_kubectl) | ~> 2.0 | | [kubernetes](#provider\_kubernetes) | ~> 2.0, != 2.12 | | [random](#provider\_random) | n/a | | [time](#provider\_time) | n/a | @@ -140,14 +140,14 @@ No modules. | [helm_release.tigera-operator](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.traefik](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.victoria-metrics-k8s-stack](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [kubectl_manifest.calico_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.cert-manager_cluster_issuers](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.csi-external-snapshotter](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.kong_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.linkerd](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.linkerd-viz](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.prometheus-operator_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.tigera-operator_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.calico_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.cert-manager_cluster_issuers](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.csi-external-snapshotter](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.kong_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.linkerd](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.linkerd-viz](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.prometheus-operator_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.tigera-operator_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | | [kubernetes_config_map.loki-stack_grafana_ds](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/config_map) | resource | | [kubernetes_namespace.admiralty](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | | [kubernetes_namespace.cert-manager](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | @@ -261,11 +261,11 @@ No modules. | [http_http.prometheus-operator_crds](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source | | [http_http.prometheus-operator_version](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source | | [http_http.tigera-operator_crds](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source | -| [kubectl_file_documents.calico_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source | -| [kubectl_file_documents.csi-external-snapshotter](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source | -| [kubectl_file_documents.kong_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source | -| [kubectl_file_documents.tigera-operator_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source | -| [kubectl_path_documents.cert-manager_cluster_issuers](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/path_documents) | data source | +| [kubectl_file_documents.calico_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/file_documents) | data source | +| [kubectl_file_documents.csi-external-snapshotter](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/file_documents) | data source | +| [kubectl_file_documents.kong_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/file_documents) | data source | +| [kubectl_file_documents.tigera-operator_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/file_documents) | data source | +| [kubectl_path_documents.cert-manager_cluster_issuers](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/path_documents) | data source | ## Inputs diff --git a/modules/aws/README.md b/modules/aws/README.md index 8d2c0799a..a73491cd7 100644 --- a/modules/aws/README.md +++ b/modules/aws/README.md @@ -26,7 +26,7 @@ This module can uses [IRSA](https://aws.amazon.com/blogs/opensource/introducing- | [github](#requirement\_github) | ~> 5.0 | | [helm](#requirement\_helm) | ~> 2.0 | | [http](#requirement\_http) | >= 3 | -| [kubectl](#requirement\_kubectl) | ~> 1.0 | +| [kubectl](#requirement\_kubectl) | ~> 2.0 | | [kubernetes](#requirement\_kubernetes) | ~> 2.0, != 2.12 | | [tls](#requirement\_tls) | ~> 4.0 | @@ -39,7 +39,7 @@ This module can uses [IRSA](https://aws.amazon.com/blogs/opensource/introducing- | [github](#provider\_github) | ~> 5.0 | | [helm](#provider\_helm) | ~> 2.0 | | [http](#provider\_http) | >= 3 | -| [kubectl](#provider\_kubectl) | ~> 1.0 | +| [kubectl](#provider\_kubectl) | ~> 2.0 | | [kubernetes](#provider\_kubernetes) | ~> 2.0, != 2.12 | | [random](#provider\_random) | n/a | | [time](#provider\_time) | n/a | @@ -142,17 +142,17 @@ This module can uses [IRSA](https://aws.amazon.com/blogs/opensource/introducing- | [helm_release.velero](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.victoria-metrics-k8s-stack](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.yet-another-cloudwatch-exporter](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [kubectl_manifest.aws-ebs-csi-driver_vsc](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.calico_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.cert-manager_cluster_issuers](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.cni-metrics-helper](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.csi-external-snapshotter](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.kong_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.linkerd](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.linkerd-viz](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.prometheus-operator_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.secrets-store-csi-driver-provider-aws](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.tigera-operator_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.aws-ebs-csi-driver_vsc](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.calico_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.cert-manager_cluster_issuers](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.cni-metrics-helper](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.csi-external-snapshotter](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.kong_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.linkerd](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.linkerd-viz](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.prometheus-operator_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.secrets-store-csi-driver-provider-aws](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.tigera-operator_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | | [kubernetes_config_map.loki-stack_grafana_ds](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/config_map) | resource | | [kubernetes_namespace.admiralty](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | | [kubernetes_namespace.aws-ebs-csi-driver](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | @@ -341,12 +341,12 @@ This module can uses [IRSA](https://aws.amazon.com/blogs/opensource/introducing- | [http_http.prometheus-operator_version](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source | | [http_http.secrets-store-csi-driver-provider-aws](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source | | [http_http.tigera-operator_crds](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source | -| [kubectl_file_documents.calico_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source | -| [kubectl_file_documents.csi-external-snapshotter](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source | -| [kubectl_file_documents.kong_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source | -| [kubectl_file_documents.secrets-store-csi-driver-provider-aws](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source | -| [kubectl_file_documents.tigera-operator_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source | -| [kubectl_path_documents.cert-manager_cluster_issuers](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/path_documents) | data source | +| [kubectl_file_documents.calico_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/file_documents) | data source | +| [kubectl_file_documents.csi-external-snapshotter](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/file_documents) | data source | +| [kubectl_file_documents.kong_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/file_documents) | data source | +| [kubectl_file_documents.secrets-store-csi-driver-provider-aws](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/file_documents) | data source | +| [kubectl_file_documents.tigera-operator_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/file_documents) | data source | +| [kubectl_path_documents.cert-manager_cluster_issuers](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/path_documents) | data source | ## Inputs diff --git a/modules/aws/versions.tf b/modules/aws/versions.tf index f0b9e0427..3c60bc952 100644 --- a/modules/aws/versions.tf +++ b/modules/aws/versions.tf @@ -5,8 +5,8 @@ terraform { helm = "~> 2.0" kubernetes = "~> 2.0, != 2.12" kubectl = { - source = "gavinbunney/kubectl" - version = "~> 1.0" + source = "alekc/kubectl" + version = "~> 2.0" } flux = { source = "fluxcd/flux" diff --git a/modules/azure/README.md b/modules/azure/README.md index 53b7daf9c..bd639cf36 100644 --- a/modules/azure/README.md +++ b/modules/azure/README.md @@ -13,7 +13,7 @@ Provides various Kubernetes addons that are often used on Kubernetes with Azure | [github](#requirement\_github) | ~> 5.0 | | [helm](#requirement\_helm) | ~> 2.0 | | [http](#requirement\_http) | >= 3 | -| [kubectl](#requirement\_kubectl) | ~> 1.0 | +| [kubectl](#requirement\_kubectl) | ~> 2.0 | | [kubernetes](#requirement\_kubernetes) | ~> 2.0, != 2.12 | | [tls](#requirement\_tls) | ~> 4.0 | @@ -25,7 +25,7 @@ Provides various Kubernetes addons that are often used on Kubernetes with Azure | [github](#provider\_github) | ~> 5.0 | | [helm](#provider\_helm) | ~> 2.0 | | [http](#provider\_http) | >= 3 | -| [kubectl](#provider\_kubectl) | ~> 1.0 | +| [kubectl](#provider\_kubectl) | ~> 2.0 | | [kubernetes](#provider\_kubernetes) | ~> 2.0, != 2.12 | | [random](#provider\_random) | n/a | | [time](#provider\_time) | n/a | @@ -65,14 +65,14 @@ No modules. | [helm_release.tigera-operator](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.traefik](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.victoria-metrics-k8s-stack](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [kubectl_manifest.calico_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.cert-manager_cluster_issuers](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.csi-external-snapshotter](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.kong_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.linkerd](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.linkerd-viz](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.prometheus-operator_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.tigera-operator_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.calico_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.cert-manager_cluster_issuers](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.csi-external-snapshotter](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.kong_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.linkerd](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.linkerd-viz](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.prometheus-operator_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.tigera-operator_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | | [kubernetes_config_map.loki-stack_grafana_ds](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/config_map) | resource | | [kubernetes_namespace.admiralty](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | | [kubernetes_namespace.cert-manager](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | @@ -171,11 +171,11 @@ No modules. | [http_http.prometheus-operator_crds](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source | | [http_http.prometheus-operator_version](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source | | [http_http.tigera-operator_crds](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source | -| [kubectl_file_documents.calico_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source | -| [kubectl_file_documents.csi-external-snapshotter](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source | -| [kubectl_file_documents.kong_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source | -| [kubectl_file_documents.tigera-operator_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source | -| [kubectl_path_documents.cert-manager_cluster_issuers](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/path_documents) | data source | +| [kubectl_file_documents.calico_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/file_documents) | data source | +| [kubectl_file_documents.csi-external-snapshotter](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/file_documents) | data source | +| [kubectl_file_documents.kong_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/file_documents) | data source | +| [kubectl_file_documents.tigera-operator_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/file_documents) | data source | +| [kubectl_path_documents.cert-manager_cluster_issuers](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/path_documents) | data source | ## Inputs diff --git a/modules/azure/version.tf b/modules/azure/version.tf index 298698e8d..5908621ff 100644 --- a/modules/azure/version.tf +++ b/modules/azure/version.tf @@ -5,8 +5,8 @@ terraform { helm = "~> 2.0" kubernetes = "~> 2.0, != 2.12" kubectl = { - source = "gavinbunney/kubectl" - version = "~> 1.0" + source = "alekc/kubectl" + version = "~> 2.0" } flux = { source = "fluxcd/flux" diff --git a/modules/google/README.md b/modules/google/README.md index 516e35260..71da4a841 100644 --- a/modules/google/README.md +++ b/modules/google/README.md @@ -24,7 +24,7 @@ Provides various Kubernetes addons that are often used on Kubernetes with GCP | [helm](#requirement\_helm) | ~> 2.0 | | [http](#requirement\_http) | >= 3 | | [jinja](#requirement\_jinja) | ~> 1.15 | -| [kubectl](#requirement\_kubectl) | ~> 1.0 | +| [kubectl](#requirement\_kubectl) | ~> 2.0 | | [kubernetes](#requirement\_kubernetes) | ~> 2.0, != 2.12 | | [tls](#requirement\_tls) | ~> 4.0 | @@ -38,7 +38,7 @@ Provides various Kubernetes addons that are often used on Kubernetes with GCP | [helm](#provider\_helm) | ~> 2.0 | | [http](#provider\_http) | >= 3 | | [jinja](#provider\_jinja) | ~> 1.15 | -| [kubectl](#provider\_kubectl) | ~> 1.0 | +| [kubectl](#provider\_kubectl) | ~> 2.0 | | [kubernetes](#provider\_kubernetes) | ~> 2.0, != 2.12 | | [random](#provider\_random) | n/a | | [time](#provider\_time) | n/a | @@ -59,14 +59,12 @@ Provides various Kubernetes addons that are often used on Kubernetes with GCP | [iam\_assumable\_sa\_thanos-storegateway](#module\_iam\_assumable\_sa\_thanos-storegateway) | terraform-google-modules/kubernetes-engine/google//modules/workload-identity | ~> 29.0 | | [kube-prometheus-stack\_grafana-iam-member](#module\_kube-prometheus-stack\_grafana-iam-member) | terraform-google-modules/iam/google//modules/member_iam | ~> 7.6 | | [kube-prometheus-stack\_kube-prometheus-stack\_bucket](#module\_kube-prometheus-stack\_kube-prometheus-stack\_bucket) | terraform-google-modules/cloud-storage/google//modules/simple_bucket | ~> 5.0 | -| [kube-prometheus-stack\_thanos\_bucket\_iam](#module\_kube-prometheus-stack\_thanos\_bucket\_iam) | terraform-google-modules/iam/google//modules/storage_buckets_iam | ~> 7.6 | | [kube-prometheus-stack\_thanos\_kms\_bucket](#module\_kube-prometheus-stack\_thanos\_kms\_bucket) | terraform-google-modules/kms/google | ~> 2.2 | | [loki-stack\_bucket](#module\_loki-stack\_bucket) | terraform-google-modules/cloud-storage/google//modules/simple_bucket | ~> 5.0 | | [loki-stack\_bucket\_iam](#module\_loki-stack\_bucket\_iam) | terraform-google-modules/iam/google//modules/storage_buckets_iam | ~> 7.6 | | [loki-stack\_kms\_bucket](#module\_loki-stack\_kms\_bucket) | terraform-google-modules/kms/google | ~> 2.2 | | [thanos-storegateway\_bucket\_iam](#module\_thanos-storegateway\_bucket\_iam) | terraform-google-modules/iam/google//modules/storage_buckets_iam | ~> 7.6 | | [thanos\_bucket](#module\_thanos\_bucket) | terraform-google-modules/cloud-storage/google//modules/simple_bucket | ~> 5.0 | -| [thanos\_bucket\_iam](#module\_thanos\_bucket\_iam) | terraform-google-modules/iam/google//modules/storage_buckets_iam | ~> 7.6 | | [thanos\_kms\_bucket](#module\_thanos\_kms\_bucket) | terraform-google-modules/kms/google | ~> 2.2 | ## Resources @@ -79,6 +77,15 @@ Provides various Kubernetes addons that are often used on Kubernetes with GCP | [github_repository_deploy_key.main](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_deploy_key) | resource | | [google_dns_managed_zone_iam_member.cert_manager_cloud_dns_iam_permissions](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/dns_managed_zone_iam_member) | resource | | [google_dns_managed_zone_iam_member.external_dns_cloud_dns_iam_permissions](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/dns_managed_zone_iam_member) | resource | +| [google_storage_bucket_iam_member.kube_prometheus_stack_thanos_bucket_objectAdmin_iam_permission](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket_iam_member) | resource | +| [google_storage_bucket_iam_member.kube_prometheus_stack_thanos_bucket_objectViewer_iam_permission](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket_iam_member) | resource | +| [google_storage_bucket_iam_member.thanos_compactor_gcs_iam_legacyBucketWriter_permissions](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket_iam_member) | resource | +| [google_storage_bucket_iam_member.thanos_compactor_gcs_iam_objectCreator_permissions](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket_iam_member) | resource | +| [google_storage_bucket_iam_member.thanos_compactor_gcs_iam_objectViewer_permissions](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket_iam_member) | resource | +| [google_storage_bucket_iam_member.thanos_gcs_iam_objectCreator_permissions](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket_iam_member) | resource | +| [google_storage_bucket_iam_member.thanos_gcs_iam_objectViewer_permissions](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket_iam_member) | resource | +| [google_storage_bucket_iam_member.thanos_sg_gcs_iam_objectCreator_permissions](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket_iam_member) | resource | +| [google_storage_bucket_iam_member.thanos_sg_gcs_iam_objectViewer_permissions](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket_iam_member) | resource | | [helm_release.admiralty](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.cert-manager](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.cert-manager-csi-driver](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | @@ -104,11 +111,11 @@ Provides various Kubernetes addons that are often used on Kubernetes with GCP | [helm_release.thanos-tls-querier](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.traefik](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.victoria-metrics-k8s-stack](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [kubectl_manifest.cert-manager_cluster_issuers](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.ip_masq_agent](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.linkerd](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.linkerd-viz](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.prometheus-operator_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.cert-manager_cluster_issuers](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.ip_masq_agent](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.linkerd](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.linkerd-viz](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.prometheus-operator_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | | [kubernetes_config_map.loki-stack_grafana_ds](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/config_map) | resource | | [kubernetes_namespace.admiralty](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | | [kubernetes_namespace.cert-manager](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | @@ -216,8 +223,8 @@ Provides various Kubernetes addons that are often used on Kubernetes with GCP | [http_http.prometheus-operator_crds](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source | | [http_http.prometheus-operator_version](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source | | [jinja_template.cert-manager_cluster_issuers](https://registry.terraform.io/providers/NikolaLohinski/jinja/latest/docs/data-sources/template) | data source | -| [kubectl_file_documents.cert-manager_cluster_issuers](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source | -| [kubectl_filename_list.ip_masq_agent_manifests](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/filename_list) | data source | +| [kubectl_file_documents.cert-manager_cluster_issuers](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/file_documents) | data source | +| [kubectl_filename_list.ip_masq_agent_manifests](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/filename_list) | data source | ## Inputs diff --git a/modules/google/kube-prometheus.tf b/modules/google/kube-prometheus.tf index 86f418e58..9dded7b82 100644 --- a/modules/google/kube-prometheus.tf +++ b/modules/google/kube-prometheus.tf @@ -284,21 +284,18 @@ resource "kubernetes_secret" "kube-prometheus-stack_thanos" { } } -module "kube-prometheus-stack_thanos_bucket_iam" { - count = local.kube-prometheus-stack["enabled"] && local.kube-prometheus-stack["thanos_create_bucket"] ? 1 : 0 - source = "terraform-google-modules/iam/google//modules/storage_buckets_iam" - version = "~> 7.6" +resource "google_storage_bucket_iam_member" "kube_prometheus_stack_thanos_bucket_objectViewer_iam_permission" { + count = local.kube-prometheus-stack["enabled"] && local.kube-prometheus-stack["thanos_create_bucket"] ? 1 : 0 + bucket = module.kube-prometheus-stack_kube-prometheus-stack_bucket[0].name + role = "roles/storage.objectViewer" + member = "serviceAccount:${module.iam_assumable_sa_kube-prometheus-stack_thanos[0].gcp_service_account_email}" +} - mode = "additive" - storage_buckets = [module.kube-prometheus-stack_kube-prometheus-stack_bucket[0].name] - bindings = { - "roles/storage.objectViewer" = [ - "serviceAccount:${module.iam_assumable_sa_kube-prometheus-stack_thanos[0].gcp_service_account_email}" - ] - "roles/storage.objectAdmin" = [ - "serviceAccount:${module.iam_assumable_sa_kube-prometheus-stack_thanos[0].gcp_service_account_email}" - ] - } +resource "google_storage_bucket_iam_member" "kube_prometheus_stack_thanos_bucket_objectAdmin_iam_permission" { + count = local.kube-prometheus-stack["enabled"] && local.kube-prometheus-stack["thanos_create_bucket"] ? 1 : 0 + bucket = module.kube-prometheus-stack_kube-prometheus-stack_bucket[0].name + role = "roles/storage.objectAdmin" + member = "serviceAccount:${module.iam_assumable_sa_kube-prometheus-stack_thanos[0].gcp_service_account_email}" } module "kube-prometheus-stack_grafana-iam-member" { diff --git a/modules/google/thanos.tf b/modules/google/thanos.tf index 1f682cfcd..aee279cdd 100644 --- a/modules/google/thanos.tf +++ b/modules/google/thanos.tf @@ -27,6 +27,11 @@ locals { var.thanos ) + thanos_bucket = ( + local.kube-prometheus-stack["enabled"] && local.kube-prometheus-stack["thanos_create_bucket"] ? module.kube-prometheus-stack_kube-prometheus-stack_bucket[0].name : + local.thanos["create_bucket"] ? module.thanos_bucket[0] : local.thanos["bucket"] + ) + values_thanos = <<-VALUES receive: enabled: false @@ -170,7 +175,7 @@ locals { objstoreConfig: type: GCS config: - bucket: ${local.thanos["bucket"]} + bucket: ${local.thanos_bucket} VALUES values_thanos_global_requests = <<-VALUES @@ -276,28 +281,56 @@ module "thanos_kms_bucket" { ] } -module "thanos_bucket_iam" { - count = local.thanos["enabled"] ? 1 : 0 - source = "terraform-google-modules/iam/google//modules/storage_buckets_iam" - version = "~> 7.6" - - mode = "additive" - storage_buckets = [local.thanos["bucket"]] - bindings = { - "roles/storage.objectViewer" = [ - "serviceAccount:${module.iam_assumable_sa_thanos[0].gcp_service_account_email}", - "serviceAccount:${module.iam_assumable_sa_thanos-compactor[0].gcp_service_account_email}", - "serviceAccount:${module.iam_assumable_sa_thanos-sg[0].gcp_service_account_email}", - ] - "roles/storage.objectCreator" = [ - "serviceAccount:${module.iam_assumable_sa_thanos[0].gcp_service_account_email}", - "serviceAccount:${module.iam_assumable_sa_thanos-compactor[0].gcp_service_account_email}", - "serviceAccount:${module.iam_assumable_sa_thanos-sg[0].gcp_service_account_email}", - ] - "roles/storage.legacyBucketWriter" = [ - "serviceAccount:${module.iam_assumable_sa_thanos-compactor[0].gcp_service_account_email}", - ] - } +# GCS permissions for thanos service account +resource "google_storage_bucket_iam_member" "thanos_gcs_iam_objectViewer_permissions" { + count = local.thanos["enabled"] ? 1 : 0 + bucket = local.thanos_bucket + role = "roles/storage.objectViewer" + member = "serviceAccount:${module.iam_assumable_sa_thanos[0].gcp_service_account_email}" +} + +resource "google_storage_bucket_iam_member" "thanos_gcs_iam_objectCreator_permissions" { + count = local.thanos["enabled"] ? 1 : 0 + bucket = local.thanos_bucket + role = "roles/storage.objectCreator" + member = "serviceAccount:${module.iam_assumable_sa_thanos[0].gcp_service_account_email}" +} + +# GCS permissions for thanos compactor service account +resource "google_storage_bucket_iam_member" "thanos_compactor_gcs_iam_objectViewer_permissions" { + count = local.thanos["enabled"] ? 1 : 0 + bucket = local.thanos_bucket + role = "roles/storage.objectViewer" + member = "serviceAccount:${module.iam_assumable_sa_thanos-compactor[0].gcp_service_account_email}" +} + +resource "google_storage_bucket_iam_member" "thanos_compactor_gcs_iam_objectCreator_permissions" { + count = local.thanos["enabled"] ? 1 : 0 + bucket = local.thanos_bucket + role = "roles/storage.objectCreator" + member = "serviceAccount:${module.iam_assumable_sa_thanos-compactor[0].gcp_service_account_email}" +} + +resource "google_storage_bucket_iam_member" "thanos_compactor_gcs_iam_legacyBucketWriter_permissions" { + count = local.thanos["enabled"] ? 1 : 0 + bucket = local.thanos_bucket + role = "roles/storage.legacyBucketWriter" + member = "serviceAccount:${module.iam_assumable_sa_thanos-compactor[0].gcp_service_account_email}" +} + +# GCS permissions for thanos storage gateway service account +resource "google_storage_bucket_iam_member" "thanos_sg_gcs_iam_objectViewer_permissions" { + count = local.thanos["enabled"] ? 1 : 0 + bucket = local.thanos_bucket + role = "roles/storage.objectViewer" + member = "serviceAccount:${module.iam_assumable_sa_thanos-sg[0].gcp_service_account_email}" +} + +resource "google_storage_bucket_iam_member" "thanos_sg_gcs_iam_objectCreator_permissions" { + count = local.thanos["enabled"] ? 1 : 0 + bucket = local.thanos_bucket + role = "roles/storage.objectCreator" + member = "serviceAccount:${module.iam_assumable_sa_thanos-sg[0].gcp_service_account_email}" } resource "kubernetes_namespace" "thanos" { diff --git a/modules/google/versions.tf b/modules/google/versions.tf index fc2fc67bc..825504b07 100644 --- a/modules/google/versions.tf +++ b/modules/google/versions.tf @@ -6,8 +6,8 @@ terraform { helm = "~> 2.0" kubernetes = "~> 2.0, != 2.12" kubectl = { - source = "gavinbunney/kubectl" - version = "~> 1.0" + source = "alekc/kubectl" + version = "~> 2.0" } jinja = { source = "NikolaLohinski/jinja" diff --git a/modules/scaleway/README.md b/modules/scaleway/README.md index 2e5faf453..336e88a75 100644 --- a/modules/scaleway/README.md +++ b/modules/scaleway/README.md @@ -24,7 +24,7 @@ User guides, feature documentation and examples are available [here](https://git | [github](#requirement\_github) | ~> 5.0 | | [helm](#requirement\_helm) | ~> 2.0 | | [http](#requirement\_http) | >= 3 | -| [kubectl](#requirement\_kubectl) | ~> 1.0 | +| [kubectl](#requirement\_kubectl) | ~> 2.0 | | [kubernetes](#requirement\_kubernetes) | ~> 2.0, != 2.12 | | [scaleway](#requirement\_scaleway) | >= 2.2.0 | | [tls](#requirement\_tls) | ~> 4.0 | @@ -37,7 +37,7 @@ User guides, feature documentation and examples are available [here](https://git | [github](#provider\_github) | ~> 5.0 | | [helm](#provider\_helm) | ~> 2.0 | | [http](#provider\_http) | >= 3 | -| [kubectl](#provider\_kubectl) | ~> 1.0 | +| [kubectl](#provider\_kubectl) | ~> 2.0 | | [kubernetes](#provider\_kubernetes) | ~> 2.0, != 2.12 | | [random](#provider\_random) | n/a | | [scaleway](#provider\_scaleway) | >= 2.2.0 | @@ -82,12 +82,12 @@ No modules. | [helm_release.thanos-tls-querier](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.traefik](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.victoria-metrics-k8s-stack](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [kubectl_manifest.cert-manager_cluster_issuers](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.csi-external-snapshotter](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.kong_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.linkerd](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.linkerd-viz](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.prometheus-operator_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.cert-manager_cluster_issuers](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.csi-external-snapshotter](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.kong_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.linkerd](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.linkerd-viz](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.prometheus-operator_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource | | [kubernetes_config_map.loki-stack_grafana_ds](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/config_map) | resource | | [kubernetes_namespace.admiralty](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | | [kubernetes_namespace.cert-manager](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | @@ -203,9 +203,9 @@ No modules. | [http_http.kong_crds](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source | | [http_http.prometheus-operator_crds](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source | | [http_http.prometheus-operator_version](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source | -| [kubectl_file_documents.csi-external-snapshotter](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source | -| [kubectl_file_documents.kong_crds](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source | -| [kubectl_path_documents.cert-manager_cluster_issuers](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/path_documents) | data source | +| [kubectl_file_documents.csi-external-snapshotter](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/file_documents) | data source | +| [kubectl_file_documents.kong_crds](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/file_documents) | data source | +| [kubectl_path_documents.cert-manager_cluster_issuers](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/data-sources/path_documents) | data source | ## Inputs diff --git a/modules/scaleway/versions.tf b/modules/scaleway/versions.tf index d12d36cb1..1948ff0ce 100644 --- a/modules/scaleway/versions.tf +++ b/modules/scaleway/versions.tf @@ -4,8 +4,8 @@ terraform { helm = "~> 2.0" kubernetes = "~> 2.0, != 2.12" kubectl = { - source = "gavinbunney/kubectl" - version = "~> 1.0" + source = "alekc/kubectl" + version = "~> 2.0" } flux = { source = "fluxcd/flux" diff --git a/versions.tf b/versions.tf index 56fc0dfb2..bfb4c6cd8 100644 --- a/versions.tf +++ b/versions.tf @@ -4,8 +4,8 @@ terraform { helm = "~> 2.0" kubernetes = "~> 2.0, != 2.12" kubectl = { - source = "gavinbunney/kubectl" - version = "~> 1.0" + source = "alekc/kubectl" + version = "~> 2.0" } flux = { source = "fluxcd/flux"