🌐
Red Hat
developers.redhat.com › learning › learn:openshift:build-and-populate-database-using-kubernetes-init-containers › resource › resources:create-postgresql-instance-configmap-and-deployment-objects
Create the PostgreSQL instance, ConfigMap, and Deployment objects | Build and populate a database using Kubernetes init containers | Red Hat Developer
February 17, 2026 - Likewise, you can view the Kubernetes documentation related to configuring a pod to use a ConfigMap. When those two pieces of knowledge are combined, you get a deployment that, in our case, includes the following (an explanation follows this section of the YAML file): spec: initContainers: - name: init-createdb image: postgres:14 command: ["psql", "postgresql://postgres:postgres@postgresql", "-f", "/etc/rsalbums/create_database.sql"] volumeMounts: - name: albums-volume mountPath: /etc/rsalbums - name: init-builddb image: postgres:14 command: ["psql", "postgresql://postgres:postgres@postgresql/
🌐
Bobcares
bobcares.com › blog › postgres-kubernetes-configmap
Postgres Kubernetes ConfigMap | How to Deploy
February 21, 2024 - apiVersion: v1 kind: ConfigMap metadata: name: postgres data: POSTGRES_DB: myapp_production · Kubernetes Secrets can be expressed via a manifest.
🌐
Stack Overflow
stackoverflow.com › questions › 64259293 › change-postgres-config-using-kubernetes-configmap
postgresql - Change Postgres config using Kubernetes configMap - Stack Overflow
October 8, 2020 - apiVersion: v1 kind: ConfigMap metadata: name: pg-hba-configmap data: pg_hba.conf: |+ # TYPE DATABASE USER ADDRESS METHOD # Some personal settings here --- apiVersion: apps/v1 kind: StatefulSet metadata: name: db spec: selector: matchLabels: app: db serviceName: db replicas: 1 template: metadata: labels: app: db spec: nodeSelector: db: 'true' containers: - name: db image: kartoza/postgis:10.0-2.4 volumeMounts: - name: data-volume mountPath: /var/lib/postgresql - name: pg-hba-config-volume mountPath: /var/lib/postgresql/10/main/pg_hba.conf subPath: pg_hba.conf volumes: - name: data-volume hostPath: path: /data/db - name: pg-hba-config-volume configMap: name: pg-hba-configmap
🌐
CloudyTuts
cloudytuts.com › guides › kubernetes › how-to-deploy-postgress-kubernetes
How to Deploy Postgres on Kubernetes - CloudyTuts
September 8, 2020 - Data stored in a ConfigMap not encrypted. These Kubernetes resources should be only be used with data that is non-sensitive. apiVersion: v1 kind: ConfigMap metadata: name: postgres data: POSTGRES_DB: myapp_production
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-deploy-postgres-to-kubernetes-cluster
How to Deploy Postgres to Kubernetes Cluster | DigitalOcean
March 25, 2026 - kubectl create secret generic postgres-auth \ --namespace postgres-demo \ --from-literal=POSTGRES_PASSWORD='ReplaceWithStrongPassword' ... apiVersion: v1 kind: ConfigMap metadata: name: postgres-config namespace: postgres-demo data: POSTGRES_DB: appdb POSTGRES_USER: appuser
🌐
GitHub
github.com › kubernetes › kubernetes › issues › 70241
config map vs secret to store credentials for Postgres deployment · Issue #70241 · kubernetes/kubernetes
October 25, 2018 - - env: - name: POSTGRES_DB valueFrom: configMapKeyRef: name: postgres-config key: POSTGRES_DB - name: POSTGRES_USER valueFrom: configMapKeyRef: name: postgres-config key: POSTGRES_USER - name: POSTGRES_PASSWORD valueFrom: configMapKeyRef: name: postgres-config key: POSTGRES_PASSWORD
Author   AndriiOmelianenko
🌐
Kubegres
kubegres.io › doc › override-default-configs.html
Override default configs
This script above assumes that the env-var $POSTGRES_MY_DB_PASSWORD contains the password of the custom user to create. Please see an example about how to add a custom env-variable. Please see below an example of an overridden "backup_database.sh" in a custom ConfigMap, which contains the logic to dump PostgreSql Primary's database:
🌐
Medium
medium.com › @xcoulon › managing-pod-configuration-using-configmaps-and-secrets-in-kubernetes-93a2de9449be
Managing Pod configuration using ConfigMaps and Secrets in Kubernetes | by Xavier Coulon | Medium
November 28, 2017 - $ kubectl create -f templates/database-deployment.yml deployment "postgres" created$ kubectl get all NAME READY STATUS RESTARTS AGE po/postgres-3585693371-xnzjv 1/1 Running 0 5sNAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE svc/postgres 10.0.0.191 <none> 5432/TCP 7dNAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE deploy/postgres 1 1 1 1 5sNAME DESIRED CURRENT READY AGE rs/postgres-3585693371 1 1 1 5s
🌐
Eksworkshop
developers.eksworkshop.com › introduction to kubernetes › initializing postgresql database with kubernetes configmaps
Initializing PostgreSQL Database with Kubernetes ConfigMaps | EKS Developers Workshop
This lab walks you through the process of creating a Kubernetes ConfigMap for the init.sh script in the 'my-cool-app' namespace. ... Navigate to the root directory of the python-fastapi-demo-docker project where your environment variables are sourced: ... Our PostgreSQL database requires custom ...
Find elsewhere
🌐
Kubernetes
kubernetes.io › docs › concepts › configuration › configmap
ConfigMaps | Kubernetes
November 21, 2025 - For example, imagine that you are developing an application that you can run on your own computer (for development) and in the cloud (to handle real traffic). You write the code to look in an environment variable named DATABASE_HOST.
🌐
BMC Software
bmc.com › blogs › kubernetes-postgresql
Deploying PostgreSQL as a StatefulSet in Kubernetes – BMC Software | Blogs
July 2, 2021 - This will also enable us to create a StatefulSet using the data in the ConfigMap. # PostgreSQL StatefulSet - ConfigMap apiVersion: apps/v1 kind: StatefulSet metadata: name: postgresql-db spec: serviceName: postgresql-db-service selector: matchLabels: app: postgresql-db replicas: 2 template: metadata: labels: app: postgresql-db spec: containers: - name: postgresql-db image: postgres:latest volumeMounts: - name: postgresql-db-disk mountPath: /data # Config from ConfigMap envFrom: - configMapRef: name: postgres-db-config # Volume Claim volumeClaimTemplates: - metadata: name: postgresql-db-disk spec: accessModes: ["ReadWriteOnce"] resources: requests: storage: 25Gi
🌐
GitHub
gist.github.com › nathanborror › 36ebcb42472775b1aa4a8edc135ee615
Example Kubernetes setup with Postgres and two Services for serving an API and a static site using Ingress. Also have a CronJob example for kicks. · GitHub
April 12, 2022 - Example Kubernetes setup with Postgres and two Services for serving an API and a static site using Ingress. Also have a CronJob example for kicks. - instructions.txt
🌐
GitHub
github.com › zalando › postgres-operator › blob › master › manifests › configmap.yaml
postgres-operator/manifests/configmap.yaml at master · zalando/postgres-operator
pdb_name_format: "postgres-{cluster}-pdb" persistent_volume_claim_retention_policy: "when_deleted:retain,when_scaled:retain" pod_antiaffinity_preferred_during_scheduling: "false" pod_antiaffinity_topology_key: "kubernetes.io/hostname" pod_deletion_wait_timeout: 10m · # pod_environment_configmap: "default/my-custom-config" # pod_environment_secret: "my-custom-secret" pod_label_wait_timeout: 10m ·
Author   zalando
🌐
Readthedocs
postgres-operator.readthedocs.io › en › stable › reference › operator_parameters
Configuration parameters - Postgres Operator - Read the Docs
In that case, the operator defines a pod toleration according to the values of those keys. See kubernetes documentation for details on taints and tolerations. The default is empty. pod_environment_configmap namespaced name of the ConfigMap with environment variables to populate on every pod.
🌐
VMware
techdocs.broadcom.com › us › en › vmware-tanzu › data-solutions › tanzu-for-postgres-on-kubernetes › 3-0 › tnz-postgres-k8s › configure-postgresql-server.html
Customizing the PostgreSQL Server - Broadcom TechDocs
January 23, 2026 - apiVersion: v1 kind: ConfigMap metadata: name: my-postgresql-configmap labels: app: postgres data: log_truncate_on_rotation: "on" log_rotation_age: "1d" log_filename: "postgresql-%A.log" log_rotation_size: "0" logging_collector: "on" Once Kubernetes updates the volume mount, it applies your changes, and the pods will be restarted based on the parameter Restart field value:
🌐
Refine
refine.dev › home › blog › engineering › how to deploy postgres on kubernetes
How to deploy Postgres on Kubernetes | Refine
January 22, 2024 - They're instrumental in separating ... PostgreSQL settings you wish to configure. Common examples include max_connections, shared_buffers, and log_statement....
🌐
Medium
jineshnagori.medium.com › ultimate-guide-to-setting-up-postgresql-in-kubernetes-with-statefulsets-adminer-dashboard-and-6232323cb4dc
Ultimate Guide to Setting Up PostgreSQL in Kubernetes with StatefulSets, Adminer Dashboard, and Ingress. | by Jinesh Nagori | Medium
August 29, 2023 - kind: PersistentVolume apiVersion: v1 metadata: name: postgres-pv-volume labels: type: local app: postgres spec: storageClassName: manual capacity: storage: 5Gi accessModes: - ReadWriteMany hostPath: path: "/mnt/data" A ConfigMaps in Kubernetes lets us mount files on containers without the need to make changes to the Dockerfile or rebuilding the container image.
🌐
Adam the Automator
adamtheautomator.com › postgres-to-kubernetes
How to Deploy Postgres to Kubernetes
April 27, 2022 - For the production environment, deploying secrets such as password authentication using the Kubernetes secret is highly recommended for security. 1. Create a new YAML configuration file (postgres-configmap.yaml) and populate the following configuration.
🌐
VMware
techdocs.broadcom.com › us › en › vmware-tanzu › data-solutions › tanzu-for-postgres-on-kubernetes › 3-0 › tnz-postgres-k8s › configure-pghba-file.html
Configure the pg_hba.conf File - Broadcom TechDocs
January 23, 2026 - apiVersion: v1 kind: ConfigMap metadata: name: my-postgresql-hba-configmap labels: app: postgres data: pg_hba.custom.conf: | host "postgres-sample" "pgappuser" ::0/0 scram-sha-256 host "postgres-sample" "pgadmin" ::0/0 scram-sha-256 ... After Kubernetes updates the volume mount it applies your changes, and the Postgres server is reloaded to include your changes: