No description
Find a file
2026-03-03 14:07:51 +00:00
Consola Ajusto Dockerfile y deployment 2026-03-03 14:07:51 +00:00
Local Añado cluster-example.yaml 2026-01-28 12:24:34 +00:00
._cluster-example.yaml Primer commit 2026-01-26 07:41:58 +00:00
._kubecon-webapp-cnpg Primer commit 2026-01-26 07:41:58 +00:00
._reymota-pg-cluster.yaml Primer commit 2026-01-26 07:41:58 +00:00
aumentoPVC.md Pongo ayuda de cómo aumentar la PVC 2026-02-25 07:51:34 +00:00
k8s-pg-cluster.yaml Añado yaml para crear nuevas bd 2026-01-28 15:44:08 +01:00
namespace.yaml Ajusto Dockerfile y deployment 2026-03-03 14:07:51 +00:00
nueva-db.yaml Añado yaml para crear nuevas bd 2026-01-28 15:44:08 +01:00
pgadmin-values.yaml Cambio ip en values.yaml 2026-03-03 07:42:20 +00:00
README.md Corrijo formato de pgadmin4 2026-02-18 11:54:55 +00:00
reymota-pg-cluster.yaml Aumento a 50Gi 2026-03-03 06:47:29 +00:00

Creación de cluster PG

Instalar el operador

Descargar la última versión siguiendo estas instrucciones

Cuando escribí esto la última versión era la 1.28, por lo tanto:

kubectl apply --server-side -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.28/releases/cnpg-1.28.0.yaml

Instalar el cluster

Para instalar el cluster de reymota, he creado el siguiente manifiesto, llamado reymota-pg-cluster.yaml

apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
  name: postgres-cluster
  namespace: reymota-pg-cluster
spec:
  instances: 3

  imageName: ghcr.io/cloudnative-pg/postgresql:16

  primaryUpdateStrategy: unsupervised

  storage:
    size: 1Gi

  superuserSecret:
    name: postgres-superuser

  bootstrap:
    initdb:
      database: reymotadb
      owner: creylopez
      secret:
        name: postgres-app-user

---
apiVersion: v1
kind: Secret
metadata:
  name: postgres-superuser
  namespace: reymota-pg-cluster
type: kubernetes.io/basic-auth
stringData:
  username: postgres
  password: Rey-1176

---
apiVersion: v1
kind: Secret
metadata:
  name: postgres-app-user
  namespace: reymota-pg-cluster
type: kubernetes.io/basic-auth
stringData:
  username: creylopez
  password: Dsa-0213

---
apiVersion: v1
kind: Service
metadata:
  name: postgres-nodeport
  namespace: reymota-pg-cluster
spec:
  type: NodePort
  selector:
    cnpg.io/cluster: reymota-pg-cluster
    role: primary
  ports:
    - name: postgres
      protocol: TCP
      port: 5432
      targetPort: 5432
      nodePort: 30432

que se instala con:

kubectl create ns reymota-pg-cluster

kubectl apply -f reymota-pg-cluster.yaml

Acceder al cluster postgres desde pods en otros namespaces

psql -U creylopez -h postgres-cluster-rw.reymota-pg-cluster.svc.cluster.local -p 5432 reymotadb

pgadmin4

Instrucciones

helm repo add runix https://helm.runix.net
helm install pgadmin4 runix/pgadmin4 -f pgadmin-values.yaml