diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2019-07-27 19:51:40 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2019-07-27 19:51:40 +0200 |
commit | f3e7c542cd87a91ee07c703e5bea23887d6c5569 (patch) | |
tree | d945c818ef6ed05dfc521124b5c4c5ef36250ca4 /terraform/dns.tf | |
parent | c8b5bca6c72dfeea631202250bcffa3cc7069d22 (diff) | |
download | k8s-sandbox-f3e7c542cd87a91ee07c703e5bea23887d6c5569.tar.gz k8s-sandbox-f3e7c542cd87a91ee07c703e5bea23887d6c5569.tar.bz2 k8s-sandbox-f3e7c542cd87a91ee07c703e5bea23887d6c5569.tar.xz k8s-sandbox-f3e7c542cd87a91ee07c703e5bea23887d6c5569.zip |
dns
Diffstat (limited to 'terraform/dns.tf')
-rw-r--r-- | terraform/dns.tf | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/terraform/dns.tf b/terraform/dns.tf new file mode 100644 index 0000000..b0b10e0 --- /dev/null +++ b/terraform/dns.tf @@ -0,0 +1,43 @@ +provider "linode" { + version = "1.8.0" + token = var.linode_personal_access_token +} + +variable "linode_personal_access_token" { + description = "Your Linode Personal Access Token. Get one from https://cloud.linode.com" +} + +variable "linode_domain" { + description = "The domain to use, example: example.org" +} + +variable "linode_domain_soa_email" { + description = "The domain's contact email, example: root@example.org" +} + +# Import this resource with: +# > terraform import linode_domain.k8s_domain domainID +resource "linode_domain" "k8s_domain" { + type = "master" + domain = var.linode_domain + refresh_sec = 300 + retry_sec = 300 + soa_email = var.linode_domain_soa_email + ttl_sec = 300 +} + +resource "linode_domain_record" "k8s_master" { + domain_id = linode_domain.k8s_domain.id + name = "k8s-master" + record_type = "A" + target = scaleway_server.k8s_master.public_ip +} + +resource "linode_domain_record" "k8s_node" { + domain_id = "${linode_domain.k8s_domain.id}" + name = "k8s-node${count.index}" + record_type = "A" + target = scaleway_server.k8s_node[count.index].public_ip + + count = var.node_count +} |