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" {
|
||||
yaml_body = <<-EOF
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: "${local.app_slug}-forward"
|
||||
|
||||
@@ -58,7 +58,7 @@ resource "kubectl_manifest" "prj_certificate" {
|
||||
resource "kubectl_manifest" "prj_https_redirect" {
|
||||
count = var.create_redirect || var.component == "" ? 1 : 0
|
||||
yaml_body = <<-EOF
|
||||
apiVersion: "traefik.containo.us/v1alpha1"
|
||||
apiVersion: "traefik.io/v1alpha1"
|
||||
kind: "Middleware"
|
||||
metadata:
|
||||
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"]
|
||||
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
|
||||
mongo-labels = merge(local.labels, {
|
||||
mongo-labels = merge(var.labels, {
|
||||
"app.kubernetes.io/component" = "mongo"
|
||||
})
|
||||
}
|
||||
@@ -40,8 +40,8 @@ resource "kubectl_manifest" "prj_mongo" {
|
||||
labels: ${jsonencode(local.mongo-labels)}
|
||||
spec:
|
||||
members: 1
|
||||
type: ReplicaSet
|
||||
version: "7.0.2"
|
||||
type: ${var.mongo_type}
|
||||
version: "${var.mongo_version}"
|
||||
statefulSet:
|
||||
spec:
|
||||
template:
|
||||
|
||||
@@ -18,11 +18,11 @@ variable "username" {
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
variable "version" {
|
||||
variable "mongo_version" {
|
||||
type = string
|
||||
default = "6.3.2"
|
||||
default = "6.0.13"
|
||||
}
|
||||
variable "type" {
|
||||
variable "mongo_type" {
|
||||
type = string
|
||||
default = "ReplicaSet"
|
||||
}
|
||||
|
||||
@@ -23,3 +23,16 @@ output "client_id" {
|
||||
output "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" {
|
||||
value = "${var.app_slug}-redis.${var.namespace}.svc"
|
||||
value = "${local.app_slug}-redis.${var.namespace}.svc"
|
||||
}
|
||||
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 {
|
||||
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"
|
||||
})
|
||||
cfg = merge({
|
||||
@@ -23,7 +23,7 @@ resource "kubectl_manifest" "redis" {
|
||||
namespace: "${var.namespace}"
|
||||
labels: ${jsonencode(local.redis-labels)}
|
||||
spec:
|
||||
kubernetesConfig: ${jsonencode(cfg)}
|
||||
kubernetesConfig: ${jsonencode(local.cfg)}
|
||||
storage:
|
||||
volumeClaimTemplate:
|
||||
spec:
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
output "name" {
|
||||
value = "${var.app_slug}"
|
||||
value = "${local.app_slug}"
|
||||
}
|
||||
output "default_definition" {
|
||||
value = {
|
||||
"name" = "${var.app_slug}"
|
||||
"name" = "${local.app_slug}"
|
||||
"port" = {
|
||||
"number" = var.ports[0]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user