add excalidraw module [ci skip]

This commit is contained in:
viktorbarzin 2023-04-09 13:18:57 +01:00
parent 65fa9216a2
commit 16a6114bd1
No known key found for this signature in database
GPG key ID: 0EB088298288D958
4 changed files with 120 additions and 0 deletions

View file

@ -0,0 +1,115 @@
variable "tls_secret_name" {}
resource "kubernetes_namespace" "finance_app" {
metadata {
name = "excalidraw"
}
}
module "tls_secret" {
source = "../setup_tls_secret"
namespace = "excalidraw"
tls_secret_name = var.tls_secret_name
}
resource "kubernetes_deployment" "excalidraw" {
metadata {
name = "excalidraw"
namespace = "excalidraw"
labels = {
app = "excalidraw"
}
}
spec {
replicas = 1
selector {
match_labels = {
app = "excalidraw"
}
}
template {
metadata {
labels = {
app = "excalidraw"
}
}
spec {
container {
image = "docker.io/excalidraw/excalidraw:latest"
name = "excalidraw"
}
}
}
}
}
resource "kubernetes_service" "finance_app" {
metadata {
name = "excalidraw"
namespace = "excalidraw"
labels = {
app = "excalidraw"
}
}
spec {
selector = {
app = "excalidraw"
}
port {
name = "http"
port = "80"
}
}
}
resource "kubernetes_ingress_v1" "finance_app" {
metadata {
name = "excalidraw"
namespace = "excalidraw"
annotations = {
"kubernetes.io/ingress.class" = "nginx"
}
}
spec {
tls {
hosts = ["excalidraw.viktorbarzin.me"]
secret_name = var.tls_secret_name
}
rule {
host = "excalidraw.viktorbarzin.me"
http {
path {
path = "/"
backend {
service {
name = "excalidraw"
port {
number = 80
}
}
}
}
}
}
rule {
host = "draw.viktorbarzin.me"
http {
path {
path = "/"
backend {
service {
name = "excalidraw"
port {
number = 80
}
}
}
}
}
}
}
}

View file

@ -272,3 +272,8 @@ module "finance_app" {
oauth_google_client_secret = var.finance_app_oauth_google_client_secret
graphql_api_secret = var.finance_app_graphql_api_secret
}
module "excalidraw" {
source = "./excalidraw"
tls_secret_name = var.tls_secret_name
}

Binary file not shown.

Binary file not shown.