Create a user in a different namespace? #2670
-
Hello there! I finished setting up a cluster via the Helm chart and it was pretty easy! With the CRD, I initialized my Postgres cluster and it works well - the Now I want to start building deployments that take advantage of the cluster. And, most importantly, I need to add users and databases for them to use. With the cluster created in the Take shiori for instance: It can use Postgres as a storage backend. Right now, I have it set to use sqlite, so I could test it out. But I like it, intend to keep it, and want to reconfigure it to use the cluster instead. The question is... how? Here is the entire postgres cluster configuration: Manifest (YAML)apiVersion: v1
kind: Namespace
metadata:
name: postgres-operator
---
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: postgres-operator
namespace: kube-system
spec:
repo: https://opensource.zalando.com/postgres-operator/charts/postgres-operator
chart: postgres-operator
targetNamespace: postgres-operator
valuesContent: |-
configMajorVersionUpgrade:
major_version_upgrade_mode: "full"
configKubernetes:
additional_pod_capabilities:
- "SYS_NICE"
cluster_domain: kube.birb.it
enable_cross_namespace_secret: true
enable_finalizers: true
enable_readiness_probe: true
# namespaced name of the secret containing infrastructure roles names and passwords
# infrastructure_roles_secret_name: postgresql-infrastructure-roles
# toggle if `spilo-role=master` selector should be added to the PDB (Pod Disruption Budget)
#pdb_master_label_selector: false
persistent_volume_claim_retention_policy:
when_deleted: "delete"
#when_scaled: "retain"
#configLoadBalancer: {...}
configDebug:
debug_logging: false
enable_database_access: true
#configTeamsApi: {...}
---
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: postgres-operator-ui
namespace: kube-system
spec:
repo: https://opensource.zalando.com/postgres-operator/charts/postgres-operator-ui
chart: postgres-operator-ui
targetNamespace: postgres-operator
valuesContent: |-
envs:
appUrl: "https://postgres.birb.it"
targetNamespace: "*"
teams:
- my-default
ingress:
enabled: true
hosts:
- host: postgres.birb.it
paths: ["/"]
---
apiVersion: v1
kind: Namespace
metadata:
name: postgres
---
apiVersion: acid.zalan.do/v1
kind: postgresql
metadata:
name: default-cluster
namespace: postgres
spec:
teamId: my-default
volume:
size: 50Gi
storageClass: nfs-bunker # network-local NFS storage
numberOfInstances: 1
users:
baseline_user: # database owner
- superuser
- createdb
shiori: []
databases:
# TODO: figure out the right way...
shiori: shiori
#preparedDatabases:
# bar: {}
postgresql:
version: "16" This uses k3s' Helm controller for the installation. Meanwhile, there is the The question is: How do I create a user and database on my Thank you and kind regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I found it myself.
There is a ReadTheDocs page: https://postgres-operator.readthedocs.io/en/latest/user/ |
Beta Was this translation helpful? Give feedback.
I found it myself.
<namespace>.<user>
There is a ReadTheDocs page: https://postgres-operator.readthedocs.io/en/latest/user/