infra/stacks/priority-pass/main.tf
Viktor Barzin ce7a584801 priority-pass: frontend ea9176f8 (gallery upload), sync backend pin to live
Frontend bug fix: photo input forced camera on mobile via
capture="environment". Added separate "Choose from Gallery" / "Take
Photo" buttons so users can pick from their photo library.

Backend image unchanged; pin synced from stale v8 to live SHA
ae1420a0 (the v8 tag was never pushed to the registry).

Image built locally and pushed to registry.viktorbarzin.me. The
priority-pass project directory isn't under git, so deployment was
applied via kubectl set image (matches existing pattern — TF state
for this stack is empty).

[ci skip]
2026-05-01 18:38:30 +00:00

128 lines
2.8 KiB
HCL

variable "tls_secret_name" {
type = string
sensitive = true
}
resource "kubernetes_namespace" "priority-pass" {
metadata {
name = "priority-pass"
labels = {
"istio-injection" = "disabled"
tier = local.tiers.aux
}
}
lifecycle {
# KYVERNO_LIFECYCLE_V1: goldilocks-vpa-auto-mode ClusterPolicy stamps this label on every namespace
ignore_changes = [metadata[0].labels["goldilocks.fairwinds.com/vpa-update-mode"]]
}
}
module "tls_secret" {
source = "../../modules/kubernetes/setup_tls_secret"
namespace = "priority-pass"
tls_secret_name = var.tls_secret_name
}
resource "kubernetes_deployment" "priority-pass" {
metadata {
name = "priority-pass"
namespace = "priority-pass"
labels = {
run = "priority-pass"
tier = local.tiers.aux
}
}
spec {
replicas = 1
selector {
match_labels = {
run = "priority-pass"
}
}
template {
metadata {
labels = {
run = "priority-pass"
}
}
spec {
image_pull_secrets {
name = "registry-credentials"
}
container {
name = "frontend"
image = "registry.viktorbarzin.me/priority-pass-frontend:ea9176f8"
port {
container_port = 3000
}
env {
name = "BACKEND_URL"
value = "http://127.0.0.1:8000"
}
env {
name = "ORIGIN"
value = "https://priority-pass.viktorbarzin.me"
}
resources {
limits = {
memory = "128Mi"
}
requests = {
cpu = "10m"
memory = "128Mi"
}
}
}
container {
name = "backend"
image = "registry.viktorbarzin.me/priority-pass-backend:ae1420a0"
port {
container_port = 8000
}
resources {
limits = {
memory = "512Mi"
}
requests = {
cpu = "10m"
memory = "512Mi"
}
}
}
}
}
}
lifecycle {
ignore_changes = [spec[0].template[0].spec[0].dns_config] # KYVERNO_LIFECYCLE_V1
}
}
resource "kubernetes_service" "priority-pass" {
metadata {
name = "priority-pass"
namespace = "priority-pass"
labels = {
run = "priority-pass"
}
}
spec {
selector = {
run = "priority-pass"
}
port {
name = "http"
port = 80
target_port = 3000
}
}
}
module "ingress" {
source = "../../modules/kubernetes/ingress_factory"
dns_type = "proxied"
namespace = "priority-pass"
name = "priority-pass"
tls_secret_name = var.tls_secret_name
protected = true
max_body_size = "10m"
}