6

In my opinion an Operations candidate (DevOps is a culture, not a role) should be capable to perform at least the following actions: deploy postgres backup postgres restore postgres run some psql commands like select and some innerjoins knows what the effect on memory usage would be if a select * is issued No manual labour, only automation. Deploy the ...


5

As per Martin Flowers' definition of Blue-Green deployment The blue-green deployment approach does this by ensuring you have two production environments, as identical as possible. At any time one of them, let's say blue for the example, is live. As you prepare a new release of your software you do your final stage of testing in the green environment. Once ...


5

First, use alpine images if possible. Second, use ENV variables for prepare database configuration. More info. Third, use /docker-entrypoint-initdb.d directory for extend image. More info. Example stack with devlopment environment. version: '3.2' services: example: image: "${EXAMPLE_SERVICE}:${EXAMPLE_SERVICE__VERSION}-development" build: ...


3

Something like: pg_isready --host=192.168.79.8 --username=test --port=5432 192.168.79.8:5432 - no response Another solutions is telnet: telnet 192.168.79.8 5432 Which returns: Trying 192.168.79.8... Connected to 192.168.79.8. Escape character is '^]'. If the database is accessible.


3

You did everything right, it is the correct InSpec test and use with Docker! You encountered a bug in InSpec that is related to InSpec's netstat output parsing combination with Alpine's netstat output. See InSpec's output for postgres container instead of postgres:alpine: $ inspec exec docker_test.rb -t docker://1c8162517c22 ...


2

I ended up using stolon for its automatic leader election and fail over handling. Crunchy Data offers small building blocks so there is a lot of work to do to put them all together while stolon has a ready helm chart. But I didn't try patroni since stolon worked just fine.


2

You can not change the port that Azure Database for PostgreSQL server uses. Connections to your Azure Database for PostgreSQL server communicate over port 5432. When you try to connect from within a corporate network, outbound traffic over port 5432 might not be allowed by your network's firewall. If so, you can't connect to your server unless your IT ...


2

The following setup works for me. When using the subPath in volumeMounts, the permission issue is automatically addressed, as the user postgres owns the folder corresponding to the subPath. spec: ... containers: - ... volumeMounts: # need a subpath as postgres wants an empty folder (the mounted folder `/var/lib/...


2

One way to use curl inside the container will be to use a custom Dockerfile to build you postgrsql container. Just use the image: postgres:12-alpine as the base image of your Dockerfile and install curl in alpine with the following command : RUN apk --no-cache add curl


2

Yes, you can create a Postgres cluster using k8s StatefulSets. take a look at this example.


2

To add to 030's answer, and as a devops engineer who has had to do this a few times, learning how to set up replication and failover in an automated fashion is very important. If you're learning, start by setting up replication by hand on some test servers https://www.postgresql.org/docs/13/runtime-config-replication.html Then craft a method for automating ...


1

After a while I found out that I need to declare the container to have a privileged security context. Suddenly it works! spec: containers: - securityContext: privileged: true There is also an article showing how to have a two-layered setup where the container that hosts the actual application does not need to be privileged: https://itnext.io/...


1

We keep a RO clone of the important DB's. Any dev can access the basic RO clone if he's in the right dev group vpn, because the cloudsql instances are deployed in a private service net that peers with our private net and get be gotten to from the outside. If not they can get added it a group.. Then they just need the ip address and they need the user and ...


1

PGBouncer is a connection pooler. So, one instance of PGBouncer should be enough in between the apps and postgres.


1

It's hard to tell, this kind of thing comes with experience but I'm sure 4 GB of RAM and 20 GB of disk storage will be enough.


1

Actually, there are two questions: Where default(100) value is declared? How can I see Stats target value before applying SET default_statistics_target=1000 Where default(100) value is declared? You can see it in the source code { {"default_statistics_target", PGC_USERSET, QUERY_TUNING_OTHER, gettext_noop("Sets the default statistics ...


1

As promised, here is a solution using haproxy with sticky cookies. Note, that this approach requires support on the application side (as only your application layer may know once transactions are completed). To achieve this, first - start with haproxy configuration of the following kind: global daemon maxconn 256 defaults ...


1

What is the default user of postgresql? postgres How does hardcoding the postgres user improve security? It's not using the root user. You can use any account you like, but consistency is a Wonderful Thing, especially when you have lots [and lots] of Postgres clusters to manage. What special rights does the postgres user have? Not many. It ...


1

I searched for the healthcheck/postgres:alpine and I found the following repository with the Dockerfile: https://github.com/docker-library/healthcheck/blob/master/postgres/Dockerfile.alpine Assuming this is the correct repo for your docker image, the dockerfile specifies: FROM postgres COPY docker-healthcheck /usr/local/bin/ HEALTHCHECK CMD ["docker-...


1

First chef runs as often as you configure it to do. Second Chef is a configuration management system and not a crontab or an orchestration system. Use chef to configure cron (that can not be not an option, try to find out why this is not considered) for your backup using consul-template to retrieve the secret from vault. Don't use Chef to run the backups ...


Only top voted, non community-wiki answers of a minimum length are eligible