diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f00098..4abb9ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [4.5.5] - 2024-10-04 +### Added +- Added variables to control Waggledance deployment dns policy and config. ## [4.5.4] - 2024-10-03 ### Added diff --git a/README.md b/README.md index cf3e21f..df6ca22 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,8 @@ For more information please refer to the main [Apiary](https://github.com/Expedi | k8s_docker_registry_secret | Docker Registry authentication K8s secret name. | string | `` | no | | k8s_replica_count | Initial Number of k8s pod replicas to create. | number | `3` | no | | k8s_max_replica_count | Max Number of k8s pod replicas to create. | number | `10` | no | +| k8s_dns_policy | DNS policy for the Waggledance Kubernetes deployment. Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default', or 'None'. | string | `ClusterFirst` | no | +| k8s_dns_config | DNS configuration for the Waggledance Kubernetes deployment. | object | - | no | | k8s_svc_spec | Waggledance Kubernetes service settings. All inner fields are optional and if unset the kubernetes default values are applied. | object | `-` | no | | k8s_svc_annotations | Custom annotations for the Waggledance Kubernetes service.. | map(string) | `"service.beta.kubernetes.io/aws-load-balancer-internal" = "true"`
`"service.beta.kubernetes.io/aws-load-balancer-type" = "nlb"` | no | | local_metastores | List of federated Metastore endpoints directly accessible on the local network. See section [`local_metastores`](#local_metastores) for more info. | list | `` | no | diff --git a/k8s.tf b/k8s.tf index d5575d3..47a742a 100644 --- a/k8s.tf +++ b/k8s.tf @@ -153,6 +153,20 @@ resource "kubernetes_deployment_v1" "waggle_dance" { image_pull_secrets { name = var.k8s_docker_registry_secret } + dns_policy = var.k8s_dns_policy + dns_config { + nameservers = var.k8s_dns_config.nameservers + searches = var.k8s_dns_config.searches + + dynamic "option" { + for_each = var.k8s_dns_config.options + content { + name = option.value.name + value = option.value.value + } + } + } + } } } diff --git a/variables.tf b/variables.tf index 8629aec..061e495 100644 --- a/variables.tf +++ b/variables.tf @@ -105,6 +105,34 @@ variable "k8s_max_replica_count" { default = 10 } +variable "k8s_dns_policy" { + description = "DNS policy for the Waggledance Kubernetes deployment. Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default', or 'None'." + type = string + default = "ClusterFirst" + + validation { + condition = can(regex("(ClusterFirstWithHostNet|ClusterFirst|Default|None)", var.k8s_dns_policy)) + error_message = "The dns_policy must be one of 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default', or 'None'." + } +} + +variable "k8s_dns_config" { + description = "DNS configuration for the Waggledance Kubernetes deployment." + type = object({ + nameservers = optional(list(string)) + searches = optional(list(string)) + options = optional(list(object({ + name = string + value = optional(string) + }))) + }) + default = { + nameservers = [] + searches = [] + options = [] + } +} + variable "k8s_svc_spec" { description =<