fix
This commit is contained in:
@@ -6,12 +6,17 @@ metadata:
|
||||
name: dbgate
|
||||
description: null
|
||||
options:
|
||||
app-group:
|
||||
default: dev
|
||||
ingress-class:
|
||||
default: traefik
|
||||
examples:
|
||||
- dev
|
||||
- traefik
|
||||
type: string
|
||||
mongo:
|
||||
domain-name:
|
||||
default: your_company.com
|
||||
examples:
|
||||
- your_company.com
|
||||
type: string
|
||||
maria:
|
||||
default: []
|
||||
examples:
|
||||
- []
|
||||
@@ -40,6 +45,26 @@ options:
|
||||
type: string
|
||||
type: object
|
||||
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:
|
||||
default:
|
||||
dbgate:
|
||||
@@ -79,22 +104,7 @@ options:
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
issuer:
|
||||
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:
|
||||
mongo:
|
||||
default: []
|
||||
examples:
|
||||
- []
|
||||
@@ -123,42 +133,10 @@ options:
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
domain:
|
||||
default: your-company
|
||||
sub-domain:
|
||||
default: dbgate
|
||||
examples:
|
||||
- your-company
|
||||
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
|
||||
- dbgate
|
||||
type: string
|
||||
pg:
|
||||
default: []
|
||||
@@ -189,11 +167,33 @@ options:
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
domain-name:
|
||||
default: your_company.com
|
||||
storage:
|
||||
default:
|
||||
accessMode: ReadWriteOnce
|
||||
size: 1Gi
|
||||
type: Filesystem
|
||||
examples:
|
||||
- your_company.com
|
||||
type: string
|
||||
- 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
|
||||
dependencies:
|
||||
- dist: null
|
||||
category: share
|
||||
|
||||
@@ -14,18 +14,19 @@ locals {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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 "service" {
|
||||
source = "/dist/modules/service"
|
||||
component = var.component
|
||||
instance = var.instance
|
||||
namespace = var.namespace
|
||||
labels = local.common-labels
|
||||
target = "http"
|
||||
port = local.service.port.number
|
||||
providers = {
|
||||
kubectl = kubectl
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module "ingress" {
|
||||
source = "/dist/modules/ingress"
|
||||
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" {
|
||||
count = var.use-oauth?0:1
|
||||
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:
|
||||
name: "${var.component}-${var.instance}"
|
||||
namespace: "${var.namespace}"
|
||||
labels: ${jsonencode(local.common-labels)}
|
||||
labels: ${jsonencode(var.labels)}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
port: ${var.port}
|
||||
protocol: TCP
|
||||
targetPort: http
|
||||
selector: ${jsonencode(local.common-labels)}
|
||||
targetPort: ${var.target}
|
||||
selector: ${jsonencode(var.labels)}
|
||||
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