Compare commits
7 Commits
37305fd74e
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| eea4c61537 | |||
| ee860c6e1f | |||
| 1c11410c2d | |||
| 4d71994b85 | |||
| 79cb4eb1a6 | |||
| e8817fe093 | |||
| 97bffd2042 |
@@ -40,6 +40,7 @@ locals {
|
|||||||
{ name = "sanity.shockrah.xyz", records = [ var.vke_lb ] },
|
{ name = "sanity.shockrah.xyz", records = [ var.vke_lb ] },
|
||||||
{ name = "uptime.shockrah.xyz", records = [ var.vke_lb ] },
|
{ name = "uptime.shockrah.xyz", records = [ var.vke_lb ] },
|
||||||
{ name = "code.shockrah.xyz", records = [ var.vke_lb ] },
|
{ name = "code.shockrah.xyz", records = [ var.vke_lb ] },
|
||||||
|
{ name = "wiki.shockrah.xyz", records = [ var.vke_lb ] },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,3 +33,11 @@ resource "aws_route53_record" "temper-tv-mx" {
|
|||||||
"50 fb.mail.gandi.net.",
|
"50 fb.mail.gandi.net.",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "aws_route53_record" "temper-tv-test" {
|
||||||
|
zone_id = aws_route53_zone.temper-tv.id
|
||||||
|
name = "test.temper.tv"
|
||||||
|
type = "A"
|
||||||
|
ttl = 300
|
||||||
|
records = [ var.vke_lb ]
|
||||||
|
}
|
||||||
@@ -9,7 +9,7 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
aws = {
|
aws = {
|
||||||
source = "hashicorp/aws"
|
source = "hashicorp/aws"
|
||||||
version = "5.98.0"
|
version = "6.27.0"
|
||||||
}
|
}
|
||||||
vultr = {
|
vultr = {
|
||||||
source = "vultr/vultr"
|
source = "vultr/vultr"
|
||||||
@@ -17,7 +17,7 @@ terraform {
|
|||||||
}
|
}
|
||||||
kubernetes = {
|
kubernetes = {
|
||||||
source = "hashicorp/kubernetes"
|
source = "hashicorp/kubernetes"
|
||||||
version = "2.37.1"
|
version = "3.0.1"
|
||||||
}
|
}
|
||||||
kubectl = {
|
kubectl = {
|
||||||
source = "gavinbunney/kubectl"
|
source = "gavinbunney/kubectl"
|
||||||
|
|||||||
@@ -8,16 +8,3 @@
|
|||||||
# port = each.value
|
# port = each.value
|
||||||
# }
|
# }
|
||||||
|
|
||||||
resource vultr_firewall_group bastion {
|
|
||||||
description = "For connections into and out of the bastion host"
|
|
||||||
}
|
|
||||||
|
|
||||||
resource vultr_firewall_rule bastion_inbound {
|
|
||||||
firewall_group_id = vultr_firewall_group.bastion.id
|
|
||||||
protocol = "tcp"
|
|
||||||
ip_type = "v4"
|
|
||||||
subnet = "0.0.0.0"
|
|
||||||
subnet_size = 0
|
|
||||||
port = 22
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
# NOTE: this is a simple deployment for demo purposes only.
|
||||||
|
# Currently it does support SSH access and lacks Gitea runners.
|
||||||
|
# However a fully working setup can be found at: https://git.shockrah.xyz
|
||||||
resource kubernetes_deployment gitea {
|
resource kubernetes_deployment gitea {
|
||||||
metadata {
|
metadata {
|
||||||
name = "gitea"
|
name = "gitea"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
resource kubernetes_deployment health {
|
resource kubernetes_deployment_v1 health {
|
||||||
metadata {
|
metadata {
|
||||||
name = "health"
|
name = "health"
|
||||||
namespace = var.playground.namespace
|
namespace = var.playground.namespace
|
||||||
@@ -29,7 +29,7 @@ resource kubernetes_deployment health {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource kubernetes_service health {
|
resource kubernetes_service_v1 health {
|
||||||
metadata {
|
metadata {
|
||||||
name = "health"
|
name = "health"
|
||||||
namespace = var.playground.namespace
|
namespace = var.playground.namespace
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
locals {
|
locals {
|
||||||
services = {
|
services = {
|
||||||
code = kubernetes_service.gitea
|
"code.shockrah.xyz" = kubernetes_service.gitea
|
||||||
sanity = kubernetes_service.health
|
"sanity.shockrah.xyz" = kubernetes_service_v1.health
|
||||||
uptime = kubernetes_service.kuma
|
"uptime.shockrah.xyz" = kubernetes_service.kuma
|
||||||
|
"wiki.shockrah.xyz" = kubernetes_service.otterwiki
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resource kubernetes_ingress_v1 health {
|
resource kubernetes_ingress_v1 health {
|
||||||
@@ -16,18 +17,17 @@ resource kubernetes_ingress_v1 health {
|
|||||||
}
|
}
|
||||||
spec {
|
spec {
|
||||||
ingress_class_name = "nginx"
|
ingress_class_name = "nginx"
|
||||||
tls {
|
dynamic tls {
|
||||||
hosts = [
|
for_each = local.services
|
||||||
"sanity.shockrah.xyz",
|
content {
|
||||||
"uptime.shockrah.xyz",
|
hosts = [tls.key]
|
||||||
"code.shockrah.xyz"
|
secret_name = "${tls.value.metadata[0].name}-secret"
|
||||||
]
|
}
|
||||||
secret_name = "shockrah"
|
|
||||||
}
|
}
|
||||||
dynamic "rule" {
|
dynamic "rule" {
|
||||||
for_each = local.services
|
for_each = local.services
|
||||||
content {
|
content {
|
||||||
host = "${rule.key}.shockrah.xyz"
|
host = "${rule.key}"
|
||||||
http {
|
http {
|
||||||
path {
|
path {
|
||||||
path = "/"
|
path = "/"
|
||||||
|
|||||||
@@ -7,12 +7,4 @@ resource kubernetes_namespace playground {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource kubernetes_namespace openobserve {
|
|
||||||
metadata {
|
|
||||||
annotations = {
|
|
||||||
names = "openobserve"
|
|
||||||
}
|
|
||||||
name = "openobserve"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -40,22 +40,10 @@ variable cluster {
|
|||||||
variable playground {
|
variable playground {
|
||||||
type = object({
|
type = object({
|
||||||
namespace = string
|
namespace = string
|
||||||
health = object({
|
# TODO: Re-incorporate this var for templating later
|
||||||
dns = string
|
|
||||||
})
|
|
||||||
tls = object({
|
tls = object({
|
||||||
email = string
|
email = string
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
variable bastion {
|
|
||||||
type = object({
|
|
||||||
plan = string
|
|
||||||
os = string
|
|
||||||
label = string
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
cluster = {
|
cluster = {
|
||||||
region = "lax"
|
region = "lax"
|
||||||
label = "athens-cluster"
|
label = "athens-cluster"
|
||||||
version = "v1.33.0+3"
|
version = "v1.34.1+2"
|
||||||
pools = {
|
pools = {
|
||||||
main = {
|
main = {
|
||||||
node_quantity = 1
|
node_quantity = 1
|
||||||
plan = "vc2-2c-4gb"
|
plan = "vc2-1c-2gb"
|
||||||
label = "main"
|
label = "main"
|
||||||
min_nodes = 1
|
min_nodes = 1
|
||||||
max_nodes = 2
|
max_nodes = 2
|
||||||
@@ -18,17 +18,7 @@ playground = {
|
|||||||
namespace = "playground"
|
namespace = "playground"
|
||||||
# Sanity check service that is used purely for the sake of ensuring
|
# Sanity check service that is used purely for the sake of ensuring
|
||||||
# things are ( at a basic level ) functional
|
# things are ( at a basic level ) functional
|
||||||
health = {
|
|
||||||
dns = "health"
|
|
||||||
}
|
|
||||||
tls = {
|
tls = {
|
||||||
email = "dev@shockrah.xyz"
|
email = "dev@shockrah.xyz"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bastion = {
|
|
||||||
plan = "vc2-1c-2gb"
|
|
||||||
label = "bastion"
|
|
||||||
os = "1743"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user