fix
This commit is contained in:
@@ -6,12 +6,17 @@ metadata:
|
|||||||
name: dbgate
|
name: dbgate
|
||||||
description: null
|
description: null
|
||||||
options:
|
options:
|
||||||
app-group:
|
ingress-class:
|
||||||
default: dev
|
default: traefik
|
||||||
examples:
|
examples:
|
||||||
- dev
|
- traefik
|
||||||
type: string
|
type: string
|
||||||
mongo:
|
domain-name:
|
||||||
|
default: your_company.com
|
||||||
|
examples:
|
||||||
|
- your_company.com
|
||||||
|
type: string
|
||||||
|
maria:
|
||||||
default: []
|
default: []
|
||||||
examples:
|
examples:
|
||||||
- []
|
- []
|
||||||
@@ -40,6 +45,26 @@ options:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
|
domain:
|
||||||
|
default: your-company
|
||||||
|
examples:
|
||||||
|
- your-company
|
||||||
|
type: string
|
||||||
|
issuer:
|
||||||
|
default: letsencrypt-prod
|
||||||
|
examples:
|
||||||
|
- letsencrypt-prod
|
||||||
|
type: string
|
||||||
|
use-oauth:
|
||||||
|
default: false
|
||||||
|
examples:
|
||||||
|
- false
|
||||||
|
type: boolean
|
||||||
|
app-group:
|
||||||
|
default: dev
|
||||||
|
examples:
|
||||||
|
- dev
|
||||||
|
type: string
|
||||||
images:
|
images:
|
||||||
default:
|
default:
|
||||||
dbgate:
|
dbgate:
|
||||||
@@ -79,22 +104,7 @@ options:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
issuer:
|
mongo:
|
||||||
default: letsencrypt-prod
|
|
||||||
examples:
|
|
||||||
- letsencrypt-prod
|
|
||||||
type: string
|
|
||||||
use-oauth:
|
|
||||||
default: false
|
|
||||||
examples:
|
|
||||||
- false
|
|
||||||
type: boolean
|
|
||||||
sub-domain:
|
|
||||||
default: dbgate
|
|
||||||
examples:
|
|
||||||
- dbgate
|
|
||||||
type: string
|
|
||||||
maria:
|
|
||||||
default: []
|
default: []
|
||||||
examples:
|
examples:
|
||||||
- []
|
- []
|
||||||
@@ -123,42 +133,10 @@ options:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
domain:
|
sub-domain:
|
||||||
default: your-company
|
default: dbgate
|
||||||
examples:
|
examples:
|
||||||
- your-company
|
- dbgate
|
||||||
type: string
|
|
||||||
storage:
|
|
||||||
default:
|
|
||||||
accessMode: ReadWriteOnce
|
|
||||||
size: 1Gi
|
|
||||||
type: Filesystem
|
|
||||||
examples:
|
|
||||||
- accessMode: ReadWriteOnce
|
|
||||||
size: 1Gi
|
|
||||||
type: Filesystem
|
|
||||||
properties:
|
|
||||||
accessMode:
|
|
||||||
default: ReadWriteOnce
|
|
||||||
enum:
|
|
||||||
- ReadWriteOnce
|
|
||||||
- ReadOnlyMany
|
|
||||||
- ReadWriteMany
|
|
||||||
type: string
|
|
||||||
size:
|
|
||||||
default: 1Gi
|
|
||||||
type: string
|
|
||||||
type:
|
|
||||||
default: Filesystem
|
|
||||||
enum:
|
|
||||||
- Filesystem
|
|
||||||
- Block
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
ingress-class:
|
|
||||||
default: traefik
|
|
||||||
examples:
|
|
||||||
- traefik
|
|
||||||
type: string
|
type: string
|
||||||
pg:
|
pg:
|
||||||
default: []
|
default: []
|
||||||
@@ -189,11 +167,33 @@ options:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
domain-name:
|
storage:
|
||||||
default: your_company.com
|
default:
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
size: 1Gi
|
||||||
|
type: Filesystem
|
||||||
examples:
|
examples:
|
||||||
- your_company.com
|
- accessMode: ReadWriteOnce
|
||||||
type: string
|
size: 1Gi
|
||||||
|
type: Filesystem
|
||||||
|
properties:
|
||||||
|
accessMode:
|
||||||
|
default: ReadWriteOnce
|
||||||
|
enum:
|
||||||
|
- ReadWriteOnce
|
||||||
|
- ReadOnlyMany
|
||||||
|
- ReadWriteMany
|
||||||
|
type: string
|
||||||
|
size:
|
||||||
|
default: 1Gi
|
||||||
|
type: string
|
||||||
|
type:
|
||||||
|
default: Filesystem
|
||||||
|
enum:
|
||||||
|
- Filesystem
|
||||||
|
- Block
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
dependencies:
|
dependencies:
|
||||||
- dist: null
|
- dist: null
|
||||||
category: share
|
category: share
|
||||||
|
|||||||
@@ -14,18 +14,19 @@ locals {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module "service" {
|
||||||
provider "restapi" {
|
source = "/dist/modules/service"
|
||||||
uri = "http://authentik.${var.domain}-auth.svc/api/v3/"
|
component = var.component
|
||||||
headers = local.request_headers
|
instance = var.instance
|
||||||
create_method = "PATCH"
|
namespace = var.namespace
|
||||||
update_method = "PATCH"
|
labels = local.common-labels
|
||||||
destroy_method = "PATCH"
|
target = "http"
|
||||||
write_returns_object = true
|
port = local.service.port.number
|
||||||
id_attribute = "name"
|
providers = {
|
||||||
|
kubectl = kubectl
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
module "ingress" {
|
module "ingress" {
|
||||||
source = "/dist/modules/ingress"
|
source = "/dist/modules/ingress"
|
||||||
component = var.component
|
component = var.component
|
||||||
@@ -71,6 +72,16 @@ module "oauth2" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
provider "restapi" {
|
||||||
|
uri = "http://authentik.${var.domain}-auth.svc/api/v3/"
|
||||||
|
headers = local.request_headers
|
||||||
|
create_method = "PATCH"
|
||||||
|
update_method = "PATCH"
|
||||||
|
destroy_method = "PATCH"
|
||||||
|
write_returns_object = true
|
||||||
|
id_attribute = "name"
|
||||||
|
}
|
||||||
|
|
||||||
module "forward" {
|
module "forward" {
|
||||||
count = var.use-oauth?0:1
|
count = var.use-oauth?0:1
|
||||||
source = "/dist/modules/forward"
|
source = "/dist/modules/forward"
|
||||||
8
modules/service/providers.tf
Normal file
8
modules/service/providers.tf
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
terraform {
|
||||||
|
required_providers {
|
||||||
|
kubectl = {
|
||||||
|
source = "gavinbunney/kubectl"
|
||||||
|
version = "~> 1.14.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,14 +5,14 @@ resource "kubectl_manifest" "service" {
|
|||||||
metadata:
|
metadata:
|
||||||
name: "${var.component}-${var.instance}"
|
name: "${var.component}-${var.instance}"
|
||||||
namespace: "${var.namespace}"
|
namespace: "${var.namespace}"
|
||||||
labels: ${jsonencode(local.common-labels)}
|
labels: ${jsonencode(var.labels)}
|
||||||
spec:
|
spec:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
port: 80
|
port: ${var.port}
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
targetPort: http
|
targetPort: ${var.target}
|
||||||
selector: ${jsonencode(local.common-labels)}
|
selector: ${jsonencode(var.labels)}
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
20
modules/service/variables.tf
Normal file
20
modules/service/variables.tf
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
variable "component" {
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
variable "instance" {
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
variable "namespace" {
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
variable "labels" {
|
||||||
|
type = map(string)
|
||||||
|
}
|
||||||
|
variable "port" {
|
||||||
|
type = number
|
||||||
|
default = 80
|
||||||
|
}
|
||||||
|
variable "target" {
|
||||||
|
type = string
|
||||||
|
default = "http"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user