Adding a new uptime service to configure later on
For now I'm staging this in the playground namespace since IDK if I'm going to keep it 5ever + it's an excuse to learn how to use basic volumes
This commit is contained in:
parent
cfe631eba7
commit
718647f617
@ -38,6 +38,7 @@ locals {
|
||||
{ name = "resume.shockrah.xyz", records = [ var.vultr_host ] },
|
||||
{ name = "git.shockrah.xyz", records = [ var.vultr_host ] },
|
||||
{ name = "sanity.shockrah.xyz", records = [ var.vke_lb ] },
|
||||
{ name = "uptime.shockrah.xyz", records = [ var.vke_lb ] },
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,10 @@ resource kubernetes_ingress_v1 health {
|
||||
spec {
|
||||
ingress_class_name = "nginx"
|
||||
tls {
|
||||
hosts = [ "sanity.shockrah.xyz" ]
|
||||
hosts = [
|
||||
"sanity.shockrah.xyz",
|
||||
"uptime.shockrah.xyz"
|
||||
]
|
||||
secret_name = "shockrah"
|
||||
}
|
||||
rule {
|
||||
@ -29,6 +32,22 @@ resource kubernetes_ingress_v1 health {
|
||||
}
|
||||
}
|
||||
}
|
||||
rule {
|
||||
host = "uptime.shockrah.xyz"
|
||||
http {
|
||||
path {
|
||||
path = "/"
|
||||
backend {
|
||||
service {
|
||||
name = kubernetes_service.kuma.metadata[0].name
|
||||
port {
|
||||
number = kubernetes_service.kuma.spec[0].port[0].port
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
61
infra/vultr-kubernetes/uptime.tf
Normal file
61
infra/vultr-kubernetes/uptime.tf
Normal file
@ -0,0 +1,61 @@
|
||||
resource kubernetes_deployment kuma {
|
||||
metadata {
|
||||
name = "kuma"
|
||||
namespace = var.playground.namespace
|
||||
labels = {
|
||||
"app" = "kuma"
|
||||
}
|
||||
}
|
||||
spec {
|
||||
replicas = 1
|
||||
selector {
|
||||
match_labels = {
|
||||
"app" = "kuma"
|
||||
}
|
||||
}
|
||||
template {
|
||||
metadata {
|
||||
labels = {
|
||||
"app" = "kuma"
|
||||
}
|
||||
}
|
||||
spec {
|
||||
container {
|
||||
name = "kuma"
|
||||
image = "louislam/uptime-kuma:2"
|
||||
port {
|
||||
container_port = 3001
|
||||
name = "uptime-kuma"
|
||||
}
|
||||
volume_mount {
|
||||
name = "kuma-data"
|
||||
mount_path = "/app/data"
|
||||
}
|
||||
}
|
||||
volume {
|
||||
name = "kuma-data"
|
||||
persistent_volume_claim {
|
||||
claim_name = kubernetes_persistent_volume_claim_v1.kuma.metadata[0].name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource kubernetes_service kuma {
|
||||
metadata {
|
||||
name = "kuma"
|
||||
namespace = var.playground.namespace
|
||||
}
|
||||
spec {
|
||||
selector = {
|
||||
"app" = "kuma"
|
||||
}
|
||||
port {
|
||||
target_port = "uptime-kuma"
|
||||
port = 3001
|
||||
name = "http"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,15 +1,17 @@
|
||||
resource kubernetes_persistent_volume_claim_v1 gitea {
|
||||
# This volume will have to get scrapped and reconfigured
|
||||
# as this will be part of a "worksite" namespace for "boring" stuff
|
||||
resource kubernetes_persistent_volume_claim_v1 kuma {
|
||||
metadata {
|
||||
name = "gitea"
|
||||
name = "kuma-data"
|
||||
namespace = var.playground.namespace
|
||||
}
|
||||
spec {
|
||||
access_modes = [ "ReadWriteMany"]
|
||||
resources {
|
||||
requests = {
|
||||
storage = "10Gi"
|
||||
}
|
||||
volume_mode = "Filesystem"
|
||||
access_modes = [ "ReadWriteOnce"]
|
||||
resources {
|
||||
requests = {
|
||||
storage = "10Gi"
|
||||
}
|
||||
storage_class_name = "vultr-vfs-storage"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user