diff --git a/.terraform.lock.hcl b/.terraform.lock.hcl index 0995426..14e12ff 100644 --- a/.terraform.lock.hcl +++ b/.terraform.lock.hcl @@ -2,42 +2,41 @@ # Manual edits may be lost in future updates. provider "registry.terraform.io/hashicorp/kubernetes" { - version = "2.24.0" - constraints = "2.24.0" + version = "2.25.0" + constraints = "2.25.0" hashes = [ - "h1:u9lRMCdNXcB5/WQTZVMvGhNliW2pKOzj3SOVbu9yPpg=", - "zh:0ed83ec390a7e75c4990ebce698f14234de2b6204ed9a01cd042bb7ea5f26564", - "zh:195150e4fdab259c70088528006f4604557a051e037ebe8de64e92840f27e40a", - "zh:1a334af55f7a74adf033eb871c9fe7e9e648b41ab84321114ef4ca0e7a34fba6", - "zh:1ef68c3832691de21a61bf1a4e268123f3e08850712eda0b893cac908a0d1bc1", - "zh:44a1c58e5a6646e62b0bad653319c245f3b635dd03554dea2707a38f553e4a52", - "zh:54b5b374c4386f7f05b3fe986f9cb57bde4beab3bdf6ee33444f2b9a81b8af64", - "zh:aa8c2687ab784b72f8cdad8d3c3673dea83b33561e7b3f2d287ef0d06ff2a9e5", - "zh:e6ecba0503052ef3ad49ad56e17b2a73d9b55e30fcb82b040189d281e25e1a3b", - "zh:f105393f6487d3eb1f1636ba42d10c82950ddfef852244c1bca8d526fa23a9a3", - "zh:f17a8f1914ec66d80ccacecd40123362cf093abee3d3aa1ff9f8f687d8736f85", - "zh:f394b12ef01fa0bdf666a43ad152eb3890134f35e635ea056b18771c292de46e", + "h1:FICS7kK0e8P5NrMc0y/ftBPj/AHVxJJ9mPs2T8u2oWA=", + "zh:3b3db7dec0dde2de13049b441da6bd60548e82b28c1d5a3ed1060d3341fb0db3", + "zh:43b983ffe749eee740f9e70195e31f6fd18d539dd6fcfbc73dfdb6bb3b63874e", + "zh:441d73d56b1c5690232d219e54bc18804cea82e807a7ace01953a722404f470c", + "zh:628bb467a5204f6c13d8bbe9977e04be68bb2e78c1bdf3cc95ab0f631d422815", + "zh:7af14f7615ff52fdc7e99a1e79a97837bba1f91ef84556c55792567075ccd957", + "zh:ad7e11e2ab0ea5598021069f46a518964dd35a63b83af39dd3355e3acd6fcd3e", + "zh:d1d596f63418e0709cbfc9211a7d1e0c5d52ee24121a2a1d365f832a3249d282", + "zh:d7f4cfd0a16686ec08f645e07276c88c1be9c742820abfbbafdbf685121bff54", + "zh:dfe8b64eef7c1733eb2012b53a3a47cab1fd1be8e5ab74c129c59950e6d29e94", + "zh:e7e70a2f8e2f9da8281cc35fbdead2bf73c7b96b38e1789da3d03a6493294bca", + "zh:f0d699529761e2d3ab1f7012b3d86b5c4a038f5052bbc840bf4156e367d6eecc", "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", ] } provider "registry.terraform.io/syseleven/metakube" { - version = "5.0.5" - constraints = "5.0.5" + version = "5.2.1" + constraints = "5.2.1" hashes = [ - "h1:z1uhkzHKuEGJDxwDnPUpcxJgkpXCmWiR7GLqM3zAon0=", - "zh:061a4d80a4d6b13a8a0fcb2ac17f1c63950dc22654709b612f0464931c608744", - "zh:09de25df71732f3b0eb328678da341d0a5f7f88c90a29ee16586a863b6cf812d", - "zh:0bdd4b2eddaea368156c027d48f42fafca599a88637129262bb5e5dc59bc02ae", - "zh:15b57fe2d79268ce669078617879c7353efdce45be13cb0d9b9152d0715f5aa0", - "zh:3c40e4445c8891801a64fd679ef32846a2df679b749066ad50e9e76453a2971f", - "zh:48657ea07e6d0de9ffcb5df1b1c0e490913ea5a6ad4c46fa508d53a48b940fdd", - "zh:5347f5aed11f8c2b5fe0200697c0e7619f1db5b0a0ddb1058b62203c8804d366", - "zh:55372429ffeadfc8310aa9aa16bc882239884ab54539fbe403389a254fc7d916", - "zh:8ddd5e860e6d87e7348576174b7f2cbedca0f3c934ef3d73442162ee567a6dd5", - "zh:bb0bebf5edcc375b8931b182ac519c5a057673be4c646c5f6988d6393cdfefd6", - "zh:d12174dbd3f38d3c1205c9be25328bb87aaf640c45d3459f575e4449ca2a7d97", - "zh:ecbb84262436ffcad8f83847246c102a1e330b711ac0f6ba9aa7d6f2b9db249a", - "zh:edc993a43be6f2226daec323a27c82aed5bda76a2c1d1a7ac780ab38bf7bfd93", + "h1:7wA/XBQPj+hMT+NEntbnMBpMmIZTJ/eCknEPUjVlJ2w=", + "zh:189b4c85edf865f79f5ea8e109e388ac07f50bec0ef486337055d1eae7f18fd8", + "zh:1a37a5afa16351bdc1af6e98fa8a94f5d52a8554ab705f11add522909fa3a97f", + "zh:25f636891f956cf4ddf7fd3f29d0afd8180a98a66bd239abdb61d376b3c1d079", + "zh:30fa964f9ea41109aa8e8e64ce7dcca481df0bb2c4339241e799fbf83a0bf225", + "zh:3c7216eb8d418189a5364d174ad9417b59cd0bf0bc4eb95b0374d341356422d0", + "zh:5de44f0943d47fe8662439607433db2164fbc9649b6137879f5e3d9ec28b2014", + "zh:64e9c7f48e133c02b6c65a18f400f95eee960b45f4a850a70f44144feb7fced3", + "zh:accd20ef88644e0f68509c2101cc50ef295a866f2aa8c49c65bc859fc0053687", + "zh:c94f630b56f45374925c0a61d2da11d159210708dbb68754309ec18a799a6de4", + "zh:cd6c9a19a6c3c7aeb81430fd1f67ce417e680a48003d4e5574afe2690544c67d", + "zh:e336df09aa3219d67339752c677137269b9914c054096c3b5bc425334cc5ea3f", + "zh:ec095f99056fd71cafeefc59049f55646341720bef2a53a84bb31552c7b68158", ] } diff --git a/README.md b/README.md index 5715e96..d3caa50 100644 --- a/README.md +++ b/README.md @@ -7,15 +7,15 @@ This module creates a Kubernetes cluster on [Metakube](https://metakube.syseleve | Name | Version | |------|---------| -| [kubernetes](#requirement\_kubernetes) | 2.24.0 | -| [metakube](#requirement\_metakube) | 5.0.5 | +| [kubernetes](#requirement\_kubernetes) | 2.25.0 | +| [metakube](#requirement\_metakube) | 5.2.1 | ## Providers | Name | Version | |------|---------| -| [kubernetes](#provider\_kubernetes) | 2.24.0 | -| [metakube](#provider\_metakube) | 5.0.5 | +| [kubernetes](#provider\_kubernetes) | 2.25.0 | +| [metakube](#provider\_metakube) | 5.2.1 | ## Modules @@ -25,17 +25,17 @@ No modules. | Name | Type | |------|------| -| [kubernetes_cluster_role_binding_v1.argod](https://registry.terraform.io/providers/hashicorp/kubernetes/2.24.0/docs/resources/cluster_role_binding_v1) | resource | -| [kubernetes_cluster_role_v1.argod](https://registry.terraform.io/providers/hashicorp/kubernetes/2.24.0/docs/resources/cluster_role_v1) | resource | -| [kubernetes_namespace.argod](https://registry.terraform.io/providers/hashicorp/kubernetes/2.24.0/docs/resources/namespace) | resource | -| [kubernetes_priority_class_v1.this](https://registry.terraform.io/providers/hashicorp/kubernetes/2.24.0/docs/resources/priority_class_v1) | resource | -| [kubernetes_secret_v1.argod](https://registry.terraform.io/providers/hashicorp/kubernetes/2.24.0/docs/resources/secret_v1) | resource | -| [kubernetes_service_account_v1.argod](https://registry.terraform.io/providers/hashicorp/kubernetes/2.24.0/docs/resources/service_account_v1) | resource | -| [metakube_cluster.this](https://registry.terraform.io/providers/syseleven/metakube/5.0.5/docs/resources/cluster) | resource | -| [metakube_cluster_role_binding.this](https://registry.terraform.io/providers/syseleven/metakube/5.0.5/docs/resources/cluster_role_binding) | resource | -| [metakube_node_deployment.this](https://registry.terraform.io/providers/syseleven/metakube/5.0.5/docs/resources/node_deployment) | resource | -| [kubernetes_secret_v1.argod](https://registry.terraform.io/providers/hashicorp/kubernetes/2.24.0/docs/data-sources/secret_v1) | data source | -| [metakube_k8s_version.cluster](https://registry.terraform.io/providers/syseleven/metakube/5.0.5/docs/data-sources/k8s_version) | data source | +| [kubernetes_cluster_role_binding_v1.argod](https://registry.terraform.io/providers/hashicorp/kubernetes/2.25.0/docs/resources/cluster_role_binding_v1) | resource | +| [kubernetes_cluster_role_v1.argod](https://registry.terraform.io/providers/hashicorp/kubernetes/2.25.0/docs/resources/cluster_role_v1) | resource | +| [kubernetes_namespace.argod](https://registry.terraform.io/providers/hashicorp/kubernetes/2.25.0/docs/resources/namespace) | resource | +| [kubernetes_priority_class_v1.this](https://registry.terraform.io/providers/hashicorp/kubernetes/2.25.0/docs/resources/priority_class_v1) | resource | +| [kubernetes_secret_v1.argod](https://registry.terraform.io/providers/hashicorp/kubernetes/2.25.0/docs/resources/secret_v1) | resource | +| [kubernetes_service_account_v1.argod](https://registry.terraform.io/providers/hashicorp/kubernetes/2.25.0/docs/resources/service_account_v1) | resource | +| [metakube_cluster.this](https://registry.terraform.io/providers/syseleven/metakube/5.2.1/docs/resources/cluster) | resource | +| [metakube_cluster_role_binding.this](https://registry.terraform.io/providers/syseleven/metakube/5.2.1/docs/resources/cluster_role_binding) | resource | +| [metakube_node_deployment.this](https://registry.terraform.io/providers/syseleven/metakube/5.2.1/docs/resources/node_deployment) | resource | +| [kubernetes_secret_v1.argod](https://registry.terraform.io/providers/hashicorp/kubernetes/2.25.0/docs/data-sources/secret_v1) | data source | +| [metakube_k8s_version.cluster](https://registry.terraform.io/providers/syseleven/metakube/5.2.1/docs/data-sources/k8s_version) | data source | ## Inputs @@ -55,6 +55,7 @@ No modules. | [node\_pools](#input\_node\_pools) | List all node pools that should be created in the cluster |
map(object({
replicas = object({
min = number
max = number
})
labels = optional(map(string))
os_config = object({
image = string
auto_update = bool
})
node_config = object({
flavor = string
use_floating_ip = bool
})
taints = optional(list(object({
key = string
value = string
effect = string
})))
}))
| n/a | yes | | [openstack\_application\_credential\_id](#input\_openstack\_application\_credential\_id) | The OpenStack application credential ID to use for the metakube cluster | `string` | n/a | yes | | [openstack\_application\_credential\_secret](#input\_openstack\_application\_credential\_secret) | The OpenStack application credential to use for the metakube cluster | `string` | n/a | yes | +| [openstack\_network\_config](#input\_openstack\_network\_config) | n/a |
object({
network_id = optional(string)
subnet_id = optional(string)
subnet_cidr = optional(string)
})
| n/a | yes | | [syseleven\_auth\_realm](#input\_syseleven\_auth\_realm) | The realm to use for the syseleven auth | `string` | n/a | yes | ## Outputs diff --git a/main.tf b/main.tf index c0442fc..541885b 100644 --- a/main.tf +++ b/main.tf @@ -19,6 +19,9 @@ resource "metakube_cluster" "this" { id = var.openstack_application_credential_id secret = var.openstack_application_credential_secret } + network = var.openstack_network_config.network_id != null && var.openstack_network_config.subnet_id != null ? var.openstack_network_config.network_id : null + subnet_id = var.openstack_network_config.network_id != null && var.openstack_network_config.subnet_id != null ? var.openstack_network_config.subnet_id : null + subnet_cidr = (var.openstack_network_config.network_id == null && var.openstack_network_config.subnet_id == null) && var.openstack_network_config.subnet_cidr != null ? var.openstack_network_config.subnet_cidr : null } } // configure OIDC authentication diff --git a/variables.tf b/variables.tf index b97a832..6f57238 100644 --- a/variables.tf +++ b/variables.tf @@ -39,6 +39,14 @@ variable "openstack_application_credential_secret" { sensitive = true } +variable "openstack_network_config" { + type = object({ + network_id = optional(string) + subnet_id = optional(string) + subnet_cidr = optional(string) + }) +} + variable "syseleven_auth_realm" { type = string description = "The realm to use for the syseleven auth" diff --git a/versions.tf b/versions.tf index 8737ab5..a7afb7d 100644 --- a/versions.tf +++ b/versions.tf @@ -2,11 +2,11 @@ terraform { required_providers { metakube = { source = "syseleven/metakube" - version = "5.0.5" + version = "5.2.1" } kubernetes = { source = "hashicorp/kubernetes" - version = "2.24.0" + version = "2.25.0" } } }