add photon instance to dawarich [ci skip]
This commit is contained in:
parent
9ad8ad0fc0
commit
d15434094f
1 changed files with 87 additions and 9 deletions
|
|
@ -43,8 +43,8 @@ resource "kubernetes_deployment" "dawarich" {
|
||||||
app = "dawarich"
|
app = "dawarich"
|
||||||
}
|
}
|
||||||
annotations = {
|
annotations = {
|
||||||
"diun.enable" = "true"
|
# "diun.enable" = "true"
|
||||||
"diun.include_tags" = "latest"
|
# "diun.include_tags" = "latest"
|
||||||
"prometheus.io/scrape" = "true"
|
"prometheus.io/scrape" = "true"
|
||||||
"prometheus.io/path" = "/metrics"
|
"prometheus.io/path" = "/metrics"
|
||||||
"prometheus.io/port" = 9394
|
"prometheus.io/port" = 9394
|
||||||
|
|
@ -117,6 +117,11 @@ resource "kubernetes_deployment" "dawarich" {
|
||||||
name = "PROMETHEUS_EXPORTER_HOST"
|
name = "PROMETHEUS_EXPORTER_HOST"
|
||||||
value = "0.0.0.0"
|
value = "0.0.0.0"
|
||||||
}
|
}
|
||||||
|
env {
|
||||||
|
name = "PHOTON_API_HOST"
|
||||||
|
value = "photon.dawarich"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# volume_mount {
|
# volume_mount {
|
||||||
# name = "watched"
|
# name = "watched"
|
||||||
|
|
@ -176,25 +181,76 @@ resource "kubernetes_deployment" "dawarich" {
|
||||||
name = "PROMETHEUS_EXPORTER_HOST"
|
name = "PROMETHEUS_EXPORTER_HOST"
|
||||||
value = "dawarich.dawarich"
|
value = "dawarich.dawarich"
|
||||||
}
|
}
|
||||||
|
env {
|
||||||
|
name = "PHOTON_API_HOST"
|
||||||
|
value = "photon.dawarich"
|
||||||
|
}
|
||||||
|
|
||||||
# volume_mount {
|
# volume_mount {
|
||||||
# name = "watched"
|
# name = "watched"
|
||||||
# mount_path = "/var/app/tmp/imports/watched"
|
# mount_path = "/var/app/tmp/imports/watched"
|
||||||
# }
|
# }
|
||||||
}
|
}
|
||||||
volume {
|
|
||||||
name = "watched"
|
|
||||||
nfs {
|
|
||||||
path = "/mnt/main/dawarich"
|
|
||||||
server = "10.0.10.15"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
resource "kubernetes_deployment" "photon" {
|
||||||
|
metadata {
|
||||||
|
name = "photon"
|
||||||
|
namespace = "dawarich"
|
||||||
|
labels = {
|
||||||
|
app = "photon"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
spec {
|
||||||
|
replicas = 1
|
||||||
|
strategy {
|
||||||
|
type = "Recreate"
|
||||||
|
}
|
||||||
|
selector {
|
||||||
|
match_labels = {
|
||||||
|
app = "photon"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
template {
|
||||||
|
metadata {
|
||||||
|
labels = {
|
||||||
|
app = "photon"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
spec {
|
||||||
|
|
||||||
|
container {
|
||||||
|
image = "thomasnordquist/photon-geocoder:latest"
|
||||||
|
name = "photon"
|
||||||
|
port {
|
||||||
|
name = "tcp"
|
||||||
|
container_port = 2322
|
||||||
|
}
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
name = "data"
|
||||||
|
mount_path = "/photon/photon_data"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
volume {
|
||||||
|
name = "data"
|
||||||
|
nfs {
|
||||||
|
path = "/mnt/main/photon"
|
||||||
|
server = "10.0.10.15"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
resource "kubernetes_service" "dawarich" {
|
resource "kubernetes_service" "dawarich" {
|
||||||
metadata {
|
metadata {
|
||||||
name = "dawarich"
|
name = "dawarich"
|
||||||
|
|
@ -216,6 +272,28 @@ resource "kubernetes_service" "dawarich" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "kubernetes_service" "photon" {
|
||||||
|
metadata {
|
||||||
|
name = "photon"
|
||||||
|
namespace = "dawarich"
|
||||||
|
labels = {
|
||||||
|
"app" = "photon"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spec {
|
||||||
|
selector = {
|
||||||
|
app = "photon"
|
||||||
|
}
|
||||||
|
port {
|
||||||
|
name = "http"
|
||||||
|
port = 2322
|
||||||
|
target_port = 2322
|
||||||
|
protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
module "ingress" {
|
module "ingress" {
|
||||||
source = "../ingress_factory"
|
source = "../ingress_factory"
|
||||||
namespace = "dawarich"
|
namespace = "dawarich"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue