MetaTrader5-Docker-Image/main.tf.k3s
bast 9db594767f
Some checks failed
MT5 Stack Deploy / deploy (push) Failing after 54s
Deploy per Terraform/SSH
2026-11-07 06:32:23 +01:00

105 lines
2 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

terraform {
required_providers {
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.26"
}
helm = {
source = "hashicorp/helm"
version = "~> 2.12"
}
}
# Eigener State-Pfad, damit sich MT5 und die Webseite nicht in die Quere kommen
backend "consul" {
address = "consul:8500"
path = "terraform/states/mt5_tf"
}
}
# --- Variablen ---------------------------------------------------------------
variable "app_version" {
type = string
default = "latest"
}
variable "image_repository" {
type = string
default = "gmag11/metatrader5_vnc"
}
variable "vnc_user" {
type = string
default = "trader"
}
# Kommt aus TF_VAR_vnc_password (Secret MT5_VNC_PASSWORD)
variable "vnc_password" {
type = string
sensitive = true
}
variable "ingress_host" {
type = string
default = ""
}
# --- Provider ----------------------------------------------------------------
provider "kubernetes" {
config_path = "./kind_kubeconfig"
host = "https://local-k3s-platform:6443"
insecure = true
}
provider "helm" {
kubernetes {
config_path = "./kind_kubeconfig"
host = "https://local-k3s-platform:6443"
insecure = true
}
}
# --- MetaTrader 5 Deployment -------------------------------------------------
resource "helm_release" "mt5" {
name = "mt5"
chart = "./charts/mt5"
namespace = "trading"
create_namespace = true
# Erster Start installiert Wine + MT5 nach /config – das dauert ein paar Minuten
timeout = 900
wait = true
set {
name = "image.repository"
value = var.image_repository
}
set {
name = "image.tag"
value = var.app_version
}
set {
name = "auth.user"
value = var.vnc_user
}
set_sensitive {
name = "auth.password"
value = var.vnc_password
}
set {
name = "ingress.enabled"
value = var.ingress_host != "" ? "true" : "false"
}
set {
name = "ingress.host"
value = var.ingress_host
}
}