feat: Add ALVR installation and configuration to playbook, update mstream module with ingress and deployment resources
This commit is contained in:
@@ -0,0 +1,147 @@
|
||||
resource "kubernetes_namespace" "mstream" {
|
||||
metadata {
|
||||
name = "mstream"
|
||||
}
|
||||
}
|
||||
|
||||
resource "kubernetes_service_account" "mstream" {
|
||||
|
||||
metadata {
|
||||
name = "mstream-sa"
|
||||
namespace = kubernetes_namespace.mstream.metadata[0].name
|
||||
}
|
||||
|
||||
automount_service_account_token = false
|
||||
}
|
||||
|
||||
resource "kubernetes_config_map" "app_config" {
|
||||
metadata {
|
||||
name = "mstream-config"
|
||||
namespace = kubernetes_namespace.mstream.metadata[0].name
|
||||
}
|
||||
|
||||
data = {}
|
||||
}
|
||||
|
||||
resource "kubernetes_secret" "app_secrets" {
|
||||
metadata {
|
||||
name = "mstream-keys"
|
||||
namespace = kubernetes_namespace.mstream.metadata[0].name
|
||||
}
|
||||
|
||||
data = {}
|
||||
}
|
||||
|
||||
resource "kubernetes_deployment" "mstream" {
|
||||
metadata {
|
||||
name = "mstream"
|
||||
namespace = kubernetes_namespace.mstream.metadata[0].name
|
||||
labels = {
|
||||
app = "mstream"
|
||||
}
|
||||
}
|
||||
|
||||
spec {
|
||||
replicas = 1
|
||||
|
||||
selector {
|
||||
match_labels = {
|
||||
app = "mstream"
|
||||
}
|
||||
}
|
||||
|
||||
strategy {
|
||||
type = "Recreate"
|
||||
}
|
||||
|
||||
template {
|
||||
metadata {
|
||||
labels = {
|
||||
app = "mstream"
|
||||
}
|
||||
}
|
||||
|
||||
spec {
|
||||
service_account_name = kubernetes_service_account.mstream.metadata[0].name
|
||||
automount_service_account_token = false
|
||||
|
||||
container {
|
||||
name = "mstream"
|
||||
image = "lscr.io/linuxserver/mstream:${local.app_version}"
|
||||
|
||||
env_from {
|
||||
config_map_ref {
|
||||
name = kubernetes_config_map.app_config.metadata[0].name
|
||||
}
|
||||
}
|
||||
|
||||
security_context {
|
||||
allow_privilege_escalation = false
|
||||
run_as_group = 0
|
||||
run_as_user = 0
|
||||
privileged = false
|
||||
}
|
||||
|
||||
port {
|
||||
name = "http"
|
||||
container_port = 3000
|
||||
protocol = "TCP"
|
||||
}
|
||||
|
||||
|
||||
volume_mount {
|
||||
name = "mstream-data"
|
||||
mount_path = "/config"
|
||||
}
|
||||
|
||||
volume_mount {
|
||||
name = "mstream-music"
|
||||
mount_path = "/music"
|
||||
read_only = true
|
||||
}
|
||||
}
|
||||
|
||||
volume {
|
||||
name = "mstream-data"
|
||||
host_path {
|
||||
path = local.app_folder
|
||||
}
|
||||
}
|
||||
|
||||
volume {
|
||||
name = "mstream-music"
|
||||
host_path {
|
||||
path = local.music_folder
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "kubernetes_service" "mstream" {
|
||||
metadata {
|
||||
name = "mstream-service"
|
||||
namespace = kubernetes_namespace.mstream.metadata[0].name
|
||||
}
|
||||
|
||||
spec {
|
||||
selector = {
|
||||
app = "mstream"
|
||||
}
|
||||
|
||||
port {
|
||||
name = "http"
|
||||
port = 3000
|
||||
target_port = 3000
|
||||
}
|
||||
|
||||
type = "ClusterIP"
|
||||
}
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [
|
||||
metadata[0].annotations
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user