fix
This commit is contained in:
61
share/dataset-maria/index.yaml
Normal file
61
share/dataset-maria/index.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
apiVersion: vinyl.solidite.fr/v1beta1
|
||||
kind: Component
|
||||
category: share
|
||||
metadata:
|
||||
name: dataset-maria
|
||||
description: null
|
||||
options:
|
||||
storage:
|
||||
default: 8Gi
|
||||
examples:
|
||||
- 8Gi
|
||||
type: string
|
||||
images:
|
||||
default:
|
||||
mariadb:
|
||||
pullPolicy: IfNotPresent
|
||||
registry: docker.io
|
||||
repository: mariadb
|
||||
tag: 10.7.4
|
||||
examples:
|
||||
- mariadb:
|
||||
pullPolicy: IfNotPresent
|
||||
registry: docker.io
|
||||
repository: mariadb
|
||||
tag: 10.7.4
|
||||
properties:
|
||||
mariadb:
|
||||
default:
|
||||
pullPolicy: IfNotPresent
|
||||
registry: docker.io
|
||||
repository: mariadb
|
||||
tag: 10.7.4
|
||||
properties:
|
||||
pullPolicy:
|
||||
default: IfNotPresent
|
||||
enum:
|
||||
- Always
|
||||
- Never
|
||||
- IfNotPresent
|
||||
type: string
|
||||
registry:
|
||||
default: docker.io
|
||||
type: string
|
||||
repository:
|
||||
default: mariadb
|
||||
type: string
|
||||
tag:
|
||||
default: 10.7.4
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
dependencies: []
|
||||
providers:
|
||||
kubernetes: true
|
||||
authentik: null
|
||||
kubectl: true
|
||||
postgresql: null
|
||||
restapi: null
|
||||
http: null
|
||||
tfaddtype: null
|
||||
62
share/dataset-maria/mariadb.tf
Normal file
62
share/dataset-maria/mariadb.tf
Normal file
@@ -0,0 +1,62 @@
|
||||
locals {
|
||||
maria-labels = merge(local.common-labels, {
|
||||
"app.kubernetes.io/component" = "mariadb"
|
||||
})
|
||||
mariadb-password = data.kubernetes_secret_v1.prj_mariadb_secret.data["password"]
|
||||
}
|
||||
resource "kubectl_manifest" "prj_mariadb_secret" {
|
||||
ignore_fields = ["metadata.annotations"]
|
||||
yaml_body = <<-EOF
|
||||
apiVersion: "secretgenerator.mittwald.de/v1alpha1"
|
||||
kind: "StringSecret"
|
||||
metadata:
|
||||
name: "${var.instance}-${var.component}"
|
||||
namespace: "${var.namespace}"
|
||||
labels: ${jsonencode(local.maria-labels)}
|
||||
spec:
|
||||
forceRegenerate: false
|
||||
data:
|
||||
username: "${var.instance}"
|
||||
fields:
|
||||
- fieldName: "password"
|
||||
length: "32"
|
||||
- fieldName: "root-password"
|
||||
length: "32"
|
||||
EOF
|
||||
}
|
||||
data "kubernetes_secret_v1" "prj_mariadb_secret" {
|
||||
depends_on = [ kubectl_manifest.prj_mariadb_secret ]
|
||||
metadata {
|
||||
name = "${var.instance}-${var.component}"
|
||||
namespace = var.namespace
|
||||
}
|
||||
}
|
||||
resource "kubectl_manifest" "prj_mariadb" {
|
||||
yaml_body = <<-EOF
|
||||
apiVersion: mariadbdbcommunity.mariadbdb.com/v1
|
||||
kind: mariadbDBCommunity
|
||||
metadata:
|
||||
name: "${var.instance}-${var.component}"
|
||||
namespace: "${var.namespace}"
|
||||
labels: ${jsonencode(local.mariadb-labels)}
|
||||
spec:
|
||||
database: "${var.instance}"
|
||||
image:
|
||||
pullPolicy: "${var.images.mariadb.pullPolicy}"
|
||||
repository: "${var.images.mariadb.registry}/${var.images.mariadb.repository}"
|
||||
tag: "${var.images.mariadb.tag}"
|
||||
passwordSecretKeyRef:
|
||||
key: password
|
||||
name: "${var.instance}-${var.component}"
|
||||
rootPasswordSecretKeyRef:
|
||||
key: root-password
|
||||
name: "${var.instance}-${var.component}"
|
||||
username: "${var.instance}"
|
||||
volumeClaimTemplate:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: "${var.storage}"
|
||||
EOF
|
||||
}
|
||||
Reference in New Issue
Block a user