BCDevOps / OpenShift4-Migration

Scripts and info for Ministry teams migration from OpenShift 3.11 to 4.x
Apache License 2.0
3 stars 0 forks source link

Why do I see a network error in my Patroni logs? #6

Closed jleach closed 2 years ago

jleach commented 3 years ago

TL;DR

Your newly minted namespace on OCP4 uses Aporeto to create a zero trust network. As a result, none of your workload (pods) can talk to each other. You'll need to write some Network Security Policy (NSP) for your StatefulSet (patroni Pods) to talk to one another.

Fixing Patroni Network Issues

If you're seeing something like the error below in your Patroni logs it often means your pods can't talk to one another. This is probably because you need to add some NSP to let them talk.

2020-10-16 04:54:02,790 ERROR: ObjectCache.run ProtocolError('Connection broken: 
IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))

See the db-to-db NSP in this example. In the NSP the name of the StatefulSet is used as an identifier so that any pod that is a part of the StatefulSet can talk to any other member in the same set, as long as the pods are in the same namespace.