Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

236
Vistas
Horizontal scaling of postgres in kubernetes cluster

I have the following requirements for my application to be deployed in Kubernetes Cluster. I am trying to come up with an architecture that resembles my other microservice deployment and not complicated.

  • The database server nodes should have reserved capacity
  • When CPU utilization goes above 60% a new database instance should spawn
  • The application and the database will reside in the same cluster
  • Need to support high consistency (NOT eventual consistency)

I am thinking about having multiple replicas that will connect to the same volume (NAS in my case). The postgres instances will sit behind a service like my application microservices. Application will connect to the service and does not need to know which Postgres instance it is talking with. This simplifies my architecture a great deal as I don't have to worry about setting up Postgres replication.

One issue in this architecture is what happens to data if a Postgres instance goes down after a write request is received. I can introduce a message broker with consumer acknowledgement to handle this scenario, but that has some performance implication.

A sample Postgres K8s deployment configuration is shown below. I will need to add service etc.

What are some pitfall of this architecture? Have anyone implemented something similar?

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: postgres
spec:
  replicas: 3
  template:
    metadata:
      labels:
        app: postgres
    spec:
      containers:
        - name: postgres
          image: postgres:latest
          imagePullPolicy: "IfNotPresent"
          ports:
            - containerPort: 5432
          envFrom:
            - configMapRef:
                name: postgres-config
          volumeMounts:
            - mountPath: /var/lib/postgresql/data
              name: postgredb
      volumes:
        - name: postgredb
          persistentVolumeClaim:
            claimName: postgres-pv-claim
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

It is not completely clear to me, but it sounds like you are talking about Shared Disk Failover

To answer your question, the pitfalls are:

  • Your NAS is a single point of failure
  • Your replicas are standby replicas, so they cannot be used to scale

I think in order to get scalability and not just fault tolerance, you would need to use replication.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda