Clemens Jütte
06/11/2024, 2:12 PMapiVersion: <http://entity.humanitec.io/v1b1|entity.humanitec.io/v1b1>
kind: Definition
metadata:
id: 5min-idp-sfhq-postgres
entity:
name: 5min-idp-sfhq-postgres
type: postgres
driver_type: humanitec/template
driver_inputs:
values:
templates:
init: |-
name: my-cluster
secret: my-cluster-secret
port: 5432
user: scott
password: tiger
manifests: |-
secret.yaml:
location: namespace
data:
apiVersion: v1
kind: Secret
metadata:
name: {{ .init.secret }}
type: <http://kubernetes.io/basic-auth|kubernetes.io/basic-auth>
data:
username: {{ .init.user | b64enc }}
password: {{ .init.password | b64enc }}
pgcluster.yaml:
location: namespace
data:
apiVersion: <http://postgresql.cnpg.io/v1|postgresql.cnpg.io/v1>
kind: Cluster
metadata:
name: {{ .init.name }}
spec:
instances: 1
storage:
size: 100M
bootstrap:
initdb:
database: {{ .init.name }}
owner: {{ .init.user }}
secret:
name: {{ .init.secret }}
outputs: |
host: {{ .init.name }}-rw
name: {{ .init.name }}
port: {{ .init.port }}
secrets: |
username: {{ .init.user }}
password: {{ .init.password }}
criteria:
- app_id: 5min-idp-sfhq
class: default