Compare commits
7 Commits
96714b7186
...
0.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 140321f714 | |||
| a77bf1ec51 | |||
| 4f306cdacf | |||
| 0a9700ab94 | |||
| 0a92ad09d5 | |||
| c1aac2424b | |||
| ccfac82ad4 |
@@ -74,7 +74,7 @@ resource "restapi_object" "forward_outpost_binding" {
|
|||||||
|
|
||||||
resource "kubectl_manifest" "prj_middleware" {
|
resource "kubectl_manifest" "prj_middleware" {
|
||||||
yaml_body = <<-EOF
|
yaml_body = <<-EOF
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: "${local.app_slug}-forward"
|
name: "${local.app_slug}-forward"
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ resource "kubectl_manifest" "prj_certificate" {
|
|||||||
resource "kubectl_manifest" "prj_https_redirect" {
|
resource "kubectl_manifest" "prj_https_redirect" {
|
||||||
count = var.create_redirect || var.component == "" ? 1 : 0
|
count = var.create_redirect || var.component == "" ? 1 : 0
|
||||||
yaml_body = <<-EOF
|
yaml_body = <<-EOF
|
||||||
apiVersion: "traefik.containo.us/v1alpha1"
|
apiVersion: "traefik.io/v1alpha1"
|
||||||
kind: "Middleware"
|
kind: "Middleware"
|
||||||
metadata:
|
metadata:
|
||||||
name: "${local.app_slug}-https"
|
name: "${local.app_slug}-https"
|
||||||
|
|||||||
3
ingress/outputs.tf
Normal file
3
ingress/outputs.tf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
output "secret_name" {
|
||||||
|
value = var.create_cert ? "${local.app_slug}-cert":""
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@ locals {
|
|||||||
mongo-password = data.kubernetes_secret_v1.prj_mongo_secret.data["password"]
|
mongo-password = data.kubernetes_secret_v1.prj_mongo_secret.data["password"]
|
||||||
username = var.username==""?var.component==""?var.instance:var.component:var.username
|
username = var.username==""?var.component==""?var.instance:var.component:var.username
|
||||||
db_name = var.db_name==""?var.component==""?var.instance:var.component:var.db_name
|
db_name = var.db_name==""?var.component==""?var.instance:var.component:var.db_name
|
||||||
mongo-labels = merge(local.labels, {
|
mongo-labels = merge(var.labels, {
|
||||||
"app.kubernetes.io/component" = "mongo"
|
"app.kubernetes.io/component" = "mongo"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -40,8 +40,8 @@ resource "kubectl_manifest" "prj_mongo" {
|
|||||||
labels: ${jsonencode(local.mongo-labels)}
|
labels: ${jsonencode(local.mongo-labels)}
|
||||||
spec:
|
spec:
|
||||||
members: 1
|
members: 1
|
||||||
type: ReplicaSet
|
type: ${var.mongo_type}
|
||||||
version: "7.0.2"
|
version: "${var.mongo_version}"
|
||||||
statefulSet:
|
statefulSet:
|
||||||
spec:
|
spec:
|
||||||
template:
|
template:
|
||||||
|
|||||||
@@ -18,11 +18,11 @@ variable "username" {
|
|||||||
type = string
|
type = string
|
||||||
default = ""
|
default = ""
|
||||||
}
|
}
|
||||||
variable "version" {
|
variable "mongo_version" {
|
||||||
type = string
|
type = string
|
||||||
default = "6.3.2"
|
default = "6.0.13"
|
||||||
}
|
}
|
||||||
variable "type" {
|
variable "mongo_type" {
|
||||||
type = string
|
type = string
|
||||||
default = "ReplicaSet"
|
default = "ReplicaSet"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,3 +23,16 @@ output "client_id" {
|
|||||||
output "client_secret" {
|
output "client_secret" {
|
||||||
value = data.kubernetes_secret_v1.oauth2-client-secret.data["client-secret"]
|
value = data.kubernetes_secret_v1.oauth2-client-secret.data["client-secret"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output "secret_client_id_name" {
|
||||||
|
value = kubectl_manifest.oauth2-secret.name
|
||||||
|
}
|
||||||
|
output "secret_client_secret_name" {
|
||||||
|
value = kubernetes_secret_v1.oauth2-client-secret.metadata[0].name
|
||||||
|
}
|
||||||
|
output "secret_client_id_key" {
|
||||||
|
value = "client-id"
|
||||||
|
}
|
||||||
|
output "secret_client_secret_key" {
|
||||||
|
value = "client-secret"
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
output "host" {
|
output "host" {
|
||||||
value = "${var.app_slug}-redis.${var.namespace}.svc"
|
value = "${local.app_slug}-redis.${var.namespace}.svc"
|
||||||
}
|
}
|
||||||
output "url" {
|
output "url" {
|
||||||
value = "redis://${var.app_slug}-redis.${var.namespace}.svc:6379"
|
value = "redis://${local.app_slug}-redis.${var.namespace}.svc:6379"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
locals {
|
locals {
|
||||||
app_slug = (var.component == var.instance || var.component=="") ? var.instance : format("%s-%s", var.component, var.instance)
|
app_slug = (var.component == var.instance || var.component=="") ? var.instance : format("%s-%s", var.component, var.instance)
|
||||||
redis-labels = merge(local.labels, {
|
redis-labels = merge(var.labels, {
|
||||||
"app.kubernetes.io/component" = "redis"
|
"app.kubernetes.io/component" = "redis"
|
||||||
})
|
})
|
||||||
cfg = merge({
|
cfg = merge({
|
||||||
@@ -23,7 +23,7 @@ resource "kubectl_manifest" "redis" {
|
|||||||
namespace: "${var.namespace}"
|
namespace: "${var.namespace}"
|
||||||
labels: ${jsonencode(local.redis-labels)}
|
labels: ${jsonencode(local.redis-labels)}
|
||||||
spec:
|
spec:
|
||||||
kubernetesConfig: ${jsonencode(cfg)}
|
kubernetesConfig: ${jsonencode(local.cfg)}
|
||||||
storage:
|
storage:
|
||||||
volumeClaimTemplate:
|
volumeClaimTemplate:
|
||||||
spec:
|
spec:
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
output "name" {
|
output "name" {
|
||||||
value = "${var.app_slug}"
|
value = "${local.app_slug}"
|
||||||
}
|
}
|
||||||
output "default_definition" {
|
output "default_definition" {
|
||||||
value = {
|
value = {
|
||||||
"name" = "${var.app_slug}"
|
"name" = "${local.app_slug}"
|
||||||
"port" = {
|
"port" = {
|
||||||
"number" = var.ports[0]
|
"number" = var.ports[0]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user