fix
This commit is contained in:
@@ -6,16 +6,11 @@ metadata:
|
|||||||
name: dataset-pg
|
name: dataset-pg
|
||||||
description: null
|
description: null
|
||||||
options:
|
options:
|
||||||
domain:
|
roles:
|
||||||
default: your-company
|
default: []
|
||||||
examples:
|
items:
|
||||||
- your-company
|
type: string
|
||||||
type: string
|
type: array
|
||||||
replicas:
|
|
||||||
default: 1
|
|
||||||
examples:
|
|
||||||
- 1
|
|
||||||
type: integer
|
|
||||||
backups:
|
backups:
|
||||||
default:
|
default:
|
||||||
enable: false
|
enable: false
|
||||||
@@ -75,70 +70,21 @@ options:
|
|||||||
examples:
|
examples:
|
||||||
- 8Gi
|
- 8Gi
|
||||||
type: string
|
type: string
|
||||||
images:
|
pool:
|
||||||
default:
|
default:
|
||||||
operator:
|
enable: false
|
||||||
pullPolicy: IfNotPresent
|
|
||||||
registry: docker.io
|
|
||||||
repository: to-be/defined
|
|
||||||
tag: v1.0.0
|
|
||||||
examples:
|
examples:
|
||||||
- operator:
|
- enable: false
|
||||||
pullPolicy: IfNotPresent
|
|
||||||
registry: docker.io
|
|
||||||
repository: to-be/defined
|
|
||||||
tag: v1.0.0
|
|
||||||
properties:
|
properties:
|
||||||
operator:
|
enable:
|
||||||
default:
|
default: false
|
||||||
pullPolicy: IfNotPresent
|
type: boolean
|
||||||
registry: docker.io
|
|
||||||
repository: to-be/defined
|
|
||||||
tag: v1.0.0
|
|
||||||
properties:
|
|
||||||
pullPolicy:
|
|
||||||
default: IfNotPresent
|
|
||||||
enum:
|
|
||||||
- Always
|
|
||||||
- Never
|
|
||||||
- IfNotPresent
|
|
||||||
type: string
|
|
||||||
registry:
|
|
||||||
default: docker.io
|
|
||||||
type: string
|
|
||||||
repository:
|
|
||||||
default: to-be/defined
|
|
||||||
type: string
|
|
||||||
tag:
|
|
||||||
default: v1.0.0
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
type: object
|
type: object
|
||||||
roles:
|
|
||||||
default: []
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
type: array
|
|
||||||
issuer:
|
|
||||||
default: letsencrypt-prod
|
|
||||||
examples:
|
|
||||||
- letsencrypt-prod
|
|
||||||
type: string
|
|
||||||
version:
|
version:
|
||||||
default: '14'
|
default: '14'
|
||||||
examples:
|
examples:
|
||||||
- '14'
|
- '14'
|
||||||
type: string
|
type: string
|
||||||
sub-domain:
|
|
||||||
default: to-be-set
|
|
||||||
examples:
|
|
||||||
- to-be-set
|
|
||||||
type: string
|
|
||||||
ingress-class:
|
|
||||||
default: traefik
|
|
||||||
examples:
|
|
||||||
- traefik
|
|
||||||
type: string
|
|
||||||
databases:
|
databases:
|
||||||
default: []
|
default: []
|
||||||
items:
|
items:
|
||||||
@@ -148,11 +94,6 @@ options:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
domain-name:
|
|
||||||
default: your_company.com
|
|
||||||
examples:
|
|
||||||
- your_company.com
|
|
||||||
type: string
|
|
||||||
dependencies: []
|
dependencies: []
|
||||||
providers:
|
providers:
|
||||||
kubernetes: true
|
kubernetes: true
|
||||||
|
|||||||
@@ -2,8 +2,7 @@ locals {
|
|||||||
sorted-roles = reverse(distinct(sort(var.roles)))
|
sorted-roles = reverse(distinct(sort(var.roles)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "kubectl_manifest" "db_secret_role" {
|
||||||
resource "kubectl_manifest" "db_secret" {
|
|
||||||
ignore_fields = ["metadata.annotations"]
|
ignore_fields = ["metadata.annotations"]
|
||||||
count = length(local.sorted-roles)
|
count = length(local.sorted-roles)
|
||||||
yaml_body = <<-EOF
|
yaml_body = <<-EOF
|
||||||
@@ -23,8 +22,8 @@ resource "kubectl_manifest" "db_secret" {
|
|||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
data "kubernetes_secret_v1" "password_get" {
|
data "kubernetes_secret_v1" "password_role_get" {
|
||||||
depends_on = [ kubectl_manifest.db_secret ]
|
depends_on = [ kubectl_manifest.db_secret_role ]
|
||||||
count = length(local.sorted-roles)
|
count = length(local.sorted-roles)
|
||||||
metadata {
|
metadata {
|
||||||
name = "${var.instance}-${var.component}-role-${local.sorted-roles[count.index]}"
|
name = "${var.instance}-${var.component}-role-${local.sorted-roles[count.index]}"
|
||||||
@@ -37,5 +36,5 @@ resource "postgresql_role" "role" {
|
|||||||
count = length(local.sorted-roles)
|
count = length(local.sorted-roles)
|
||||||
name = "${local.sorted-roles[count.index]}"
|
name = "${local.sorted-roles[count.index]}"
|
||||||
login = true
|
login = true
|
||||||
password = data.kubernetes_secret_v1.password_get[count.index].data["POSGRESQL_PASSWORD"]
|
password = data.kubernetes_secret_v1.password_role_get[count.index].data["POSGRESQL_PASSWORD"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user