Không có mô tả

Tino 4ff3383b2b Ajusto Dockerfile y deployment 5 tháng trước cách đây
Consola 4ff3383b2b Ajusto Dockerfile y deployment 5 tháng trước cách đây
Local ec4bfceeb6 Añado cluster-example.yaml 6 tháng trước cách đây
._cluster-example.yaml 515a125243 Primer commit 6 tháng trước cách đây
._kubecon-webapp-cnpg 515a125243 Primer commit 6 tháng trước cách đây
._reymota-pg-cluster.yaml 515a125243 Primer commit 6 tháng trước cách đây
README.md 44909e1b55 Corrijo formato de pgadmin4 5 tháng trước cách đây
aumentoPVC.md 81a7b73601 Pongo ayuda de cómo aumentar la PVC 5 tháng trước cách đây
k8s-pg-cluster.yaml 8eaadfb729 Añado yaml para crear nuevas bd 6 tháng trước cách đây
namespace.yaml 4ff3383b2b Ajusto Dockerfile y deployment 5 tháng trước cách đây
nueva-db.yaml 8eaadfb729 Añado yaml para crear nuevas bd 6 tháng trước cách đây
pgadmin-values.yaml 9d90011c6a Cambio ip en values.yaml 5 tháng trước cách đây
reymota-pg-cluster.yaml a25daf18fb Aumento a 50Gi 5 tháng trước cách đây

README.md

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