Skip to content

Commit

Permalink
[GH-25] Remove apex domain creation
Browse files Browse the repository at this point in the history
  • Loading branch information
johncosta committed Mar 23, 2024
1 parent 8e3dd78 commit dfd57bf
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 62 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
options?=
options?=-v

default: help

Expand Down
25 changes: 1 addition & 24 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,13 @@ locals {
* allow_create_vpc = false # bring your own
* 3) allow use of the default vpc if the user explicitly sets the variable
* `allow_default_vpc` to true.
*
* cluster_ipv4_cidr set
* allow_create_vpc True (default)
* allow_default_vpc False (default)
*
* cluster_ipv4_cidr set
* allow_create_vpc False
* allow_default_vpc False (default)
*
* cluster_ipv4_cidr set
* allow_create_vpc True (default)
* allow_default_vpc True
*
* cluster_ipv4_cidr unset
* allow_create_vpc True (default)
* allow_default_vpc False (default)
*
* cluster_ipv4_cidr unset
* allow_create_vpc False
* allow_default_vpc False (default)
*
* cluster_ipv4_cidr unset
* allow_create_vpc True (default)
* allow_default_vpc True
*/
use_specified_vpc = var.cluster_ipv4_cidr != null && var.cluster_ipv4_cidr != ""
allow_create_vpc = var.allow_create_vpc ? true : false
allow_default_vpc = var.allow_default_vpc ? true : false
default_vpc_value_or_error = local.use_specified_vpc || local.allow_default_vpc ? null : file("[Error] you must explicitly set the variable `allow_default_vpc` if you want the cluster to access the default vpc or set cluster_ipv4_cidr to create a vpc.")
cluster_vpc_uuid = local.use_specified_vpc ? digitalocean_vpc.vpc[0].id : local.default_vpc_value_or_error

local_vpc_configured_as = {
use_specified_vpc = local.use_specified_vpc
allow_create_vpc = local.allow_create_vpc
Expand Down
3 changes: 0 additions & 3 deletions modules/addons/ingress.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ locals {
enabled = false,
config = {
domain_root = "example.com",
domain_create = false,
domain_certificate_email = "name@example.com"
}
})
Expand All @@ -13,12 +12,10 @@ locals {
nginx_chart_version = lookup(local.nginx_addon, "chart_version", "4.9.0")
nginx_config = lookup(local.nginx_addon, "config", {
domain_root = "example.com",
domain_create = false,
domain_certificate_email = "name@example.com"
})

dns_domain_root = lookup(local.nginx_config, "domain_root", "example.com")
dns_domain_create = lookup(local.nginx_config, "domain_create", false)
domain_certificate_email = lookup(local.nginx_config, "domain_certificate_email", "name@example.com")

ingress_public_ip_file_path = "/tmp"
Expand Down
34 changes: 0 additions & 34 deletions modules/addons/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,37 +48,3 @@ YAML
kubernetes_namespace.cert-manager
]
}

################################################################################
# DNS
################################################################################

resource "digitalocean_domain" "root" {
count = local.dns_enabled && local.dns_domain_create ? 1 : 0

name = local.dns_domain_root
ip_address = data.local_file.nginx-public-ip[0].content
}

#data "digitalocean_domain" "root" {
# //count = local.dns_enabled && local.dns_domain_create ? 0 : 1
# count = 0
#
# name = local.dns_domain_root
#}

#locals {
# domain_id = local.dns_domain_create ? digitalocean_domain.root[0].id : data.digitalocean_domain.root[0].id
#}
#resource "digitalocean_record" "www" {
# count = local.dns_enabled && local.argo_subdomain_create ? 1 : 0
#
# domain = local.domain_id
# type = "A"
# name = local.argo_record_name
# value = data.local_file.nginx-public-ip[0].content
#
# depends_on = [
# kubernetes_namespace.argo,
# ]
#}

0 comments on commit dfd57bf

Please sign in to comment.