Skip to content

Commit

Permalink
feat: customize node ipv4 range (#13)
Browse files Browse the repository at this point in the history
* feat: customize node ipv4 range

We now support the customization of the ipv4 node range or the specification of a network and subnet ID

* chore: added .terraform.lock.hcl

* docs: updated auto generated documentation

---------

Signed-off-by: leonsteinhaeuser <leon.steinhaeuser@tagesspiegel.de>
  • Loading branch information
leonsteinhaeuser authored Feb 1, 2024
1 parent 1ba7a1a commit fc83a08
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 47 deletions.
59 changes: 29 additions & 30 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ This module creates a Kubernetes cluster on [Metakube](https://metakube.syseleve

| Name | Version |
|------|---------|
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | 2.24.0 |
| <a name="requirement_metakube"></a> [metakube](#requirement\_metakube) | 5.0.5 |
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | 2.25.0 |
| <a name="requirement_metakube"></a> [metakube](#requirement\_metakube) | 5.2.1 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | 2.24.0 |
| <a name="provider_metakube"></a> [metakube](#provider\_metakube) | 5.0.5 |
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | 2.25.0 |
| <a name="provider_metakube"></a> [metakube](#provider\_metakube) | 5.2.1 |

## Modules

Expand All @@ -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

Expand All @@ -55,6 +55,7 @@ No modules.
| <a name="input_node_pools"></a> [node\_pools](#input\_node\_pools) | List all node pools that should be created in the cluster | <pre>map(object({<br> replicas = object({<br> min = number<br> max = number<br> })<br> labels = optional(map(string))<br> os_config = object({<br> image = string<br> auto_update = bool<br> })<br> node_config = object({<br> flavor = string<br> use_floating_ip = bool<br> })<br> taints = optional(list(object({<br> key = string<br> value = string<br> effect = string<br> })))<br> }))</pre> | n/a | yes |
| <a name="input_openstack_application_credential_id"></a> [openstack\_application\_credential\_id](#input\_openstack\_application\_credential\_id) | The OpenStack application credential ID to use for the metakube cluster | `string` | n/a | yes |
| <a name="input_openstack_application_credential_secret"></a> [openstack\_application\_credential\_secret](#input\_openstack\_application\_credential\_secret) | The OpenStack application credential to use for the metakube cluster | `string` | n/a | yes |
| <a name="input_openstack_network_config"></a> [openstack\_network\_config](#input\_openstack\_network\_config) | n/a | <pre>object({<br> network_id = optional(string)<br> subnet_id = optional(string)<br> subnet_cidr = optional(string)<br> })</pre> | n/a | yes |
| <a name="input_syseleven_auth_realm"></a> [syseleven\_auth\_realm](#input\_syseleven\_auth\_realm) | The realm to use for the syseleven auth | `string` | n/a | yes |

## Outputs
Expand Down
3 changes: 3 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}

0 comments on commit fc83a08

Please sign in to comment.