2025-03-15 15:27:42 -04:00
|
|
|
terraform {
|
|
|
|
required_providers {
|
|
|
|
kubernetes = {
|
|
|
|
source = "hashicorp/kubernetes"
|
|
|
|
version = ">= 2.36.0"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-03-22 16:11:04 -04:00
|
|
|
variable "public_ingress" {
|
|
|
|
description = "Set to true to make the kubernetes ingresses exposed to the public internet."
|
|
|
|
type = bool
|
|
|
|
}
|
|
|
|
|
2025-03-15 15:27:42 -04:00
|
|
|
data "google_client_config" "default" {}
|
|
|
|
|
|
|
|
resource "kubernetes_cluster_role_binding" "cluster_admin_binding" {
|
|
|
|
metadata {
|
|
|
|
name = "cluster-admin-binding"
|
|
|
|
}
|
|
|
|
|
|
|
|
subject {
|
|
|
|
kind = "User"
|
|
|
|
name = data.google_client_config.default.id
|
|
|
|
}
|
|
|
|
|
|
|
|
role_ref {
|
|
|
|
api_group = "rbac.authorization.k8s.io"
|
|
|
|
kind = "ClusterRole"
|
|
|
|
name = "cluster-admin"
|
|
|
|
}
|
|
|
|
}
|