Skip to content

Commit

Permalink
Merge pull request #148 from ExpediaGroup/feature/dns_config
Browse files Browse the repository at this point in the history
Added variables to control Waggledance deployment dns policy and config.
  • Loading branch information
mollonado authored Oct 4, 2024
2 parents 38034c7 + f7a2182 commit 1f9c307
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"`<br/>`"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 | `<list>` | no |
Expand Down
14 changes: 14 additions & 0 deletions k8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

}
}
}
Expand Down
28 changes: 28 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 =<<EOF
Waggledance Kubernetes service settings. All fields are optional.
Expand Down

0 comments on commit 1f9c307

Please sign in to comment.